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

fix: handle route encoding #8325

Merged
merged 22 commits into from Nov 30, 2020
Merged

fix: handle route encoding #8325

merged 22 commits into from Nov 30, 2020

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Nov 9, 2020

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

vuejs/vue-router#3350 introduced a breaking change which dropped supporting to encode uri paths. So we need to update internals doing it:

  • Ensure router.base is always encoded
  • Encode path param in route entries (generated code) (update fix: only encode non dynamic path params #8421)
  • Decode URIs for CLI messages for DX and avoid conflicting with util.format
  • Override router.resolve with encodeURI(decodeURI(to)) (props to @farnabaz)
  • Update rest of internals
  • New encoding test (local): yarn nuxt dev test/fixtures/encoding
    • Would be nice if we have more e2e tests later on specially for SPA and CSR

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 requested review from Atinux and clarkdo November 9, 2020 19:41
@codecov-io
Copy link

codecov-io commented Nov 9, 2020

Codecov Report

Merging #8325 (ac880de) into dev (8e07cfc) will increase coverage by 0.01%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #8325      +/-   ##
==========================================
+ Coverage   68.28%   68.30%   +0.01%     
==========================================
  Files          91       91              
  Lines        3894     3896       +2     
  Branches     1063     1063              
==========================================
+ Hits         2659     2661       +2     
  Misses       1002     1002              
  Partials      233      233              
Flag Coverage Δ
unittests 68.30% <50.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/server/src/server.js 80.24% <0.00%> (ø)
packages/vue-renderer/src/renderer.js 0.00% <0.00%> (ø)
packages/config/src/options.js 94.58% <100.00%> (+0.02%) ⬆️
packages/server/src/listener.js 100.00% <100.00%> (ø)

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 8e07cfc...ac880de. Read the comment docs.

@pi0 pi0 marked this pull request as draft November 9, 2020 19:51
clarkdo
clarkdo previously approved these changes Nov 14, 2020
@pi0 pi0 changed the title chore(deps): update vue-router to 3.4.9 fix: handle route encoding Nov 30, 2020
@pi0 pi0 marked this pull request as ready for review November 30, 2020 21:59
@pi0 pi0 requested a review from farnabaz November 30, 2020 22:00
@pi0
Copy link
Member Author

pi0 commented Nov 30, 2020

merging to try on edge

@pi0 pi0 merged commit cc1f6d9 into dev Nov 30, 2020
@pi0 pi0 deleted the vue-router branch November 30, 2020 22:10
yarn.lock Show resolved Hide resolved
packages/vue-app/template/server.js Show resolved Hide resolved
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

4 participants