ember-learn / cli-guides

Step-by-step guides and tutorials for using the ember-cli to create apps and addons
https://cli.emberjs.com
MIT License
25 stars 76 forks source link

Add extra documentation for app.import #226

Closed captain-enjoyable closed 3 years ago

captain-enjoyable commented 3 years ago

I struggled for a while to figure out how to import a web worker and eventually stumbled across this merged RFC.

It is very possible this is documented elsewhere and I missed it, but this seems like the appropriate place for the information. 😅

mansona commented 3 years ago

Hey @matteddy 👋 thanks for the contribution.

While I'm not against adding documentation for something that actually works with ember-cli, I'm pretty sure that the "recommended" way to do things is to use ember-auto-import these days 🤔 Did you give it a go? Did that also not work for you?

If ember-auto-import does work for you I wonder if you think we should add something like https://guides.emberjs.com/release/addons-and-dependencies/#toc_regular-npm-packages to the cli-guides as well? 🤔

jenweber commented 3 years ago

I think ember-auto-import only helps you out if your file is in an npm package. For serving up individual files in vendor, this is still useful. I vaguely recall that web workers are really particular about how they get imported.

Even if auto-import helped here, the "advanced" section of the CLI guides is where things like this belong, I think. That way, if someone sees it in an app file they didn't write, they can learn something about it. @mansona is it ok with you to merge?

amyrlam commented 3 years ago

Related conversation for posterity: https://discord.com/channels/480462759797063690/486548111221719040/842424159610077214