The Wayback Machine - https://web.archive.org/web/20210719233752/https://github.com/facebook/react/pull/21874
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

DevTools: Named hooks supports "cheap-module-source-map" #21874

Merged
merged 3 commits into from Jul 14, 2021

Conversation

@bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Jul 13, 2021

"cheap-module-source-map" is the default source-map generation mode used in created-react-dev mode because of speed. The major trade-off is that the source maps generated don't contain column numbers, so DevTools needs to be more lenient when matching AST nodes in this mode.

In this case, it can ignore column numbers and match nodes using line numbers only– so long as only a single node matches. If more than one match is found, treat it the same as if none were found, and fall back to no name.

Resolves #21868

TODO:

  • Match using line numbers only when column number is 0. (Fail if more than one node matches.)
  • Add regression tests for Webpack cheap source maps. (Probably involves adding a "webpack-dev" folder output to this test build script.)
@bvaughn bvaughn changed the title DevTools: Named hooks feature supports cheap source maps DevTools: Named hooks supports "cheap-module-source-map" Jul 13, 2021
@bvaughn bvaughn force-pushed the bvaughn:devtools-named-hooks-cra-dev branch from 18947d2 to a9d4bd8 Jul 13, 2021
@sizebot
Copy link

@sizebot sizebot commented Jul 13, 2021

Comparing: a97b5ac...e82964a

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 = 126.82 kB 126.82 kB = 40.61 kB 40.61 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 129.64 kB 129.64 kB = 41.57 kB 41.57 kB
facebook-www/ReactDOM-prod.classic.js = 403.34 kB 403.34 kB = 74.63 kB 74.63 kB
facebook-www/ReactDOM-prod.modern.js = 392.04 kB 392.04 kB = 72.91 kB 72.91 kB
facebook-www/ReactDOMForked-prod.classic.js = 403.34 kB 403.34 kB = 74.63 kB 74.63 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against e82964a

bvaughn added 3 commits Jul 13, 2021
This is the default used in created-react-dev mode. These source maps don't support column numbers, so DevTools needs to be more lenient when matching AST nodes in this mode.
@bvaughn bvaughn force-pushed the bvaughn:devtools-named-hooks-cra-dev branch from a9d4bd8 to e82964a Jul 14, 2021
@bvaughn bvaughn merged commit 87b3ada into facebook:main Jul 14, 2021
35 checks passed
35 checks passed
@facebook-github-tools
Facebook CLA Check Contributor License Agreement is valid!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_build Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_dom_fixtures Your tests passed on CircleCI!
Details
ci/circleci: build_devtools_and_process_artifacts Your tests passed on CircleCI!
Details
ci/circleci: build_devtools_scheduling_profiler Your tests passed on CircleCI!
Details
ci/circleci: get_base_build Your tests passed on CircleCI!
Details
ci/circleci: process_artifacts_combined Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: sizebot Your tests passed on CircleCI!
Details
ci/circleci: sync_reconciler_forks Your tests passed on CircleCI!
Details
ci/circleci: yarn_build Your tests passed on CircleCI!
Details
ci/circleci: yarn_build_combined Your tests passed on CircleCI!
Details
ci/circleci: yarn_flow Your tests passed on CircleCI!
Details
ci/circleci: yarn_lint Your tests passed on CircleCI!
Details
ci/circleci: yarn_lint_build Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=experimental --env=development Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=experimental --env=development --persistent Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=experimental --env=production Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=stable --env=development Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=stable --env=development --persistent Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=stable --env=production Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-classic --env=development --variant=false Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-classic --env=development --variant=true Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-classic --env=production --variant=false Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-classic --env=production --variant=true Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-modern --env=development --variant=false Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-modern --env=development --variant=true Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-modern --env=production --variant=false Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-modern --env=production --variant=true Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build---project=devtools -r=experimental Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build--r=experimental --env=development Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build--r=experimental --env=production Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build--r=stable --env=development Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build--r=stable --env=production Your tests passed on CircleCI!
Details
@codesandbox
ci/codesandbox Building packages succeeded.
Details
@bvaughn bvaughn deleted the bvaughn:devtools-named-hooks-cra-dev branch Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment