-
Notifications
You must be signed in to change notification settings - Fork 12.8k
use typescript compiled files with systemjs #3444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
using latest from master or release-1.5, |
@mhegazy I am actually just trying the master branch, but I seem to get into some trouble. I have a repo setup without TS, but I made a branch where I switched to TS. I am a bit unsure how to solve this, because TS compiles just fine with no warnings, but when I try to run the app, it kind of fails ( |
I think it might have something to do with circular deps., but I am not sure. |
@mhegazy I've just tested my theory, but it has proven wrong. How about I've also seen that the output of typescript compiling the files does not have any trace of |
@rolandjitsu i believe the angular code still depends on traceure runtime. ngconfdemo is still pulling it in as well. |
@rolandjitsu currently Angular2 still uses traceur and thus depends on traceur runtime.. |
@vladima, @mhegazy I've included traceur runtime as well. I am not quite sure where the issue occurs. But you should check the repo I made, you can see there my current setup of TS, Traceur and SystemJS. Sent from my iPhone
|
@mhegazy, @vladima I managed to setup TS eventually. The example you have from ngConf is using SystemJS to compile the ts files at runtime, but I am actually compiling before hand. So it wasn't that helpful. I did not manage to make it work using the |
what is interesting, result |
How can I use Component instead of ComponentAnnotation as Component, when I use Component it's throw an Error: Error during instantiation of Token(ComponentRef)!. ORIGINAL ERROR: No Directive annotation found on App |
@rolandjitsu yes, for some reason I was getting different content for angular.js depending on whether I use |
@vladima I've actually got an older version of both, 16.6 I think. I will give it a try and see how that works out, let's hope I won't have that issue :) |
@vladima once I've updated, everything breaks :) Something to do with But, as I mentioned before, I do not use TS with runtime compilation, I compile the files to js in If that is the case, I am not sure how to make it work. Plus, I seem to have some other issues now that I upgraded SystemJS (es6 module loader is not necessary anymore). |
there is an existing issue systemjs/systemjs#506 that tracks path related questions for TypeScript in SystemJS. |
My team believes we found a bug today with TypeScript compilation to Systemjs.
This is the output:
This generates an error because the both reflector_1 and reflections_capabilities_1 are undefined. Even though the imports are specified in the source file, those imports are not being translated to the systemjs output. We believe this might be caused by the fact that no name is ever being added to the registration call. |
@ttowncompiled I have same problem in angular2 to js with system module So I also hope typescript can remove dumplicate dependence, After I try to fix this problem in typescript compiler, It feel like it sames need more hours than i expect. I have to do it manually following angular2 1.5.32 file have dumplicate dependence in system.register array
I use regex to fetch the error file, maybe it can help you
|
Having duplicate entries in the list of dependencies should be perfectly fine, they should be handled correctly by SystemJS. If you are seeing some unexpected behavior related to duplicate entries, can you provide a repro as it is a bug that should be fixed. I also would appreciate a repro for the original problem so it can be addressed as well |
They have deleted duplicate entries, |
@xsilen building Angular 2 works just fine, the problem is with a |
NO NO NO, it is going to wrong System.register(['./reflector', './reflector', './reflection_capabilities'], function(exports_1) {
var reflector_1, reflection_capabilities_1;
var reflector;
return {
setters:[
function (_reflector_1) {
reflector_1 = _reflector_1;
},
function (_reflector_2) {
exports_1("Reflector", _reflector_2["Reflector"]);
},
function (_reflection_capabilities_1) {
reflection_capabilities_1 = _reflection_capabilities_1;
}],
execute: function() {
exports_1("reflector", reflector = new reflector_1.Reflector(new reflection_capabilities_1.ReflectionCapabilities()));
}
}
}); Right code run perfect in current systemjs should be like this System.register(['./reflector', './reflection_capabilities'], function(exports_1) {
var reflector_1, reflection_capabilities_1;
var reflector;
return {
setters:[
function (_reflector_1) {
reflector_1 = _reflector_1;
exports_1("Reflector", _reflector_1["Reflector"]);
},
function (_reflection_capabilities_1) {
reflection_capabilities_1 = _reflection_capabilities_1;
}],
execute: function() {
exports_1("reflector", reflector = new reflector_1.Reflector(new reflection_capabilities_1.ReflectionCapabilities()));
}
}
}); I have fixed the feature(combine dumplicate dependence) in my local typescript compiler. i am checking if there are extra bug will make |
It sames also have out scope variable declare bug, in higher systemjs, I use systemjs 0.14 and sames work well |
@xsilen are you saying that the fix in the latest SystemJS isn't working for you here? I'd be interested to hear why if this is the case? |
Deduplication of dependencies was added in ##4257 |
hi there, |
@vpaulino why do you think this is related? the output in your SO question is what i would expect. |
@mhegazy the dependencies modules are not generated in the call System.register( [] <-- the array is empty. what is that i'm doing wrong ? wasn't supposed that the constructor parameters be resolved by the parameters of System.Register array 1st argument ? why aren't they generated ? |
How do I use the compiled typescript files with systemjs? Can typescript compile in the
System.register
format as traceur can?The text was updated successfully, but these errors were encountered: