GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — esm: add back `globalPreload` tests by aduh95 · Pull Request #48779 · nodejs/node

Conversation

@aduh95

@aduh95 aduh95 commented Jul 15, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This started as a revert of 938341a.

#44710 removed setImportMetaCallback, removing possibility for hooks authors to modify the import.meta object. It also removed all hooks execution when node entry point was not a file (e.g. REPL, --eval, etc.) which was not a problem except for globalPreload which is always supposed to run. I've added some tests to ensure globalPreload behaves correctly in this case.
I've also added back the test that was removed in #46402 because it's good test for globalPreload and ensures mocking works – which is a very important use case for hooks IMO.

Refs: #46402
Fixes: #48778
Fixes: #48516

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss and mertcanaltin reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@aduh95
aduh95 requested a review from GeoffreyBooth July 15, 2023 10:46
@nodejs-github-bot

nodejs-github-bot commented Jul 15, 2023

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/modules
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem. labels Jul 15, 2023
GeoffreyBooth
GeoffreyBooth approved these changes Jul 15, 2023
View reviewed changes
Comment thread lib/internal/modules/esm/hooks.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@aduh95
aduh95 force-pushed the globalPreload branch from b24fc91 to 652a74f Compare July 15, 2023 17:01
@aduh95 aduh95 added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Jul 15, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jul 15, 2023
@nodejs-github-bot

nodejs-github-bot commented Jul 15, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/52769/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95
esm: add back globalPreload tests and fix failing ones
d9b8fae
@aduh95
aduh95 force-pushed the globalPreload branch from 652a74f to d9b8fae Compare July 16, 2023 13:40
@aduh95 aduh95 added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jul 16, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jul 16, 2023
@nodejs-github-bot

nodejs-github-bot commented Jul 16, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/52790/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JakobJingleheimer
JakobJingleheimer approved these changes Jul 16, 2023
View reviewed changes

@JakobJingleheimer JakobJingleheimer left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🙌 awesome, thanks for tackling this!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/internal/main/eval_string.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/es-module/test-esm-loader-hooks.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@aduh95 @JakobJingleheimer
Update test/es-module/test-esm-loader-hooks.mjs
851f888
Co-authored-by: Jacob Smith <[email protected]>
@aduh95 aduh95 added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jul 16, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jul 16, 2023
@nodejs-github-bot

nodejs-github-bot commented Jul 16, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/52796/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Jul 17, 2023
CI Reliability 2023-07-17 nodejs/reliability#615
Open
25 tasks
@nodejs-github-bot

nodejs-github-bot commented Jul 17, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/52805/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95
aduh95 merged commit 16b8c71 into nodejs:main Jul 17, 2023
@aduh95

aduh95 commented Jul 17, 2023

Copy link
Copy Markdown
Contributor Author

Landed in 16b8c71

JakobJingleheimer reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95
aduh95 deleted the globalPreload branch July 17, 2023 15:26
@aduh95 aduh95 added the backport-blocked-v18.x label Jul 17, 2023
This was referenced Jul 18, 2023
CI Reliability 2023-07-18 nodejs/reliability#616
Open
CI Reliability 2023-07-19 nodejs/reliability#617
Open
CI Reliability 2023-07-20 nodejs/reliability#618
Open
@github-actions github-actions Bot mentioned this pull request Jul 21, 2023
CI Reliability 2023-07-21 nodejs/reliability#619
Open
16 tasks
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
@aduh95 @Ceres6
esm: add back globalPreload tests and fix failing ones
9d7d595
PR-URL: nodejs#48779
Fixes: nodejs#48778
Fixes: nodejs#48516
Refs: nodejs#46402
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
@aduh95 @Ceres6
esm: add back globalPreload tests and fix failing ones
113a703
PR-URL: nodejs#48779
Fixes: nodejs#48778
Fixes: nodejs#48516
Refs: nodejs#46402
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
UlisesGascon pushed a commit to UlisesGascon/node that referenced this pull request Aug 14, 2023
@aduh95 @UlisesGascon
esm: add back globalPreload tests and fix failing ones
903bc73
PR-URL: nodejs#48779
Fixes: nodejs#48778
Fixes: nodejs#48516
Refs: nodejs#46402
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Aug 15, 2023
@aduh95 @RafaelGSS
esm: add back globalPreload tests and fix failing ones
a559747
PR-URL: #48779
Fixes: #48778
Fixes: #48516
Refs: #46402
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
@UlisesGascon UlisesGascon mentioned this pull request Aug 15, 2023
v20.6.0 proposal #49185
Merged
@aduh95 aduh95 mentioned this pull request Sep 7, 2023
Customizing import.meta nodejs/loaders#159
Open
targos pushed a commit to targos/node that referenced this pull request Nov 11, 2023
@aduh95 @targos
esm: add back globalPreload tests and fix failing ones
002a084
PR-URL: nodejs#48779
Fixes: nodejs#48778
Fixes: nodejs#48516
Refs: nodejs#46402
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
@targos targos mentioned this pull request Nov 11, 2023
[v18.x] Backport most ESM and customization hook changes #50669
Closed
@targos targos added backported-to-v18.x and removed backport-blocked-v18.x labels Nov 23, 2023
targos pushed a commit that referenced this pull request Nov 23, 2023
@aduh95 @targos
esm: add back globalPreload tests and fix failing ones
63aa5d7
PR-URL: #48779
Backport-PR-URL: #50669
Fixes: #48778
Fixes: #48516
Refs: #46402
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
@targos targos mentioned this pull request Nov 28, 2023
v18.19.0 release proposal #50953
Merged
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
@sercher
esm: add back globalPreload tests and fix failing ones
5915a0d
PR-URL: nodejs/node#48779
Backport-PR-URL: nodejs/node#50669
Fixes: nodejs/node#48778
Fixes: nodejs/node#48516
Refs: nodejs/node#46402
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
@sercher
esm: add back globalPreload tests and fix failing ones
29f9d1c
PR-URL: nodejs/node#48779
Backport-PR-URL: nodejs/node#50669
Fixes: nodejs/node#48778
Fixes: nodejs/node#48516
Refs: nodejs/node#46402
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@GeoffreyBooth GeoffreyBooth GeoffreyBooth approved these changes
@JakobJingleheimer JakobJingleheimer JakobJingleheimer approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Loader preload code never executes esm loaders: getBuiltin() does not work with node:test

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@aduh95 @nodejs-github-bot @GeoffreyBooth @JakobJingleheimer @targos
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.