-
Notifications
You must be signed in to change notification settings - Fork 105
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
Update for Elm 0.19 #142
Update for Elm 0.19 #142
Conversation
@@ -38,9 +37,7 @@ var getOptions = function() { | |||
? this.options.elm || {} | |||
: this.query.elm || {}; | |||
var loaderOptions = loaderUtils.getOptions(this) || {}; | |||
return Object.assign({ | |||
emitWarning: this.emitWarning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What’s the status on this PR? Is it just on hold until support for 0.18 can be dropped? I ask because I’m working on 0.19-compatible hot reloading based on fluxxu/elm-hot-loader, and one of the last remaining things to do is ensure that it can plug into webpack’s HMR API. If this PR is ready from a technical perspective, then I will go ahead and develop against this branch/fork. |
@klazuka As far as I have tested it is ready from a technical perspective. |
@xtian I integrated your branch today. The code itself worked fine (thank you!), but some of the docs/examples are out-of-date. Here are the list of changes that I had to make to get things working: webpack options
various things in the
|
@klazuka Ah yes, sorry I should have noted that the changes on the app side can be viewed here: halfzebra/create-elm-app#256 Glad it worked for you! :) |
No problem. But that PR only addresses the app-side in create-elm-app. There's a lot of docs/readmes/examples in this repo that also need to be updated. Probably should be done in a separate PR. Just pointing it out here so that it doesn't slip through the cracks. |
@klazuka Yep, I am waiting until I get some response to this PR before diving into updating the documentation. |
ping @rtfeldman @eeue56 This is ready for review |
@xtian good news, the npm installer for 0.19 was released this morning. Now you can do |
@klazuka Updated :) |
I tried this branch. It seems that live reloading doesn't work when saving imported modules. It looks like I have made a dirtyfix for myself in the meantime here: https://github.com/hecrj/elm-webpack-loader/tree/0.19 |
@hecrj Awesome, thanks for posting a fix! I don't have the bandwidth to tackle PRs for those projects right now so if someone else wanted to do that it would be very cool. |
PRs for both of those repos would be very welcome! |
If @hecrj is willing to move his fixes to PRs on those repos. If he doesn't have the time, I can try to takle this when I get home in the evening. [Edit]: I made those PRs (as far as I could tell, the changes needed were pretty minimal, but I might have missed something. I saw that progress towards 0.19 was already made on |
0.19 examples
Can we maybe not hard remove |
@razzeee This release will break anyway, so I'm not sure if we can do that. Better to have a hard error and send people here to pin to the 0.18 version. Just waiting on one last PR to be merged, then we're good to go with this release |
Well the hard error you get at the moment is quiet unhelpful. That's the whole reason I reached out. I think we can do much better, otherwise you will have people asking here regularly. |
I like the idea of keeping them for this release, and having them immediately bail out with a helpful error if you use them. 👍 |
We ended up with some interesting experimental Uglify results in a discussion with @Punie on Slack that I thought I'd share here: ("two step version" refers to running Uglify twice, first with So the overall best (for Assuming it's too much of a pain to get Webpack to run Uglify twice, it seems like the best Uglify config for Webpack might be:
|
Just to add to @rtfeldman comment: it seems that new UglifyJsPlugin({
uglifyOptions: {
compress: {
pure_funcs: ['F2','F3','F4','F5','F6','F7','F8','F9','A2','A3','A4','A5','A6','A7','A8','A9'],
pure_getters: true,
keep_fargs: false,
unsafe_comps: true,
unsafe: true,
passes: 3
}
}
}) I don't know about webpack 2 and 3 though. |
@rtfeldman / @Punie can you share those somewhere else rather in this PR? 🙏 Maybe a separate PR with uglify tips? |
0.19 tests
Released as 5.0.0. Thanks! |
Fixes #148