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: generate routes and template files in builder #4883

Merged
merged 10 commits into from
Jan 30, 2019

Conversation

clarkdo
Copy link
Member

@clarkdo clarkdo commented Jan 29, 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 January 29, 2019 15:41
@codecov-io
Copy link

codecov-io commented Jan 29, 2019

Codecov Report

Merging #4883 into dev will decrease coverage by 0.14%.
The diff coverage is 98.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #4883      +/-   ##
==========================================
- Coverage   91.89%   91.74%   -0.15%     
==========================================
  Files          72       73       +1     
  Lines        2406     2412       +6     
  Branches      593      593              
==========================================
+ Hits         2211     2213       +2     
- Misses        177      181       +4     
  Partials       18       18
Impacted Files Coverage Δ
packages/builder/src/context/build.js 100% <ø> (ø)
packages/builder/src/context/template.js 100% <100%> (ø)
packages/builder/src/builder.js 88.98% <98.21%> (-0.98%) ⬇️
packages/vue-renderer/src/renderer.js 94.56% <0%> (-1.09%) ⬇️

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 3348cd6...5dcfce4. Read the comment docs.

: null
}
}
const templateContext = new TemplateContext(this, this.options)
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 refactor rest of this function to a TemplateBuilder class?

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried, but the methods are all couple with builder's members and methods like resolveRelativeToBuild, supportedExtensions, template, routes, watch....

So I reverted my changed for avoiding leak builder into other class.

pi0
pi0 previously approved these changes Jan 29, 2019
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.

LSexyTM at this point :D

''
)

if (p.ssr === false) {
Copy link
Member

Choose a reason for hiding this comment

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

We could refactor that block into a dedicated function

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean marshalling mode in normalizePlugins ?
I think current method is not so complex and the marshalling is not shareable as well, if it can be shared, we can move it into some common util class then.

@clarkdo clarkdo merged commit 4c5a59e into nuxt:dev Jan 30, 2019
@pi0 pi0 mentioned this pull request Mar 14, 2019
@clarkdo clarkdo deleted the refactor-builder branch April 2, 2019 13:13
@danielroe danielroe added the 2.x label Jan 18, 2023
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.

6 participants