More or less because you have to know in advance all the things you want to import and define them in ember-cli-build.js
-
-
Would it work to have the same `"npm:foo"` requirement as in ember-browserify?
1 reply 0 retweets 0 likes -
Maybe if there was a build step to walk the AST to find imports with "npm" and add those to the requirements
1 reply 0 retweets 1 like -
@eaf4 how does ember-browserify do it?1 reply 0 retweets 0 likes -
Replying to @wycats @charles_demers and
exactly as you describe, it parses all the app's javascript looking for specially formatted imports. If I was redoing it today I would use knowledge from package.json rather than a special "npm:" prefix to determine which things should come from npm.
1 reply 0 retweets 1 like -
Replying to @eaf4 @charles_demers and
Is this something that could be added as an addon API?
1 reply 0 retweets 0 likes -
@eaf4 you'd need to find imports that mapped onto things in package.json right?1 reply 0 retweets 0 likes -
Allow me to raise a loud “please no” to continuing to do the `npm:` namespacing thing. It’s another oddity to document, and there’s more work to be done for every. single. package. imported from npm for TS (because automatic lookup of types fails without mapping in `paths`).
1 reply 0 retweets 2 likes -
Replying to @chriskrycho @eaf4 and
Maybe we can see about helping
@charles_demers update his addon to automatically find the appropriate packages?1 reply 0 retweets 0 likes -
What he has there should actually Just Work™… once you have the stuff listed in your `ember-cli-build.js`. This is one reason I’m really excited about the Packagers stuff currently in progress for Ember CLI: it should make this kind of thing less bespoke.
1 reply 1 retweet 1 like
It seems annoying to have to list it when you already said the same thing in your app via package.json + imports. Shouldn't be too hard to write a function that infers the right packages to add, right?
-
-
If we get “import from npm” working in the general case, TS consumers get everything they need for free 9 times out of 10. (Props to the
@typescriptlang team for making that true.)0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.