This repository has been archived by the owner on Apr 6, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(nuxt): app.config
with hmr and reactivity support
#6333
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
β Deploy Preview for nuxt3-docs canceled.
|
app.config
with hmr supportapp.config
with hmr and reactivity support
danielroe
reviewed
Aug 3, 2022
atinux
reviewed
Aug 4, 2022
pi0
commented
Aug 4, 2022
pi0
commented
Aug 4, 2022
pi0
commented
Aug 16, 2022
It would be nice to also test it in https://github.com/nuxt/framework/tree/main/examples/advanced/config-extends to check the multi layer support. |
@atinux It is supported by default (main layer is part of other layers :)) |
danielroe
reviewed
Aug 17, 2022
Co-authored-by: Daniel Roe <daniel@roe.dev>
HMR seems unstable with vite-node but is probably not directly related to this PR. We can test better on edge. |
Closed
This was referenced Aug 19, 2022
Merged
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π Linked issue
Closes nuxt/nuxt#14330
β Type of change
π Description
This PR adds support for (multi layer)
app.config
file with true HMR support and reactivity/editable on both client and server side.A diversion from the original proposal is that I've decided to keep it separated from runtimeConfig at least for now since runtime config is globally frozen on server side and injection method of appConfig is foundomantelay different (bundler vs nitro-provided). This means
appConfig
andruntimeConfig.app
are not the same.Playground is edited to try new feature.
TODO:
Test deep assign(seems not required)appConfig
innuxt.config
for type support and easy module integrationapp.config
files (possible by modifyingappConfig
orapp:resolve
hook)Inject(A plugin can easily inject reactive shortcut. Delegating addition to next steps)$appConfig
app.config
foruseAppConfig()
(*) When testing, I've found that virtual files do not support HMR
π Checklist