-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Lazy compile in test env #360
Conversation
@javan This looks really good 👍 After we discussed the other day I realised that re-compilation isn't necessary if we restart the |
Lovely! ❤️ /play makeitso |
Would love to get this in a release—any plans for cutting a new version of the gem with this change soon? |
Yeah. Will cut a release tomorrow 👍
… On May 18, 2017, at 23:58, Jack Jennings ***@***.***> wrote:
Would love to get this in a release—any plans for cutting a new version of the gem with this change soon?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Shall we wait until Monday? I was thinking to finish up README PR for this release too. |
Sure, that's fine. Do wrap it up. Monday it is then.
…On Fri, May 19, 2017 at 9:46 AM, Gaurav Tiwari ***@***.***> wrote:
Shall we wait until Monday? I was thinking to finish up README PR for this
release too.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#360 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAKtUl78mkcwxU4Slm4zYop5j-hAtoTks5r7UjSgaJpZM4NWr2C>
.
|
Is it correct, that I still have to run webpack-dev-server during tests with this change? Seems to be the case. The assets get compiled during test, but the asset url Webpacker generates is "http://localhost:8080/packs/application.js" EDIT: Switching to current master and regenerating configuration files fixes this. Thanks! |
Is it best practice to check these compiled test assets into version control, or no? |
@zacharyw, no. I'd .gitignore them. |
@javan I updated my webpacker gem like @pmk1c and now it will generate the |
@Jeremy-Walton I'm seeing the same thing. As a workaround I'm back to manually compiling assets before spec runs:
|
@Jeremy-Walton Also observing the same. I think the issue comes from |
The above will ensure that packs are recompiled and manifest is reloaded - ref: Line 10 in 549988b
|
It sounds like we save unnecessary compilation calls at the expense of introducing an implicit requirement that the user invokes Is there a better way we could communicate this? I totally appreciate that we don't want to recompile the entire pack for every test run, but I think a lot of users are going to run into similar concerns. |
@richseviora See #464. Also, I wrote the code for React on Rails that does this. We use the file mtimes. |
Yepp, actually there was a PR made (#341 - https://github.com/rails/webpacker/pull/341/files#diff-23ac5b11daf84548b507c40511c4aa2eR21) to add very same feature but in the end went with more simpler and implicit solution. Perhaps we should add that too so both options work // cc @javan |
For me the cached version would be favourable. The speed of compilation whilst not an issue on CI is pretty frustrating developing locally. Particularly on a large react app. |
Compiling webpack in the Using his approach, Webpack now only compiles if my source has changed. Thanks @gauravtiwari for that and for all of your diligent work on this gem. Would love to see your solution included into the Webpacker gem, as I think the functionality would be broadly useful. For anyone looking for a quick fix, here is a gist of the code I ended up using, or check out PR #341. |
Thanks for sharing @stevehanson I wonder if #341 could be reopened and included as well. Both gives everyone the option depending on their use. |
@stevehanson Thanks for sharing. Looks great 👍 @raldred @stevehanson Seems like there is real requirement for this so I will reopen #341 and we can review it together. It would be nice to have both options. |
I've just run into this issue too, a solution where webpack is recompiled only when something has changed before the test suite is run is whats needed IMHO. 👍 for something like #341 |
Webpacker.compile
API (that invokes thewebpacker:compile
rake task)Webpacker::FileLoader::*
exceptionsDifferences from #341