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 — src: omit non-string values of package.json main field by anonrig · Pull Request #50965 · nodejs/node

Conversation

@anonrig

@anonrig anonrig commented Nov 29, 2023

Copy link
Copy Markdown
Member

Omit "main": false in package.json and do not throw an error for it.

FYI: This PR has missing tests.

cc @RafaelGSS @targos @nodejs/loaders

Sorry, something went wrong.

Uh oh!

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

bricss reacted with eyes emoji
All reactions
  • 👀 1 reaction
@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 Nov 29, 2023
@anonrig anonrig 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 Nov 29, 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 Nov 29, 2023
@nodejs-github-bot

nodejs-github-bot commented Nov 29, 2023

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@targos

targos commented Nov 29, 2023

Copy link
Copy Markdown
Member

It's not just boolean values that were ignored. I don't know exactly what is the current behavior but at least numbers and null are also ignored.
I think the safest fix is to ignore anything that's not a string.

ljharb reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@anonrig
anonrig force-pushed the fix-package-json-main branch from d2ea291 to 61523db Compare November 29, 2023 14:00
@anonrig

anonrig commented Nov 29, 2023

Copy link
Copy Markdown
Member Author

It's not just boolean values that were ignored. I don't know exactly what is the current behavior but at least numbers and null are also ignored. I think the safest fix is to ignore anything that's not a string.

I see. I updated the PR. Thank you @targos

All reactions

Sorry, something went wrong.

Uh oh!

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

@anonrig
src: omit bool values of package.json main field
7e3b1b6
@anonrig
anonrig force-pushed the fix-package-json-main branch from 61523db to 7e3b1b6 Compare November 29, 2023 14:00
@anonrig anonrig 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 Nov 29, 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 Nov 29, 2023
@nodejs-github-bot

nodejs-github-bot commented Nov 29, 2023

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

RafaelGSS
RafaelGSS reviewed Nov 29, 2023
View reviewed changes

@RafaelGSS RafaelGSS 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.

Shoudn't it be wip until tests are added?

Sorry, something went wrong.

Uh oh!

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

All reactions
@anonrig

anonrig commented Nov 29, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Shoudn't it be wip until tests are added?

If this is excluded in v20 release, I'll spend more time to add tests in this PR. If not, we can merge it as it is to unblock the release.

All reactions

Sorry, something went wrong.

Uh oh!

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

GeoffreyBooth
GeoffreyBooth approved these changes Nov 29, 2023
View reviewed changes
@GeoffreyBooth

GeoffreyBooth commented Nov 29, 2023

Copy link
Copy Markdown
Member

Shoudn’t it be wip until tests are added?

I’m not really sure it needs tests, to be honest, because Node itself doesn’t take a position on non-string values of package.json values AFAIK. This is to fix CITGM tests that break, and it’s also debatable whether those tests are correct. We may very well want to support values like "main": false in the future, so adding a test now to prohibit that in the future would box us in.

anonrig reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@ljharb

ljharb commented Nov 29, 2023

Copy link
Copy Markdown
Member

Can the PR title be updated to match the current PR’s behavior?

All reactions

Sorry, something went wrong.

Uh oh!

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

@anonrig anonrig changed the title src: omit bool values of package.json main field src: omit non-string values of package.json main field Nov 29, 2023
@anonrig anonrig added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Nov 29, 2023
@aduh95

aduh95 commented Nov 29, 2023

Copy link
Copy Markdown
Contributor

adding a test now to prohibit that in the future would box us in.

It would not, it's definitely OK to change tests in semver-major PRs. Not having a test only gives a chance that such breaking change slips through in a semver-minor or semver-patch PR.

ljharb reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@anonrig

anonrig commented Nov 29, 2023

Copy link
Copy Markdown
Member Author

adding a test now to prohibit that in the future would box us in.

It would not, it's definitely OK to change tests in semver-major PRs. Not having a test only gives a chance that such breaking change slips through in a semver-minor or semver-patch PR.

If we add tests, any change we make in the future will be semver-major but we don't claim that we support non-string use cases since they are invalid. I think this is the correct approach.

All reactions

Sorry, something went wrong.

Uh oh!

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

@ljharb

ljharb commented Nov 30, 2023

Copy link
Copy Markdown
Member

The tests don't map to claimed support though, do they?

All reactions

Sorry, something went wrong.

Uh oh!

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

@targos

targos commented Nov 30, 2023

Copy link
Copy Markdown
Member

It's better to catch regression in tests instead of citgm

ljharb and marco-ippolito reacted with thumbs up emoji ljharb reacted with rocket emoji
All reactions
  • 👍 2 reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

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

benjamingr
benjamingr approved these changes Nov 30, 2023
View reviewed changes
@anonrig anonrig added the commit-queue PRs queued for automated landing through the Commit Queue. label Dec 3, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Dec 3, 2023
@nodejs-github-bot
nodejs-github-bot merged commit 0229502 into nodejs:main Dec 3, 2023
@nodejs-github-bot

nodejs-github-bot commented Dec 3, 2023

Copy link
Copy Markdown
Collaborator

Landed in 0229502

All reactions

Sorry, something went wrong.

Uh oh!

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

@targos targos added the dont-land-on-v18.x label Dec 4, 2023
@targos targos added dont-land-on-v20.x labels Dec 4, 2023
@targos

targos commented Dec 4, 2023

Copy link
Copy Markdown
Member

Depends on #50322

All reactions

Sorry, something went wrong.

Uh oh!

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

@anonrig

anonrig commented Dec 4, 2023

Copy link
Copy Markdown
Member Author

@targos Why did we add don't-land-on-v21? The dependent PR issue is fixed in this PR and therefore, we can remove the do not land issues on this PR and parent PR.

All reactions

Sorry, something went wrong.

Uh oh!

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

@targos

targos commented Dec 4, 2023

Copy link
Copy Markdown
Member

Feel free to change labels on both PRs if that's the correct thing to do. I just acted based on the parent PR labels.

anonrig reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@anonrig anonrig removed dont-land-on-v18.x labels Dec 4, 2023
@anonrig anonrig mentioned this pull request Dec 4, 2023
src: move package_json_reader cache to c++ #50322
Closed
8 tasks done
RafaelGSS pushed a commit that referenced this pull request Dec 15, 2023
@anonrig @RafaelGSS
src: omit bool values of package.json main field
9bf1443
PR-URL: #50965
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Dec 15, 2023
v21.5.0 proposal #51166
Merged
@marco-ippolito marco-ippolito added the backport-blocked-v20.x label May 2, 2024
@marco-ippolito

marco-ippolito commented May 2, 2024

Copy link
Copy Markdown
Member

to land on v20 dependes on #50965

All reactions

Sorry, something went wrong.

Uh oh!

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

@marco-ippolito marco-ippolito mentioned this pull request May 2, 2024
module: fix recently introduced coverity warning #50843
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@RafaelGSS RafaelGSS RafaelGSS left review comments
@GeoffreyBooth GeoffreyBooth GeoffreyBooth approved these changes
@benjamingr benjamingr benjamingr 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. 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

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

9 participants

@anonrig @nodejs-github-bot @targos @GeoffreyBooth @ljharb @aduh95 @marco-ippolito @benjamingr @RafaelGSS
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.