Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove @glimmer/web-component advice for async methods #62

Closed
pittst3r opened this issue Apr 8, 2017 · 8 comments
Closed

Remove @glimmer/web-component advice for async methods #62

pittst3r opened this issue Apr 8, 2017 · 8 comments
Assignees

Comments

@pittst3r
Copy link

pittst3r commented Apr 8, 2017

In tracked-properties.md:

Note: To get async/await to work you must create your project with the --web-component option, or add @glimmer/web-component to your package.json.

I think this is bad advice. This solves the problem by avoiding es5 compilation, which is a terribly broken thing that I think should go away (no prod builds; no minification). Also, installing a package that you don't need to alter the build pipeline in a mysterious way seems bobo to me.

I think what we should be doing is recommending they install babel-polyfill, which directly solves the problem of not having regeneratorRuntime.

@chrishyle
Copy link

chrishyle commented Apr 20, 2017

FWIW, I tried both the --web-component option and installing @glimmer/web-component, but neither "solved" this for me anyways.

@robbiepitts - were you able to successfully get babel-polyfill to work with Glimmer? babel-polyfill internally uses require and just straight-up importing it (as I would in a babel project) does not seem to play well with the @glimmer/application-pipeline stuff which is using only TypeScript (AFAIK) EDIT: It is also using babel inside of rollup-with-dependencies, but it is not invoking it with the "transform-regenerator" plugin.

I'm new to ember-cli, so maybe I'm missing something?

@chrishyle
Copy link

I got it to work by hacking in "transform-regenerator" to the static list in rollup-with-dependencies and adding import 'babel-polyfill/dist/polyfill'; to the top of my index.ts file (note the use of the dist version, to avoid the require issue).

I would take this further, but it looks like people with more experience in this have noticed that the static approach in rollup-with-dependencies.ts is not correct/scalable: glimmerjs/glimmer-application-pipeline#19 removes it entirely. I assume the PR will also move configuration of babel more towards the ember-cli-build.js approach, but there is no description and too many changes for me to dive into it right now.

@chrishyle
Copy link

Also of interest: glimmerjs/glimmer-application-pipeline#83

@pittst3r
Copy link
Author

@chrishyle --web-component is no longer a hack that works for async/await. We've removed that "feature".

We need to do something about this part of the docs. We now have no good recommendation for getting async/await to work but we're talking about using it.

@joelbowen
Copy link

joelbowen commented May 13, 2017

Decided to learn some glimmer tonight, started watching the getting started video, ended up here... I agree with @robbiepitts.

@jenweber
Copy link
Contributor

jenweber commented Jun 4, 2017

@robbiepitts @locks I walked through a temporary fix earlier with @rwjblue after running into this problem myself and finding 5+ unsolved issues about it. I can help with one of the following:

What do you think?

@pittst3r
Copy link
Author

pittst3r commented Jun 5, 2017

@jenweber I think I like the idea of pulling async/await out of the guide. I think it is a red herring. I will defer to @locks though since I am not core.

Thanks a bunch for that PR!

@locks
Copy link
Collaborator

locks commented Jun 6, 2017

Done!

@locks locks closed this as completed Jun 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants