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

Question: support/hints for Web Components? #254

Open
akavel opened this issue May 7, 2018 · 2 comments
Open

Question: support/hints for Web Components? #254

akavel opened this issue May 7, 2018 · 2 comments
Labels
discussion An issue that requires a discussion question

Comments

@akavel
Copy link

akavel commented May 7, 2018

I'm interested in trying to use Web Components in an Elm app created using the awesome create-elm-app project. The guide to Web Components at elmprogramming.com looks very attractive; however, it assumes one will use bower. I'm a total newbie both to Elm and the general JS ecosystem, but Google seems to tell me, that bower is apparently "deprecated", and new JS projects should use webpack+npm (?). I see create-elm-app apparently has support for npm packages; not sure about webpack ones? But regardless, IIUC, the Web Components ecosystem seems to have standardized on bower.

I see there are some guides on how to migrate from bower to webpack, but it's already starting to be too much over my head, when I'm just starting to learn Elm, and don't really know the JS ecosystem either.... :/ Is there some chance you could possibly give some hints on whether one could add some Web Components into a create-elm-app project in some sensible way? Is it possible to add such an entry to the awesome "Usage Guide"? Do you think it can be possible without doing the dreaded "eject"?

Is it maybe related to #176? Can hipertracker/create-elm-app possibly help here somehow?

@halfzebra halfzebra added feature A feature request good first issue discussion An issue that requires a discussion labels May 16, 2018
@1602
Copy link
Contributor

1602 commented Jul 16, 2018

@akavel I run into the same issue while using create-elm-app, couldn't find an option other than ejecting and dealing with webpack. There are few things that required to package elm as web component (without need for bower and html imports): you code should be transpiled to ES6, css should be inlined.

Not quite sure about the last point (regarding inlining css), but that's what I ended up doing. If you're interested, here's an example of elm app packaged as web component: https://github.com/1602/json-viewer it might be not 100% right, but it works.

@halfzebra halfzebra added question and removed feature A feature request good first issue labels Sep 20, 2018
@janwirth
Copy link
Contributor

I think I will use a git submodule for the web components rather than ejecting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion An issue that requires a discussion question
Projects
None yet
Development

No branches or pull requests

4 participants