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

docs: add explanation for supportsStaticESM transform option #12028

Merged
merged 3 commits into from
Nov 7, 2022

Conversation

ahnpnl
Copy link
Contributor

@ahnpnl ahnpnl commented Nov 3, 2021

Summary

Closes #12021

Test plan

Start local doc server and go to http://localhost:3000/docs/code-transformation

@ahnpnl ahnpnl marked this pull request as ready for review November 3, 2021 08:38
@codecov-commenter
Copy link

Codecov Report

Merging #12028 (2e0aaf3) into main (9301c73) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #12028   +/-   ##
=======================================
  Coverage   68.77%   68.77%           
=======================================
  Files         324      324           
  Lines       16670    16670           
  Branches     4814     4814           
=======================================
  Hits        11465    11465           
  Misses       5172     5172           
  Partials       33       33           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9301c73...2e0aaf3. Read the comment docs.

@SimenB
Copy link
Member

SimenB commented Nov 3, 2021

Should we link to https://jestjs.io/docs/ecmascript-modules? The point is "ESM must be active" and I think those docs describe it quite well? Not sure 🙂

docs/CodeTransformation.md Outdated Show resolved Hide resolved
@ahnpnl
Copy link
Contributor Author

ahnpnl commented Nov 3, 2021

Should we link to https://jestjs.io/docs/ecmascript-modules? The point is "ESM must be active" and I think those docs describe it quite well? Not sure 🙂

I added See more at <link>

@ahnpnl ahnpnl requested a review from SimenB November 5, 2021 08:28
/**
* The value is:
* - `false` if Jest runs without Node ESM flag `--experimental-vm-modules`
* - `true` if the file extension is defined in [extensionsToTreatAsEsm](https://jestjs.io/docs/next/configuration#extensionstotreatasesm-arraystring)
Copy link
Member

Choose a reason for hiding this comment

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

hard coding a version will break when we roll new versions. Should use a relative link

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I hope I put the correct one now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ping :)

* - `true` if the file extension is defined in [extensionsToTreatAsEsm](Configuration.md#extensionstotreatasesm-arraystring)
* and Jest runs with Node ESM flag `--experimental-vm-modules`
*
* See more at https://jestjs.io/docs/next/ecmascript-modules
Copy link
Member

Choose a reason for hiding this comment

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

These would then be wrong when rolling a new version of the docs. Are we able to make docusaurus generate this link (i.e. use relative link within the source code)?

/cc @slorber

@SimenB
Copy link
Member

SimenB commented Nov 3, 2022

@ahnpnl could you rebase this? I'm fine with the link being outdated in newer docs 🙂

@SimenB SimenB merged commit fb2daf4 into jestjs:main Nov 7, 2022
@github-actions
Copy link

github-actions bot commented Dec 8, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Documentation]: supportsStaticESM option is unclear when value is false/true
5 participants