Replace Webpack dev server with zero-dependency alternative#11485
Merged
Replace Webpack dev server with zero-dependency alternative#11485
Conversation
zachmargolis
approved these changes
Nov 8, 2024
Contributor
zachmargolis
left a comment
There was a problem hiding this comment.
LGTM big fan! small questions, not blockers
app/javascript/packages/lite-webpack-dev-server/webpack-plugin.js
Outdated
Show resolved
Hide resolved
changelog: Internal, Dependencies, Replace Webpack dev server with zero-dependency alternative
Let response deal with it as needed
9d62496 to
739d4cb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Summary of changes
Implements a lightweight, zero-dependency alternative to
webpack-dev-server.Why?
webpack-dev-serveris pretty feature rich, but we use very few of its features. Arguably, we could get rid of it altogether and everything would be fine, but some features like pausing the request while compilation is in-progress are useful to improve confidence during development when testing changes.Of note is that
webpack-dev-servercreates a very deep dependency tree because it's implemented as an Express-based web server. Moving away from it has additional benefits:webpack-dev-server. All 9 of the 9 open security advisories trace back towebpack-dev-server.webpack-dev-serverdrops 133 dependencies (!!!)†, and reduces the size ofyarn.lockby 996 lines (-40kb / -12%).† Counted via:
git diff main -- yarn.lock | tail -n +5 | grep -E "^-\S" | wc -lminusgit diff main -- yarn.lock | tail -n +5 | grep -E "^\+\S" | wc -l📜 Testing Plan
Verify that JavaScript continues to compile and behave as expected in local development:
rm -rf public/packsmake run