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

#936: Fix manifest key problem when using copy files #979

Merged

Conversation

bobvandevijver
Copy link
Contributor

So, the solution for #936 was not complex at all, but creating a failing test was.

I needed to update the test scripts in the package.json, as webpack simply doesn't write it's cache until the mocha process ends. I did not find an alternative way to trigger the cache files to be written.

So, I separated the persistent cache tests into a dedicated directory/file, which is ignored during the normal test run. I added commands to run the persistent cache test both with and without previous cache (using the CLEAR_PERSISTENT_CACHE environment variable), and updated the original test command to run the normal test once, and the persistent cache tests twice (so the second run is with a valid cache).

I also needed to update the temp directory generation for the persistent cache, as it need to be deterministic over multiple cache runs. This is done with an extra parameter when creating the webpack configuration. This also makes sure that the webpack persistent cache is not shared over multiple tests (as long as you use unique keys obviously.

Just let me know if something needs to be done different!

lib/webpack-manifest-plugin/hooks.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
Copy link
Member

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! I'm SO happy someone was able to find the fix - thank you! I just have a few minor comments about the test organization... and hopefully slimming down (removing) the new dev dependencies.

Thanks!

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@bobvandevijver
Copy link
Contributor Author

bobvandevijver commented May 21, 2021

Alright, everything has been adjusted according to the feedback, so it should be ready for merge 👍🏻

I did not force push it, but I would combine 2924b67 with ac91584 and fe83b5d with d1aa7b2 to get a nice history.

@bobvandevijver
Copy link
Contributor Author

@weaverryan Is there anything left to do for me before this can be merged and released?

@weaverryan weaverryan force-pushed the 936-fix-manifest-key-problem branch from fe83b5d to c18ac58 Compare May 31, 2021 15:47
@weaverryan
Copy link
Member

Thank you Bob! This is truly an exciting PR :D :D

@weaverryan weaverryan merged commit 72296c9 into symfony:main May 31, 2021
@bobvandevijver bobvandevijver deleted the 936-fix-manifest-key-problem branch June 1, 2021 10:17
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

Successfully merging this pull request may close these issues.

3 participants