atom-typescript icon indicating copy to clipboard operation
atom-typescript copied to clipboard

Compiling incompatibility

Open eliorcohen opened this issue 11 years ago • 3 comments

Hi,

First, let me say that the reason i'm using atom is because of this extension, and it's one of the best implementation of typescript integration i have seen.

now for the bug, i have notice that all my app was braked after the last update in the ATOM. i'm using the ES7 Decorators that shipped with the 1.5 release (that was working fine until the last update..).

after the update, i have notice that the __decorate function that was generated from the tsc didn't generated as it should.

for a backup, i have a gulp build process that utilizing the local typescript compiler, notice the difference in the __metadate function that don't have the full path to the injection.

the code compiled with the atom-typescript:

QuickviewSidebar = __decorate([
            aurelia_framework_1.inject(Element, aurelia_event_aggregator_1.EventAggregator), 
            __metadata('design:paramtypes', [Element, EventAggregator])
        ], QuickviewSidebar);
        return QuickviewSidebar;

this is compiled with the gulp:

QuickviewSidebar = __decorate([
            aurelia_framework_1.inject(Element, aurelia_event_aggregator_1.EventAggregator), 
            __metadata('design:paramtypes', [Element, aurelia_event_aggregator_1.EventAggregator])
        ], QuickviewSidebar);
        return QuickviewSidebar;

after a quick research, i ended up in the source file of the extension, and discovered that you are using the nightly build as the typescript lib, as for i'm using the 1.5-beta.

after replacing the content in the lib with the 1.5-beta files, the code was generated correctly.

this discovery is quite disruptive for the development process, since i'm using the atom-typescript as my main compiler, i'm actually targeting the highly build as my lib reference, meaning that the deployment can be with different behavior, just like i'm experiencing now.

are you planing to add target compiler version feature in the future?

keep the good work, thanks, Elior.

eliorcohen avatar Jul 04 '15 08:07 eliorcohen

You can already target a different TS compiler. In atom-typescript's settings you can specify the full path to a typescriptServices.js and use that compiler instead of the bundled one!

Cu3PO42 avatar Jul 04 '15 10:07 Cu3PO42

after replacing the content in the lib with the 1.5-beta files, the code was generated correctly.

Would be great if you can report it to https://github.com/Microsoft/TypeScript/issues so that it gets resolved in master as well

basarat avatar Jul 06 '15 05:07 basarat

so that it gets resolved in master as well

Found that it was already reported : https://github.com/Microsoft/TypeScript/issues/3663 And considering this comment : https://github.com/Microsoft/TypeScript/pull/3690#issuecomment-118640158 beta contains a bug based on this as well

basarat avatar Jul 06 '15 06:07 basarat