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

feat(vue-renderer): improvements #4722

Merged
merged 25 commits into from
Feb 8, 2019
Merged

feat(vue-renderer): improvements #4722

merged 25 commits into from
Feb 8, 2019

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Jan 9, 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

  • refactor renderRoute
  • new hooks

New Hooks

Shared:

  • vue-renderer:context: Final chance to extend context. (Setting modern, spa, url, etc)

SSR:

  • vue-renderer:ssr:prepareContext: Inject to the context before renderToString
  • vue-renderer:ssr:context: Extend rendered context. Ultimate possibilities for SSR hacks!
  • vue-renderer:ssr:csp: Extend generated CSP string hashes
  • vue-renderer:ssr:templateParams: Customize HTML template params

SPA:

  • vue-renderer:spa:templateParams: Cutomize HTML template params for SPA

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.

@pi0 pi0 added the WIP label Jan 9, 2019
@pi0 pi0 changed the title feat: dynamic static mode feat(vue-renderer): dynamic static mode Jan 9, 2019
@pi0 pi0 changed the title feat(vue-renderer): dynamic static mode feat(vue-renderer): improvements + static Jan 14, 2019
@pimlie
Copy link

pimlie commented Jan 14, 2019

Could we extract all those hook identifiers into some object? That way IDE's can possibly autocomplete them and the chance of errors (by nuxt users) due to small typos is much smaller. Also there is no overview now anywhere with a full list of all available hooks.

I would imagine something like:

export const hookIds = {
  build: {
    done: 'build:done',
  },
  vue-renderer: { // <- dash might be an issue
    ssr: {
      context: 'vue-rendere:ssr:content'
  }
 ...
}

Then if someone wants to use a hook they can either use the text itself (but that'd be mainly for backwards compatiblity) but the preferred way would be to import the nuxtHooks object and just do nuxt.hook(hookIds.build.done, () => {})

-- edit --
another possible way is to remove the need for identifiers, just call nuxt.hooks.build.done(() => {})

@pi0 pi0 self-assigned this Jan 22, 2019
@pi0 pi0 changed the title feat(vue-renderer): improvements + static feat(vue-renderer): improvements Feb 6, 2019
@pi0 pi0 removed the WIP label Feb 6, 2019
@nuxt nuxt deleted a comment from codecov-io Feb 6, 2019
@codecov-io
Copy link

Codecov Report

Merging #4722 into dev will increase coverage by 0.11%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##              dev   #4722      +/-   ##
=========================================
+ Coverage   92.79%   92.9%   +0.11%     
=========================================
  Files          73      73              
  Lines        2429    2439      +10     
  Branches      596     599       +3     
=========================================
+ Hits         2254    2266      +12     
+ Misses        160     158       -2     
  Partials       15      15
Impacted Files Coverage Δ
packages/core/src/nuxt.js 100% <ø> (ø) ⬆️
packages/vue-renderer/src/renderer.js 95.87% <100%> (+1.31%) ⬆️

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 f5220cf...cc10e50. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Feb 6, 2019

Codecov Report

Merging #4722 into dev will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #4722      +/-   ##
==========================================
+ Coverage   92.28%   92.31%   +0.02%     
==========================================
  Files          74       74              
  Lines        2450     2459       +9     
  Branches      603      606       +3     
==========================================
+ Hits         2261     2270       +9     
  Misses        169      169              
  Partials       20       20
Impacted Files Coverage Δ
packages/core/src/nuxt.js 100% <ø> (ø) ⬆️
packages/vue-renderer/src/renderer.js 94.81% <100%> (+0.25%) ⬆️

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 995911d...c78c4a2. Read the comment docs.

@pi0 pi0 merged commit 2929716 into dev Feb 8, 2019
@pi0 pi0 deleted the feat/statiic branch February 8, 2019 10:05
@pi0 pi0 mentioned this pull request Mar 14, 2019
@pi0 pi0 mentioned this pull request Feb 25, 2020
7 tasks
@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.

None yet

7 participants