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(utils): include routes with children for generation #7761

Merged
merged 5 commits into from
Jul 26, 2020
Merged

fix(utils): include routes with children for generation #7761

merged 5 commits into from
Jul 26, 2020

Conversation

farnabaz
Copy link
Member

@farnabaz farnabaz commented Jul 23, 2020

flatRoutes function was skip all parent routes that have children. Parent routes was not generates in static generation, to Take a look at #4562 to find more about the issue.
close #4562 & #4982

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.

packages/utils/src/route.js Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jul 23, 2020

Codecov Report

Merging #7761 into dev will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #7761      +/-   ##
==========================================
+ Coverage   68.83%   68.85%   +0.02%     
==========================================
  Files          90       90              
  Lines        3821     3824       +3     
  Branches     1034     1034              
==========================================
+ Hits         2630     2633       +3     
  Misses        968      968              
  Partials      223      223              
Flag Coverage Δ
#unittests 68.85% <100.00%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
packages/utils/src/route.js 96.73% <100.00%> (+0.06%) ⬆️

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 45f204c...b50424e. Read the comment docs.

@farnabaz
Copy link
Member Author

farnabaz commented Jul 23, 2020

@pi0 I think one of previous tests is wrong, Look at these lines. This route should create three pages (exact behavior as vue-router)

https://github.com/nuxt/nuxt.js/pull/7761/files#diff-f20ead15adb68c21668ec1154f3ba2a2L44-R56

packages/utils/src/route.js Outdated Show resolved Hide resolved
packages/utils/src/route.js Outdated Show resolved Hide resolved
@farnabaz farnabaz requested review from manniL and pi0 July 23, 2020 14:07
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. @clarkdo @Atinux Would you please also confirm new behavior? (/foo is being added)

@pi0 pi0 requested review from clarkdo and Atinux July 24, 2020 08:09
Copy link
Member

@Atinux Atinux left a comment

Choose a reason for hiding this comment

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

Nice work!

@pi0 pi0 changed the title fix(generate): static generation of routes with children fix(utils): include routes with children for generation Jul 26, 2020
@pi0 pi0 merged commit 6af7633 into dev Jul 26, 2020
@pi0 pi0 deleted the flatRoutes branch July 26, 2020 15:48
@pi0 pi0 mentioned this pull request Jul 27, 2020
@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.

nuxt generate doesn't generate HTML file for pages with child routes
7 participants