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-app): add $nuxt.refresh() #6194

Merged
merged 8 commits into from
Aug 7, 2019
Merged

feat(vue-app): add $nuxt.refresh() #6194

merged 8 commits into from
Aug 7, 2019

Conversation

Atinux
Copy link
Member

@Atinux Atinux commented Aug 6, 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

Allo to refresh the page data (calling matched pages asyncData & fetch).

Will be used for the preview mode, as well as closing #3504

It also add $nuxt.context as alias (instead of $nuxt.$options.context)

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.

@Atinux Atinux requested a review from a team August 6, 2019 14:00
galvez
galvez previously approved these changes Aug 6, 2019
Copy link

@galvez galvez left a comment

Choose a reason for hiding this comment

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

Cool, that helps phasing out nuxt-static-render too :)

packages/vue-app/template/App.js Outdated Show resolved Hide resolved
packages/vue-app/template/App.js Outdated Show resolved Hide resolved
packages/vue-app/template/App.js Outdated Show resolved Hide resolved
packages/vue-app/template/App.js Outdated Show resolved Hide resolved
packages/vue-app/template/App.js Outdated Show resolved Hide resolved
@Atinux Atinux changed the title feat(vue-app): add $nuxt.refreshPageData() feat(vue-app): add $nuxt.refreshPage() Aug 7, 2019
@Atinux Atinux changed the title feat(vue-app): add $nuxt.refreshPage() feat(vue-app): add $nuxt.refresh() Aug 7, 2019
@Atinux Atinux requested a review from pi0 August 7, 2019 11:02
@kevinmarrec
Copy link
Contributor

kevinmarrec commented Aug 7, 2019

@Atinux Could refresh take a object param that would be added to the context ? (Would be useful to fetch things differently depending of if it's a refresh or not)

Maybe not merge in context but a new parameter for asyncData/fetch. Dunno

pi0
pi0 previously approved these changes Aug 7, 2019
@codecov-io
Copy link

codecov-io commented Aug 7, 2019

Codecov Report

Merging #6194 into dev will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #6194      +/-   ##
==========================================
- Coverage   95.78%   95.74%   -0.04%     
==========================================
  Files          80       80              
  Lines        2655     2655              
  Branches      683      683              
==========================================
- Hits         2543     2542       -1     
- Misses         96       97       +1     
  Partials       16       16
Flag Coverage Δ
#e2e 100% <ø> (ø) ⬆️
#fixtures 50.8% <ø> (ø) ⬆️
#unit 92.42% <ø> (-0.04%) ⬇️
Impacted Files Coverage Δ
packages/vue-renderer/src/renderer.js 93.49% <0%> (-0.82%) ⬇️

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 6ec7654...c23cf05. Read the comment docs.

@Atinux
Copy link
Member Author

Atinux commented Aug 7, 2019

We could add this functionality later on key @kevinmarrec, at the moment I prefer to keep it simple :)

@Atinux Atinux merged commit 09878cd into dev Aug 7, 2019
@Atinux Atinux deleted the feat/page-reload branch August 7, 2019 13:12
@kevinmarrec
Copy link
Contributor

@Atinux Yes, surely !

@pi0 pi0 mentioned this pull request Aug 7, 2019
pi0 pushed a commit that referenced this pull request Aug 20, 2019
* feat(vue-app): add $nuxt.refreshPageData()

* hotifx: lint

* chore: use getMatchedComponentsInstance util

* fix: rename to refreshPage

* fix: rename to refresh

* feat: add $nuxt.$context and handle error

* feat: set $nuxt.context

* hotfix: test
husayt added a commit to husayt/typescript that referenced this pull request Aug 29, 2019
husayt added a commit to husayt/typescript that referenced this pull request Aug 29, 2019
This also has been added [here](nuxt/nuxt#6194)

$nuxt.context
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

6 participants