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

refactor(server): exclude dist files request from browser detection #5571

Merged
merged 4 commits into from
Apr 21, 2019

Conversation

clarkdo
Copy link
Member

@clarkdo clarkdo commented Apr 20, 2019

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

@clarkdo clarkdo requested a review from pi0 April 20, 2019 13:51
@codecov-io
Copy link

Codecov Report

Merging #5571 into dev will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #5571      +/-   ##
==========================================
+ Coverage   95.63%   95.64%   +<.01%     
==========================================
  Files          81       81              
  Lines        2613     2615       +2     
  Branches      663      664       +1     
==========================================
+ Hits         2499     2501       +2     
  Misses         95       95              
  Partials       19       19
Impacted Files Coverage Δ
packages/server/src/server.js 97.77% <100%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5c4e8f6...2a3d2c3. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Apr 20, 2019

Codecov Report

Merging #5571 into dev will increase coverage by 44.51%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##              dev    #5571       +/-   ##
===========================================
+ Coverage   51.12%   95.64%   +44.51%     
===========================================
  Files          81       81               
  Lines        2615     2617        +2     
  Branches      664      665        +1     
===========================================
+ Hits         1337     2503     +1166     
+ Misses        988       95      -893     
+ Partials      290       19      -271
Impacted Files Coverage Δ
packages/server/src/server.js 97.77% <100%> (+33%) ⬆️
packages/webpack/src/config/server.js 100% <0%> (+3.12%) ⬆️
packages/webpack/src/utils/perf-loader.js 100% <0%> (+5.26%) ⬆️
packages/webpack/src/config/base.js 95.55% <0%> (+5.55%) ⬆️
packages/utils/src/lang.js 100% <0%> (+6.25%) ⬆️
packages/webpack/src/config/client.js 98.18% <0%> (+7.27%) ⬆️
packages/core/src/module.js 98.33% <0%> (+10%) ⬆️
packages/utils/src/context.js 100% <0%> (+11.11%) ⬆️
packages/cli/src/commands/index.js 11.11% <0%> (+11.11%) ⬆️
packages/utils/src/resolve.js 96.07% <0%> (+13.72%) ⬆️
... and 47 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c05161...dd2da3c. Read the comment docs.

@@ -158,6 +159,13 @@ export default class Server {
}
}

if (!this.options.dev) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we move this logic out of middleware stack and into modern renderer? (Check right before rendering)

Copy link
Member Author

@clarkdo clarkdo Apr 21, 2019

Choose a reason for hiding this comment

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

It still should be executed before devMiddleware in dev mode. And the chosen renderer depends on the request mode modern/legacy.
so if we move it, we can only move it to renderer instead of modern renderer and also find a way of sharing it(move to @nuxt/utils ) in builder/server for devMiddleware as well

Copy link
Member

Choose a reason for hiding this comment

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

Ah right. Having util would be also a nice idea to be shared between devMiddleware and renderer.

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

LGTM. We can introduce utils refactor in later PRs as well :)

@clarkdo
Copy link
Member Author

clarkdo commented Apr 21, 2019

LGTM. We can introduce utils refactor in later PRs as well :)

Great, I’ll propose a pr later for extracting the sharing logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants