mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
feat(nuxt): enable appManifest
by default (#23448)
This commit is contained in:
parent
9734723aaf
commit
4063b498d3
@ -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: {
|
||||
|
@ -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)),
|
||||
|
@ -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"')
|
||||
|
4
test/fixtures/basic/nuxt.config.ts
vendored
4
test/fixtures/basic/nuxt.config.ts
vendored
@ -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
|
||||
},
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user