diff --git a/packages/nuxt/src/app/nuxt.ts b/packages/nuxt/src/app/nuxt.ts index 3c83b9680a..c4fa103289 100644 --- a/packages/nuxt/src/app/nuxt.ts +++ b/packages/nuxt/src/app/nuxt.ts @@ -281,30 +281,7 @@ export function createNuxtApp (options: CreateOptions) { // Expose runtime config const runtimeConfig = process.server ? options.ssrContext!.runtimeConfig : reactive(nuxtApp.payload.config) - - // TODO: remove in v3.5 - // Backward compatibility following #4254 - const compatibilityConfig = new Proxy(runtimeConfig, { - get (target, prop: string) { - if (prop in target) { - return target[prop] - } - if (process.dev && prop in target.public) { - console.warn(`[nuxt] [runtimeConfig] You are trying to access a public runtime config value (\`${prop}\`) directly from the top level. This currently works (for backward compatibility with Nuxt 2) but this compatibility layer will be removed in v3.5. Instead, you can update \`config['${prop}']\` to \`config.public['${prop}']\`.`) - } - return target.public[prop] - }, - set (target, prop, value) { - if (process.server || prop === 'public' || prop === 'app') { - return false // Throws TypeError - } - target[prop] = value - target.public[prop] = value - return true - } - }) - - nuxtApp.provide('config', compatibilityConfig) + nuxtApp.provide('config', runtimeConfig) return nuxtApp } diff --git a/test/bundle.test.ts b/test/bundle.test.ts index eab3032392..9c5fb05868 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('"94.0k"') 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('"66.8k"') + expect(roundToKilobytes(stats.server.totalBytes)).toMatchInlineSnapshot('"66.6k"') const modules = await analyzeSizes('node_modules/**/*', serverDir) expect(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot('"2654k"')