-
Notifications
You must be signed in to change notification settings - Fork 365
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
fix(command-dev): replace deprecated static-server dep by fastify-static #5341
fix(command-dev): replace deprecated static-server dep by fastify-static #5341
Conversation
📊 Benchmark resultsComparing with e1f661a Package size: 259 MB⬆️ 6.60% increase vs. e1f661a
Legend
|
Relevant Documentation: |
48c7005
to
d83296e
Compare
Change in Response Headers
|
const rootPath = path.resolve(settings.dist) | ||
server.register(fastifyStatic, { | ||
root: rootPath, | ||
etag: false, |
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.
ETag generation is disabled since the proxy already handles that.
}) | ||
|
||
server.addHook('onRequest', (req, reply, done) => { | ||
reply.header('X-Powered-by', 'netlify-dev') |
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.
The name: 'netlify-dev'
configuration in static-server
used to set the X-Powered-by
header which is now being done manually here.
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.
Awesome. Happy new year.
I was already thinking about doing this. and even replacing express everywhere, but that would be a much bigger task I think.
This PR currently has a merge conflict. Please resolve this and then re-add the |
51f163e
to
f62b4f4
Compare
Happy new year to you too @danez. It was fun working w/ you & other folks on the Netlify team past year. |
🎉 Thanks for submitting a pull request! 🎉
Summary
Fixes #4511
The static-server dependency which is currently being used by the
netlify dev
command is now deprecated. This PR intends to replace the dependency with fastify-static (recommended by @lukasholzer).For us to review and ship your PR efficiently, please perform the following steps:
passes our tests.
A picture of a cute animal (not mandatory, but encouraged)
🦖