Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove experimental.pageEnv #54789

Merged
merged 3 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions packages/next/src/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,22 +358,6 @@ export function getDefineEnv({
'global.GENTLY': JSON.stringify(false),
}
: undefined),
// stub process.env with proxy to warn a missing value is
// being accessed in development mode
...(config.experimental.pageEnv && dev
? {
'process.env': `
new Proxy(${isNodeServer ? 'process.env' : '{}'}, {
get(target, prop) {
if (typeof target[prop] === 'undefined') {
console.warn(\`An environment variable (\${prop}) that was not provided in the environment was accessed.\nSee more info here: https://nextjs.org/docs/messages/missing-env-value\`)
}
return target[prop]
}
})
`,
}
: {}),
}
}

Expand Down Expand Up @@ -2720,7 +2704,6 @@ export default async function getBaseWebpackConfig(
serverActions: config.experimental.serverActions,
typedRoutes: config.experimental.typedRoutes,
basePath: config.basePath,
pageEnv: config.experimental.pageEnv,
excludeDefaultMomentLocales: config.excludeDefaultMomentLocales,
assetPrefix: config.assetPrefix,
disableOptimizedLoading,
Expand Down
1 change: 0 additions & 1 deletion packages/next/src/lib/turbopack-warning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const supportedTurbopackNextConfigOptions = [
'experimental.proxyTimeout',
'experimental.isrFlushToDisk',
'experimental.workerThreads',
'experimenatl.pageEnv',
'experimental.caseSensitiveRoutes',
]

Expand Down
3 changes: 0 additions & 3 deletions packages/next/src/server/config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,6 @@ const configSchema = {
outputFileTracingIncludes: {
type: 'object',
},
pageEnv: {
type: 'boolean',
},
proxyTimeout: {
minimum: 0,
type: 'number',
Expand Down
2 changes: 0 additions & 2 deletions packages/next/src/server/config-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ export interface ExperimentalConfig {
proxyTimeout?: number
isrFlushToDisk?: boolean
workerThreads?: boolean
pageEnv?: boolean
// optimizeCss can be boolean or critters' option object
// Use Record<string, unknown> as critters doesn't export its Option type
// https://github.com/GoogleChromeLabs/critters/blob/a590c05f9197b656d2aeaae9369df2483c26b072/packages/critters/src/index.d.ts
Expand Down Expand Up @@ -717,7 +716,6 @@ export const defaultConfig: NextConfig = {
sharedPool: true,
isrFlushToDisk: true,
workerThreads: false,
pageEnv: false,
proxyTimeout: undefined,
optimizeCss: false,
nextScriptWorkers: false,
Expand Down
11 changes: 0 additions & 11 deletions test/integration/process-env-stub/components/hello.js

This file was deleted.

5 changes: 0 additions & 5 deletions test/integration/process-env-stub/next.config.js

This file was deleted.

4 changes: 0 additions & 4 deletions test/integration/process-env-stub/pages/also-not-missing.js

This file was deleted.

4 changes: 0 additions & 4 deletions test/integration/process-env-stub/pages/api/hi.js

This file was deleted.

12 changes: 0 additions & 12 deletions test/integration/process-env-stub/pages/missing-gsp.js

This file was deleted.

12 changes: 0 additions & 12 deletions test/integration/process-env-stub/pages/missing-gssp.js

This file was deleted.

15 changes: 0 additions & 15 deletions test/integration/process-env-stub/pages/missing.js

This file was deleted.

4 changes: 0 additions & 4 deletions test/integration/process-env-stub/pages/not-missing.js

This file was deleted.

167 changes: 0 additions & 167 deletions test/integration/process-env-stub/test/index.test.js

This file was deleted.