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: Reduce duplicate code in routes.js #4121

Merged
merged 3 commits into from
Oct 16, 2018
Merged

refactor: Reduce duplicate code in routes.js #4121

merged 3 commits into from
Oct 16, 2018

Conversation

negezor
Copy link

@negezor negezor commented Oct 15, 2018

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)
  • Mini-refactor

Description

Reduce duplicate code in routes.js. This is especially noticeable in the assembly.

Of

const _bb6a37ce = () => import('..\\pages\\about.vue' /* webpackChunkName: "pages_about" */).then(m => m.default || m)
const _7c644ae2 = () => import('..\\pages\\dashboard\\index.vue' /* webpackChunkName: "pages_dashboard_index" */).then(m => m.default || m)

At

const getModule = promise => promise.then(m => m.default || m)

const _bb6a37ce = () => getModule(import('..\\pages\\about.vue' /* webpackChunkName: "pages_about" */))
const _7c644ae2 = () => getModule(import('..\\pages\\dashboard\\index.vue' /* webpackChunkName: "pages_dashboard_index" */))

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.

@manniL manniL requested review from pi0, galvez and manniL October 15, 2018 11:06
@codecov-io
Copy link

codecov-io commented Oct 15, 2018

Codecov Report

Merging #4121 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev    #4121   +/-   ##
=======================================
  Coverage   96.87%   96.87%           
=======================================
  Files          18       18           
  Lines        1282     1282           
  Branches      349      349           
=======================================
  Hits         1242     1242           
  Misses         37       37           
  Partials        3        3

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 5979bd5...67568df. Read the comment docs.

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.

Nice enhancement. I suggest moving this function into utils and also renaming to intropDefault or something more relative

@pi0
Copy link
Member

pi0 commented Oct 16, 2018

Thanks, @negezor!

@pi0 pi0 merged commit a359424 into nuxt:dev Oct 16, 2018
@lock
Copy link

lock bot commented Nov 15, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 15, 2018
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants