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

types: add enablePreview to context #8638

Merged
merged 4 commits into from
Jan 17, 2021
Merged

types: add enablePreview to context #8638

merged 4 commits into from
Jan 17, 2021

Conversation

TheAlexLichter
Copy link
Member

@TheAlexLichter TheAlexLichter commented Jan 13, 2021

Somehow the enablePreview function was missing in the Context type.
As it is only available in plugins, I'm not sure if there is a better way to add it. Open for feedback here!

@atinux
Copy link
Member

atinux commented Jan 13, 2021

Thanks @manniL

It is a bit tricky indeed since it lives only for static target also.
We also inject $preview, see https://github.com/nuxt/nuxt.js/blob/9681a8937d0c973bc685b757faa686023a4536fc/packages/vue-app/template/index.js#L235-L240

@TheAlexLichter
Copy link
Member Author

True! Should add that in the same PR as well.
Unfortunately, you can't mark functions as optional while objects can be.

@TheAlexLichter TheAlexLichter self-assigned this Jan 13, 2021
@TheAlexLichter TheAlexLichter requested a review from pi0 January 17, 2021 00:47
@codecov-io
Copy link

Codecov Report

Merging #8638 (17365dd) into dev (9ec5d5b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev    #8638   +/-   ##
=======================================
  Coverage   66.05%   66.05%           
=======================================
  Files          92       92           
  Lines        4010     4010           
  Branches     1104     1104           
=======================================
  Hits         2649     2649           
  Misses       1095     1095           
  Partials      266      266           
Flag Coverage Δ
unittests 66.05% <ø> (ø)

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

Impacted Files Coverage Δ
packages/webpack/src/config/base.js 65.29% <0.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 9ec5d5b...17365dd. Read the comment docs.

@pi0 pi0 changed the title fix(types): add enablePreview to ctx types: add enablePreview to ctx Jan 17, 2021
@pi0 pi0 changed the title types: add enablePreview to ctx types: add enablePreview to context Jan 17, 2021
pi0 and others added 2 commits January 17, 2021 11:59
Co-authored-by: Daniel Roe <daniel@roe.dev>
Co-authored-by: Daniel Roe <daniel@roe.dev>
@pi0 pi0 merged commit 80af61c into dev Jan 17, 2021
@pi0
Copy link
Member

pi0 commented Jan 17, 2021

Thanks @manniL @danielroe!

@pi0 pi0 deleted the types/add-enablepreview branch January 17, 2021 11:00
@pi0 pi0 mentioned this pull request Feb 9, 2021
@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.

None yet

5 participants