feat(nuxt): enable `appManifest` by default (#23448)

This commit is contained in:
Daniel Roe 2023-09-30 10:58:55 +01:00 committed by GitHub
parent 9734723aaf
commit 4063b498d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 11 deletions

View File

@ -20,7 +20,7 @@ export default defineUntypedSchema({
*/
reactivityTransform: false,
// TODO: Remove in v3.8 when nitro has support for mocking traced dependencies
// TODO: Remove when nitro has support for mocking traced dependencies
// https://github.com/unjs/nitro/issues/1118
/**
* Externalize `vue`, `@vue/*` and `vue-router` when building.
@ -210,8 +210,7 @@ export default defineUntypedSchema({
/**
* Use app manifests to respect route rules on client-side.
*/
// TODO: enable by default in v3.8
appManifest: false,
appManifest: true,
// This is enabled when `experimental.payloadExtraction` is set to `true`.
// appManifest: {

View File

@ -11,7 +11,7 @@ import type { NuxtIslandResponse } from '../packages/nuxt/src/core/runtime/nitro
import { expectNoClientErrors, expectWithPolling, gotoPath, isRenderingJson, parseData, parsePayload, renderPage } from './utils'
const isWebpack = process.env.TEST_BUILDER === 'webpack'
const isTestingAppManifest = process.env.TEST_MANIFEST === 'manifest-on'
const isTestingAppManifest = process.env.TEST_MANIFEST !== 'manifest-off'
await setup({
rootDir: fileURLToPath(new URL('./fixtures/basic', import.meta.url)),

View File

@ -19,7 +19,7 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
for (const outputDir of ['.output', '.output-inline']) {
it('default client bundle size', async () => {
const clientStats = await analyzeSizes('**/*.js', join(rootDir, outputDir, 'public'))
expect.soft(roundToKilobytes(clientStats.totalBytes)).toMatchInlineSnapshot('"97.3k"')
expect.soft(roundToKilobytes(clientStats.totalBytes)).toMatchInlineSnapshot('"99.1k"')
expect(clientStats.files.map(f => f.replace(/\..*\.js/, '.js'))).toMatchInlineSnapshot(`
[
"_nuxt/entry.js",
@ -32,7 +32,7 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
const serverDir = join(rootDir, '.output/server')
const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot('"300k"')
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot('"304k"')
const modules = await analyzeSizes('node_modules/**/*', serverDir)
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot('"1822k"')
@ -71,7 +71,7 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
const serverDir = join(rootDir, '.output-inline/server')
const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot('"607k"')
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot('"611k"')
const modules = await analyzeSizes('node_modules/**/*', serverDir)
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot('"71.4k"')

View File

@ -195,9 +195,7 @@ export default defineNuxtConfig({
reactivityTransform: true,
treeshakeClientOnly: true,
asyncContext: process.env.TEST_CONTEXT === 'async',
// TODO: remove this in v3.8
payloadExtraction: true,
appManifest: process.env.TEST_MANIFEST === 'manifest-on',
appManifest: process.env.TEST_MANIFEST !== 'manifest-off',
headNext: true,
inlineRouteRules: true
},

View File

@ -233,7 +233,7 @@ describe('url', () => {
})
})
describe.skipIf(process.env.TEST_MANIFEST !== 'manifest-on')('app manifests', () => {
describe.skipIf(process.env.TEST_MANIFEST === 'manifest-off')('app manifests', () => {
it('getAppManifest', async () => {
const manifest = await getAppManifest()
delete manifest.timestamp