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

fix(runtime): fix process.env hot reload #1709

Merged
merged 1 commit into from
Nov 24, 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
151 changes: 91 additions & 60 deletions runtimes/nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion runtimes/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@types/lodash": "^4.14.171",
"@types/mongodb-uri": "^0.9.1",
"@types/multer": "^1.4.5",
"@types/node": "^18.11.15",
"@types/node": "^20.9.5",
"@types/nodemailer": "^6.4.4",
"@types/validator": "^13.1.3",
"@types/ws": "^8.5.3",
Expand Down
4 changes: 1 addition & 3 deletions runtimes/nodejs/src/support/cloud-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ function createCloudSdk() {
sockets: WebSocketAgent.clients,
appid: Config.APPID,
get env() {
return {
...process.env,
}
return process.env
},
}

Expand Down
4 changes: 1 addition & 3 deletions runtimes/nodejs/src/support/engine/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ export class FunctionModule {
clearInterval: clearInterval,
setTimeout: setTimeout,
clearTimeout: clearTimeout,
process: {
env: { ...process.env },
},
process: process,
URL: URL,
fetch: globalThis.fetch,
global: null,
Expand Down
4 changes: 1 addition & 3 deletions runtimes/nodejs/src/support/engine/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ export interface FunctionModuleGlobalContext {
Float32Array: typeof Float32Array
__filename: string
URL: typeof URL
process: {
env: { [key: string]: string }
}
process: NodeJS.Process
global: FunctionModuleGlobalContext
__from_modules: string[]
fetch: typeof globalThis.fetch
Expand Down