jspm / registry

The jspm registry and package.json override service
https://jspm.io
229 stars 256 forks source link

add esModule marker for compatibility with SystemJS 0.20 #1043

Closed aluanhaddad closed 7 years ago

aluanhaddad commented 7 years ago

This allows for correct loading of tslib under jspm 0.17/SystemJS 0.20 while preserving compatibility with jspm 0.16/SystemJS 0.19. See related discussion in #1040, #1041, and https://github.com/Microsoft/tslib/issues/26.

I have tested this under jspm@0.17.41 with SystemJS@0.20.10 and under jspm@0.16.53 with SystemJS@0.19.46.

guybedford commented 7 years ago

Lgtm //cc @frankwallis On Fri, 17 Mar 2017 at 03:57, Aluan Haddad notifications@github.com wrote:

This allows for correct loading of tslib under jspm 0.17/SystemJS 0.20 while preserving compatibility with jspm 0.16/SystemJS 0.19. See related discussion in #1040 https://github.com/jspm/registry/pull/1040, #1041 https://github.com/jspm/registry/pull/1041, and Microsoft/tslib#26 https://github.com/Microsoft/tslib/issues/26.

You can view, comment on, or merge this pull request online at:

https://github.com/jspm/registry/pull/1043 Commit Summary

  • add esModule marker for compatibility with SystemJS 0.20

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jspm/registry/pull/1043, or mute the thread https://github.com/notifications/unsubscribe-auth/AAkiysOatNnHqrlUXql6yfibmmjBUnBpks5rmeiGgaJpZM4MgFx9 .

aluanhaddad commented 7 years ago

@frankwallis any chance you can take a look at this?

frankwallis commented 7 years ago

LGTM - in fact I thought I had already done this in the last commit but it appears not, maybe I just added a local override.

aluanhaddad commented 7 years ago

@frankwallis, @guybedford I've found this does not work correctly when running jspm bundle in 0.17 Specifically, the esModule metadata seems to be ignored. In browser transpilation works perfectly.

guybedford commented 7 years ago

@aluanhaddad thanks for letting me know. It would help to know how it is being ignored in the bundling process. Does it fail bundling? Or does it not get included in the package config in the bundle itself?

aluanhaddad commented 7 years ago

@guybedford Sorry for not being more specific.

The bundling process completes successfully and the bundle in turn contains the full package config.

The error happens at runtime. The named exports of tslib are not available on the imported module when the bundle is executed. It only exposes the default.

guybedford commented 7 years ago

@aluanhaddad thanks for the clarification, in that case it sounds like this might be resolved by https://github.com/systemjs/builder/issues/775, which would ensure the bundle includes the esModule flag.