Calling properly TypeScript code from JavaScript -
We had to face situations that are not very well described in the articles and these internet
We need to integrate our existing Javascript infrastructure code which supports SPA, which is being developed by other teams on typecript. We can not change the perspectives (such as just pick one language) for many political boundaries and available development resources. And we fully understand that it is not a good idea to possibly integrate two pieces of structure together in different languages.
However, we need to evaluate the effect and type of Best TypeScript calls from Javascript code. / P>
The rationale is that typedcript has been compiled essentially in JavaScript, it seems vague because there are no reliable sources of information about how to properly use javascript compiled from manuscript javascript Goes and hidden warnings (or alternatives).
It also seems that the opposite position when typing code requires javascript to be called, surprisingly very well described.
Any deep thoughts on the subject?
UPD
Specifically, here is a list of questions that we are now seeking answers:
- < Li> What type of JavaScript script will the TypeScript API use on a large scale generic, class hierarchy, interfaces?
- Is there a problem with bundling, mining, amd here?
- Is it possible with the basic Konnroller controller written in the typescript and other JavaScript communicant controllers that handles the functionality in it? What will be the warning?
Actually we think that we have not yet covered all the questions, they have emerged only a few hours after thinking about that subject.
Just say, if you use javascript in your own project, written in it To integrate a library / experiment, you will use the compiled Javascript API!
You basically throw everything that brings in the case of TypePet Javascript on profit.
Which means that you do not need to take care of certain things for typecript, like Generic etc. You only have to work with the compiled output of the TypeScript library ...
To give an example to you, select "Walkthrough: Generics" On the right you should see the compiled JavaScript. There is no generic or something special, it is still a pure JavaScript
- What would be the JavaScript size of the TypeScript API that uses a large scale generic, class hierarchy, Interface? See above this would be plain old javascript. There is no difference for you.
- Is there a problem with bundling, minimization, AMD? No, because the compiled typecript is plain javascript and can be reduced ...
- What is the basic type of typedcript and other JavaScript controller controller Is it possible to have a Konler controller, which handles functionality from that? What can be the warnings? Yes, you can do that with compiled javascript, you want.
The only disadvantage to using compiled javascript is from Typescirpt, that you can give amazing features TypeScript to you, like ... ... type ... if If the other team is already on that path, you may want to consider writing your part in TypeScript;)
Comments
Post a Comment