Skip to content

doc: clarify that conditional exports take effect with ES module#42336

Closed
meixg wants to merge 1 commit into
nodejs:masterfrom
meixg:doc-conditional-exports-meixg
Closed

doc: clarify that conditional exports take effect with ES module#42336
meixg wants to merge 1 commit into
nodejs:masterfrom
meixg:doc-conditional-exports-meixg

Conversation

@meixg

@meixg meixg commented Mar 15, 2022

Copy link
Copy Markdown
Member

resolve: #36162


Self-referencing works fine without --experimental-modules in v12.16.0.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/modules

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Mar 15, 2022
@meixg meixg requested a review from aduh95 March 15, 2022 04:56
@ljharb

ljharb commented Mar 15, 2022

Copy link
Copy Markdown
Member

I’m confused; ES module support was unflagged in v12.17; why would we want to document the flag for an EOL node version where it was experimental?

@meixg

meixg commented Mar 15, 2022

Copy link
Copy Markdown
Member Author

I’m confused; ES module support was unflagged in v12.17; why would we want to document the flag for an EOL node version where it was experimental?

There is a gap(v12.16.0) between ES module unflagged and conditional exports adding, people may get confused like #36162.

Also, "conditional exports take effect with ES module" seems not clarified.


Not sure if is necessary to document the flag for an EOL node version though.

@ljharb

ljharb commented Mar 15, 2022

Copy link
Copy Markdown
Member

I agree that’s not a complete sentence and is very confusing, but your PR is what’s adding that.

The linked issue is from almost 2 years ago. I don’t think this is what’s confusing people about ES modules (there’s a lot, but “i need to use a flag on my unsupported insecure buggy old node version” isn’t it)

@GeoffreyBooth GeoffreyBooth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don’t think this is necessary information for the docs to include, especially since the unflagging was years ago.

@meixg

meixg commented Mar 15, 2022

Copy link
Copy Markdown
Member Author

kinda agree with that, maybe we can just close #36162 then?

@meixg meixg closed this Mar 15, 2022
@meixg meixg deleted the doc-conditional-exports-meixg branch March 15, 2022 05:23
@gpoole

gpoole commented Mar 15, 2022

Copy link
Copy Markdown
Contributor

The original issue was that the history section of the documentation currently indicates that support for this feature was completely unflagged in v12.16 when this isn't the case, since it was behind a second flag which isn't mentioned at all there. I feel that it's important for the history to be an accurate record of what changed when, regardless of how old, buggy or unsupported the version is, which is why I opened the issue originally.

I agree that it's now not relevant for the vast majority of people and shouldn't be called out explicitly in the main text for that section. It seems to me like a simple and unintrusive fix is to correct the inaccuracy with a new entry in the history like this:

v12.16.0 Remove the --experimental-conditional-exports option, conditional exports now behind --experimental-modules
v12.17.0 Remove --experimental-modules flag

I'm happy to open a PR for that if it's likely to be accepted.

@ljharb

ljharb commented Mar 15, 2022

Copy link
Copy Markdown
Member

That sounds great to me! Accurate history is good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Issues and PRs related to the documentations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doc: history shows wrong version for conditional package export support

5 participants