Skip to content

feat(v2): add before and after dev server implementation#4068

Closed
RDIL wants to merge 2 commits intofacebook:masterfrom
RDIL:dev-server
Closed

feat(v2): add before and after dev server implementation#4068
RDIL wants to merge 2 commits intofacebook:masterfrom
RDIL:dev-server

Conversation

@RDIL
Copy link
Contributor

@RDIL RDIL commented Jan 19, 2021

  • beforeDevServer & afterDevServer have been removed
  • configureDevServer has been added

Motivation

It was on the todo list.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

It works just fine in my testing.

Related PRs

n/a

@RDIL RDIL requested review from lex111 and slorber as code owners January 19, 2021 20:07
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jan 19, 2021
@netlify
Copy link

netlify bot commented Jan 19, 2021

❌ [V1] Deploy preview failure
Built without sensitive environment variables

🔨 Explore the source changes: 05c0567

🔍 Inspect the deploy logs: https://app.netlify.com/sites/docusaurus-1/deploys/60073c1080ce420007cebb25

@netlify
Copy link

netlify bot commented Jan 19, 2021

❌ [V1] Deploy preview failure
Built without sensitive environment variables

🔨 Explore the source changes: bc41c8d

🔍 Inspect the deploy logs: https://app.netlify.com/sites/docusaurus-1/deploys/60073c8c6c074000082e4c13

@github-actions
Copy link

github-actions bot commented Jan 19, 2021

Size Change: -4 B (0%)

Total Size: 27.1 kB

ℹ️ View Unchanged
Filename Size Change
website/build/blog/2017/12/14/introducing-docusaurus/index.html 20.9 kB -3 B (0%)
website/build/docs/introduction/index.html 180 B 0 B
website/build/index.html 6.02 kB -1 B (0%)

compressed-size-action

@netlify
Copy link

netlify bot commented Jan 19, 2021

✔️ Deploy preview for docusaurus-2 ready!
Built without sensitive environment variables

🔨 Explore the source changes: 05c0567

🔍 Inspect the deploy logs: https://app.netlify.com/sites/docusaurus-2/deploys/60073c10952b4b0008c73ea9

😎 Browse the preview: https://deploy-preview-4068--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Jan 19, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 69
🟢 Accessibility 99
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-4068--docusaurus-2.netlify.app/classic/

@netlify
Copy link

netlify bot commented Jan 19, 2021

✔️ Deploy preview for docusaurus-2 ready!
Built without sensitive environment variables

🔨 Explore the source changes: bc41c8d

🔍 Inspect the deploy logs: https://app.netlify.com/sites/docusaurus-2/deploys/60073c8ccd3e8800085c0fa5

😎 Browse the preview: https://deploy-preview-4068--docusaurus-2.netlify.app

@slorber
Copy link
Collaborator

slorber commented Jan 20, 2021

Thanks,

Do you have a concrete use case in mind that gets solved by this new API?

I don't have much context about this TODO in the code and why we need this 😅 maybe @yangshun knows why it can be useful?

If we do need more customizations to the dev server, wouldn't it be preferable to let the user change whatever he wants from the default config we provide, instead of adding a new API for each devserver config.

@RDIL
Copy link
Contributor Author

RDIL commented Jan 21, 2021

I believe this is for cases like where users want to add custom middleware, for example if they use the service worker plugin they may want to add react-dev-utils's noopServiceWorkerMiddleware.

@slorber
Copy link
Collaborator

slorber commented Jan 21, 2021

What if we had a "configureWebpackDevServer" instead?

That would also allow that usecase and yet be a more future-proof API?

@RDIL
Copy link
Contributor Author

RDIL commented Jan 25, 2021

Going to close this until there is an exact feature request for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants