Skip to content

Comments

Add option for source maps when running tests#24577

Merged
acdlite merged 1 commit intofacebook:mainfrom
acdlite:add-sourcemaps-option
May 18, 2022
Merged

Add option for source maps when running tests#24577
acdlite merged 1 commit intofacebook:mainfrom
acdlite:add-sourcemaps-option

Conversation

@acdlite
Copy link
Collaborator

@acdlite acdlite commented May 18, 2022

I added a --sourceMaps option to our test command that enables inline source maps. I've kept it disabled by default, since it makes the tests run slower. But it's super useful when attaching to a debugger.

I added a `--sourceMaps` option to our test command that enables inline
source maps. I've kept it disabled by default, since it makes the tests
run slower. But it's super useful when attaching to a debugger.
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels May 18, 2022
@acdlite acdlite requested a review from rickhanlonii May 18, 2022 15:30
@sizebot
Copy link

sizebot commented May 18, 2022

Comparing: a412d78...268bbe1

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 131.49 kB 131.49 kB = 42.15 kB 42.14 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 136.73 kB 136.73 kB = 43.69 kB 43.69 kB
facebook-www/ReactDOM-prod.classic.js = 441.13 kB 441.13 kB = 80.41 kB 80.41 kB
facebook-www/ReactDOM-prod.modern.js = 426.34 kB 426.34 kB = 78.23 kB 78.23 kB
facebook-www/ReactDOMForked-prod.classic.js = 441.13 kB 441.13 kB = 80.42 kB 80.41 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 268bbe1

Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

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

TIL :O

@acdlite acdlite merged commit 7698758 into facebook:main May 18, 2022
XYShaoKang added a commit to XYShaoKang/react that referenced this pull request Feb 22, 2023
In facebook#24577, the `--sourceMaps` option was added,
but modifying the `--sourceMaps` option has no effect.

Because `process.env.JEST_ENABLE_SOURCE_MAPS` was not added to
the string array of `createCacheKeyFunction`, it caused a cache
to be generated when the first test was run, and when the second
test was run, modifying `process.env.JEST_ENABLE_SOURCE_MAPS`
would not affect the running result, resulting in the failure of
the `--sourceMaps`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants