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

bootstrap: consolidate global properties definition #43357

Closed
wants to merge 1 commit into from

Conversation

legendecas
Copy link
Member

globalThis.process and globalThis.Buffer has been re-defined with
a getter/setter pair.

atob and bota are defined as enumerable properties according to
WebIDL definition.

Refs: #26882
Refs: #37786 (comment)

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/startup

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Jun 9, 2022
@legendecas legendecas marked this pull request as ready for review June 9, 2022 04:01
@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jun 9, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 9, 2022
@nodejs-github-bot
Copy link
Collaborator

@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 10, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 10, 2022
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

configurable: true
});

// globalThis.process is been installed at `internal/bootstrap/pre_execution.js`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// globalThis.process is been installed at `internal/bootstrap/pre_execution.js`.
// globalThis.process will be installed at `internal/bootstrap/pre_execution.js`.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why are we removing these anyway? Removing these results in a breaking change for the embedders, which is why the tests have to be updated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was reviewing the installation point of globalThis.process and globalThis.Buffer. It can be more intuitive to install them once rather than duplicate the installation.

It is true that removing can cause breaking changes on embedders with custom entry points. What do you think about moving the actual installation here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the reason that they are overriden in pre_execution is that we thought we were going to make this optional for ESM (probably behind flags), which didn't seem to happen...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's true. From what I could tell, the current shape of the property descriptor is not going to be changed in anytime soon.

@legendecas legendecas removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 10, 2022
@legendecas legendecas force-pushed the global-process branch 2 times, most recently from c64d580 to 39394c2 Compare June 10, 2022 15:07
`globalThis.process` and `globalThis.Buffer` has been re-defined with
a getter/setter pair.

`atob` and `bota` are defined as enumerable properties according to
WebIDL definition.
@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 13, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 13, 2022
@legendecas
Copy link
Member Author

Landed in 511e289

@legendecas legendecas closed this Jun 13, 2022
legendecas added a commit that referenced this pull request Jun 13, 2022
`globalThis.process` and `globalThis.Buffer` has been re-defined with
a getter/setter pair.

`atob` and `bota` are defined as enumerable properties according to
WebIDL definition.

PR-URL: #43357
Refs: #26882
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
@legendecas legendecas deleted the global-process branch June 13, 2022 16:07
danielleadams pushed a commit that referenced this pull request Jun 14, 2022
`globalThis.process` and `globalThis.Buffer` has been re-defined with
a getter/setter pair.

`atob` and `bota` are defined as enumerable properties according to
WebIDL definition.

PR-URL: #43357
Refs: #26882
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
@danielleadams danielleadams mentioned this pull request Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants