-
-
Notifications
You must be signed in to change notification settings - Fork 54
Import syntax should "just work" for ES6 modules available via npm #84
Comments
One thought I've had on this is that we could add a "resolvedTree" which is merged into the vendor tree at the end. Essentially:
|
The fun bit, is how does one support this in add-ons and nested addo-ns. E.g. the lack of a highlander node_module is the source of us never rolling ember-browserify or similar in by default. There are some problems/solutions:
Doing this automagically has its risks (surprise inclusions, and a more complicated implementation). I believe we should strongly consider the |
@runspired one of the things:
|
I heard this will work for 2.14 or 2.15? |
We are using Ember-CLI 2.15 beta 1 because it works there (and is mentioned in the release notes). |
Great thx. |
Sounds nice. @boris-petrov which mention are you refering to though? Is it ember-cli/ember-cli#7045? |
@bjornharrtell - this is the PR, yes. I was talking about this, where it says |
Isn't this RFC broader scoped though? I.e to be able to import modules statically from npm dependencies in app code? I'm often finding myself wanting that and working it around by either importing the source into the project or symlinking the source into the app dir which both are hacky and error prone. |
@runspired Can this be closed now that 2.15 is out, or does this issue cover something that wasn't added in 2.15? |
No, not yet. This issue is roughly tracking being able to add |
The app.import node_modules change in 2.15 helps a bunch! Here's a gist I made of how I used that for c3js/d3js: https://gist.github.com/caseywatts/347e18e4905c447859fa777ec97c34f8 It definitely seems like something that could be automated - the only difference between the two is the package name duplicated everywhere, e.g. |
I would be curious if there is any update about this issue. I'm trying to write an addon for ckeditor 5 and they have a multi package architecture that exposes only ES6 modules. I tried I would love to hear if anyone have a pointer how to achieve this. I don't mind doing the suggested "shim-addon + custom broccoli-funnel+babel" if that's what it takes, I'm just not very familiar with these. Thanks! |
I second @karellm. Please provide reference on how to achieve this. I'm facing a hard time trying to integrate a third-party es6 library in the ember ecosystem 😢 |
@alansouzati I haven't tried it personally but have you considered |
We are working on closing the ember-cli/rfcs repo in favor of using a single central RFC's repo for everything. This was laid out in https://emberjs.github.io/rfcs/0300-rfc-process-update.html. Sorry for the troubles, but would you mind reviewing to see if this is still something we need, and if so migrating this over to emberjs/rfcs? |
Many 3rd part libraries that aren't ember-addons provide es6 versions of their modules. At the moment, consuming these is hard without a shim-addon + custom broccoli-funnel+babel or using something like ember-rollup.
I believe this is something we should make "just work".
The text was updated successfully, but these errors were encountered: