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(vue-renderer): split renderer into ssr, spa and modern #5559

Merged
merged 10 commits into from
Apr 20, 2019

Conversation

clarkdo
Copy link
Member

@clarkdo clarkdo commented Apr 18, 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

Changes:

  • split renderer functionality into ssr, spa and modern renderer, renderer is for managing renderers, resources/template and ready state, the specific ssr,spa,modern renderer is for app rendering.
  • change req.modernMode to req._modern for more explicit to indicate request status
  • move modern build detection to renderer for getting correct modern mode in renderer initialization.

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 review from a team and pi0 April 18, 2019 15:41
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.

Really nice refactors @clarkdo ⚡ My comments are further than the refactor but can be cool if we can have them :)

packages/vue-renderer/src/renderer.js Outdated Show resolved Hide resolved
packages/vue-renderer/src/renderer.js Outdated Show resolved Hide resolved
packages/vue-renderer/src/renderer.js Show resolved Hide resolved
packages/vue-renderer/src/renderer.js Outdated Show resolved Hide resolved
packages/vue-renderer/src/renderer.js Outdated Show resolved Hide resolved
packages/vue-renderer/src/renderer/index.js Outdated Show resolved Hide resolved
packages/vue-renderer/src/renderer/ssr/index.js Outdated Show resolved Hide resolved
@clarkdo
Copy link
Member Author

clarkdo commented Apr 19, 2019

@pi0 Refactored as code review comments

manniL
manniL previously requested changes Apr 19, 2019
packages/vue-renderer/src/renderer.js Outdated Show resolved Hide resolved
packages/vue-renderer/src/renderer.js Outdated Show resolved Hide resolved
packages/vue-renderer/src/renderer.js Outdated Show resolved Hide resolved
@pi0 pi0 dismissed manniL’s stale review April 20, 2019 10:56

changes applied

}

createRenderer() {
throw new Error('`createRenderer()` needs to be implemented')
Copy link
Member

Choose a reason for hiding this comment

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

This has no coverage as we are internally always implementing these functions. Is it necessary to keep? @clarkdo

Copy link
Member Author

Choose a reason for hiding this comment

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

At least keep the function signature for consistent common definition?

Copy link
Member

Choose a reason for hiding this comment

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

JS is not a typed language to expect defining interface. Maybe can be useful for typescript or ts typings. For coverage, we can either ignore the line or write extra internal tests :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Not for type, just for reminding contributors which are gonna implement new renderer.
Yes, could be moved to ts types.

@codecov-io
Copy link

codecov-io commented Apr 20, 2019

Codecov Report

Merging #5559 into dev will decrease coverage by 0.05%.
The diff coverage is 96.49%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #5559      +/-   ##
==========================================
- Coverage   95.68%   95.62%   -0.06%     
==========================================
  Files          78       81       +3     
  Lines        2595     2608      +13     
  Branches      661      661              
==========================================
+ Hits         2483     2494      +11     
- Misses         93       95       +2     
  Partials       19       19
Impacted Files Coverage Δ
packages/server/src/middleware/nuxt.js 97.33% <ø> (-0.04%) ⬇️
packages/server/src/middleware/modern.js 100% <100%> (ø) ⬆️
packages/webpack/src/builder.js 93.54% <100%> (ø) ⬆️
packages/server/src/server.js 97.72% <100%> (ø) ⬆️
packages/vue-renderer/src/renderers/spa.js 87.3% <100%> (ø)
packages/vue-renderer/src/renderers/base.js 77.77% <77.77%> (ø)
packages/vue-renderer/src/renderer.js 93.44% <95.83%> (-1.68%) ⬇️
packages/vue-renderer/src/renderers/ssr.js 97.56% <97.56%> (ø)
packages/vue-renderer/src/renderers/modern.js 98.21% <98.21%> (ø)
... and 2 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 1652696...1be32af. Read the comment docs.

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