From 95a0e178981d4e153b329e0d2c5bd102b9f565ed Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 10 May 2023 23:31:13 +0100 Subject: [PATCH] feat(schema): enable rich json payloads by default (#20770) --- packages/schema/src/config/experimental.ts | 3 +-- test/bundle.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/schema/src/config/experimental.ts b/packages/schema/src/config/experimental.ts index 97811649a3..a0429f6549 100644 --- a/packages/schema/src/config/experimental.ts +++ b/packages/schema/src/config/experimental.ts @@ -93,9 +93,8 @@ export default defineUntypedSchema({ */ noScripts: false, - // TODO: enable by default in v3.5 /** Render JSON payloads with support for revivifying complex types. */ - renderJsonPayloads: false, + renderJsonPayloads: true, /** * Disable vue server renderer endpoint within nitro. diff --git a/test/bundle.test.ts b/test/bundle.test.ts index 65db0e7520..ce8bf0b63d 100644 --- a/test/bundle.test.ts +++ b/test/bundle.test.ts @@ -34,7 +34,7 @@ describe.skipIf(isWindows || process.env.TEST_BUILDER === 'webpack' || process.e it('default client bundle size', async () => { stats.client = await analyzeSizes('**/*.js', publicDir) - expect(roundToKilobytes(stats.client.totalBytes)).toMatchInlineSnapshot('"94.2k"') + expect(roundToKilobytes(stats.client.totalBytes)).toMatchInlineSnapshot('"96.6k"') expect(stats.client.files.map(f => f.replace(/\..*\.js/, '.js'))).toMatchInlineSnapshot(` [ "_nuxt/entry.js", @@ -45,7 +45,7 @@ describe.skipIf(isWindows || process.env.TEST_BUILDER === 'webpack' || process.e it('default server bundle size', async () => { stats.server = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir) - expect(roundToKilobytes(stats.server.totalBytes)).toMatchInlineSnapshot('"67.7k"') + expect(roundToKilobytes(stats.server.totalBytes)).toMatchInlineSnapshot('"61.7k"') const modules = await analyzeSizes('node_modules/**/*', serverDir) expect(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot('"2658k"')