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

Conversation

@Atinux
Copy link
Member

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 nuxt/core-team Aug 6, 2019
Copy link
Member

left a comment

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 added 3 commits 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 Aug 7, 2019
@kevinmarrec

This comment has been minimized.

Copy link
Member

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

@codecov-io

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member Author

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
9 checks passed
9 checks passed
Semantic Pull Request ready to be squashed
Details
[ci.azure] nuxt.js #20190807.7 succeeded
Details
ci/circleci: audit Your tests passed on CircleCI!
Details
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: lint-app Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: test-e2e Your tests passed on CircleCI!
Details
ci/circleci: test-unit Your tests passed on CircleCI!
Details
@Atinux Atinux deleted the feat/page-reload branch Aug 7, 2019
@kevinmarrec

This comment has been minimized.

Copy link
Member

commented Aug 7, 2019

@Atinux Yes, surely !

@pi0 pi0 referenced this pull request Aug 7, 2019
pi0 added 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.js#6194)

$nuxt.context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.