Commit Graph

324 Commits

Author SHA1 Message Date
Brian Vaughn 87b3ada89d DevTools: Named hooks supports "cheap-module-source-map" (#21874)
"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.
2021-07-14 14:37:27 -04:00
Brian Vaughn 9fec3f2add DevTools: Ignore multiple sourceMappingUrls for external source maps (#21871)
Added an edge case regression test and bugfix.
2021-07-13 16:39:29 -04:00
Brian Vaughn 64bbd7a7f1 Adjust Error stack columns numbers by 1 (#21865)
To account for differences between error stacks (1-based) and ASTs (0-based). In practice this change should not make an observable difference.
2021-07-13 13:28:01 -04:00
Brian Vaughn 32d88d4332 DevTools: Don't load source files contaning only unnamed hooks (#21835)
This wastes CPU cycles.
2021-07-08 16:46:17 -04:00
Brian Vaughn f52b73f9d0 DevTools: Update named hooks match to use column number also (#21833)
This prevents edge cases where AST nodes are incorrectly matched.
2021-07-08 16:12:22 -04:00
Brian Vaughn feb2f6892a DevTool: hook names cache no longer loses entries between selection (#21831)
Made several changes to the hooks name cache to avoid losing cached data between selected elements:
1. No longer use React-managed cache. This had the unfortunate side effect of the inspected element cache also clearing the hook names cache. For now, instead, a module-level WeakMap cache is used. This isn't great but we can revisit it later.
2. Hooks are no longer the cache keys (since hook objects get recreated between element inspections). Instead a hook key string made of fileName + line number + column number is used.
3. If hook names have already been loaded for a component, skip showing the load button and just show the hook names by default when selecting the component.
2021-07-08 13:54:16 -04:00
Brian Vaughn b6258b05f4 DevTools named hooks: Support FLow syntax (#21815)
Detect Flow pragma (@flow) and use Flow plug-in instead of TypeScript (default)
2021-07-07 14:29:41 -04:00
Brian Vaughn 42b3c89c57 DevTooks: Don't dehydrate hook source fileNames (#21814) 2021-07-07 14:24:17 -04:00
Moti Zilberman 9c7f29ebe7 [WIP] DevTools: Support named hooks for >1 module in a bundle (#21790)
* Add named hooks test case built with Rollup

* Fix prepareStackTrace unpatching, remove sourceURL

* Prettier

* Resolve source map URL/path relative to the script

* Add failing tests for multi-module bundle

* Parse hook names from multiple modules in a bundle

* Create a HookSourceData per location key (file, line, column).
* Cache the source map per runtime URL ( = file part of location key).
* Don't store sourceMapContents - only store a consumer instance.
* Look up original source URLs in the source map correctly.
* Cache the code + AST per original URL.
* Fix off-by-one column number lookup.
* Some naming and typing tweaks related to the above.
* Stop storing the consumer outside the with() callback, which is a bug.

* Lint fix for 8d8dd25

* Added devDependencies to react-devtools-extensions package.json

* Added some debug logging and TODO comments

* Added additional DEBUG logging to hook names cache

Co-authored-by: Brian Vaughn <bvaughn@fb.com>
2021-07-07 13:07:58 -04:00
Brian Vaughn c5cfa71948 DevTools: Show hook names based on variable usage (#21641)
Co-authored-by: Brian Vaughn <brian.david.vaughn@gmail.com>
Co-authored-by: Saphal Patro <saphal1998@gmail.com>
Co-authored-by: VibhorCodecianGupta <vibhordelgupta@gmail.com>
2021-07-01 14:39:18 -04:00
Brian Vaughn d483463bc8 Updated scripts and config to replace "master" with "main" branch (#21768) 2021-06-29 14:26:24 -04:00
Brian Vaughn 0ae5290b54 DevTools 4.13.4 -> 4.13.5 2021-05-25 15:18:47 -04:00
Brian Vaughn 132b72d7b6 DevTools 4.13.3 -> 4.13.4 2021-05-20 11:24:30 -04:00
Brian Vaughn 4d402cdda0 Preparing DevTools 4.13.2 -> 4.13.3 for release 2021-05-18 13:23:06 -04:00
Brian Vaughn 2bf4805e4b Update entry point exports (#21488)
The following APIs have been added to the `react` stable entry point:
* `SuspenseList`
* `startTransition`
* `unstable_createMutableSource`
* `unstable_useMutableSource`
* `useDeferredValue`
* `useTransition`

The following APIs have been added or removed from the `react-dom` stable entry point:
* `createRoot`
* `unstable_createPortal` (removed)

The following APIs have been added to the `react-is` stable entry point:
* `SuspenseList`
* `isSuspenseList`

The following feature flags have been changed from experimental to true:
* `enableLazyElements`
* `enableSelectiveHydration`
* `enableSuspenseServerRenderer`
2021-05-12 11:28:14 -04:00
Brian Vaughn 0a8fefca4c DevTools 4.13.1 -> 4.13.2 2021-05-07 08:52:02 -04:00
Brian Vaughn 85b543c6b4 Added new GitHub issue form for React DevTools bug reports (#21450)
Added a new bug report template built with GitHub issue forms:
https://gh-community.github.io/issue-template-feedback/structured/

And updated DevTools bug report link to send information formatted for this new template.
2021-05-07 08:46:58 -04:00
Brian Vaughn 014edf1980 Prepare DevTools 4.13.1 release 2021-05-04 22:35:30 -04:00
Brian Vaughn 2a7bb41548 Preparing DevTools 4.12.4 -> 4.13.0 release (#21378) 2021-04-28 12:36:24 -04:00
Brian Vaughn 7becb2ff1b DevTools version bump 4.12.3 -> 4.12.4 2021-04-19 21:23:01 -04:00
Brian Vaughn 8f202a7c8d DevTools version bump 4.12.2 -> 4.12.3 2021-04-19 13:09:07 -04:00
Brian Vaughn d14b6a4bdd DevTools version bump 4.12.1 -> 4.12.2 2021-04-16 12:35:29 -04:00
Brian Vaughn 6b3d86a2e9 Fixed bug in react-detools-inline frontend init method (#21265) 2021-04-14 13:27:21 -04:00
Brian Vaughn 84c06fef81 Add createBridge and createStore exports to react-devtools-inline (for Replay integration) (#21032) 2021-04-12 17:07:14 -04:00
Brian Vaughn d4cae99f2a Prepare DevTools CHANGELOG and versions for 4.11.0 release (#21221) 2021-04-09 19:12:13 -04:00
Brian Vaughn ee6a05c2bf Bumped DevTools Chrome and Firefox versions in Babel config (#21185)
We have been building DevTools to target Chrome 49 and Firefox 54. These are super old browser versions and they did not have full ES6 support, so the generated build is more bloated than it needs to be.

DevTools uses most modern language features. Off the top of my head, we it uses basically everything but async and generator functions.

Based on CanIUse charts– I believe that in order to avoid unnecessary polyfill/wrapper code being generated, we'd need to target Chrome 60+ (released 2017-07-25) and Firefox 55+ (released 2017-04-18). This seems like a reasonable set of browsers to target.

Note that we can't remove the IE 11 target from the react-devtools-core backend yet due to Hermes (React Native) ES6 support but that should be doable by the end of the year given current engineering targets. But we could update the frontend target, as well as the targets for the extensions and the react-devtools-inline package.

This commit increases the browser targets then for Chrome (from 49 to 60) and Firefox (from 54 to 55)
2021-04-06 11:18:46 -04:00
Brian Vaughn 119736b1c2 [FB-only] Show which hooks (indices) changed when profiling (#20998) 2021-03-17 12:28:21 -04:00
Sebastian Silbermann 00d4f95c2a Document prerequisites for download-experimental-build (#21005) 2021-03-15 09:48:44 -04:00
Hector Rincon c06d245fc7 Update devtools-extensions build script to reflect changes in local b… (#21004)
Co-authored-by: Brian Vaughn <bvaughn@fb.com>
2021-03-15 09:46:46 -04:00
Sebastian Silbermann 09a2c363a5 Expose DEV-mode warnings in devtools UI (#20463)
Co-authored-by: Brian Vaughn <bvaughn@fb.com>
2020-12-22 11:09:29 -05:00
Brian Vaughn f160547f47 React DevTools 4.10.0 -> 4.10.1 2020-12-04 16:43:13 -05:00
Brian Vaughn 11a2ae3a0d DevTools 4.9.0 -> 4.10.0 2020-11-12 09:07:10 -05:00
Sy Tran Dung 4e5d7faf54 Fix error loading source maps for devtools extension (#20079) 2020-10-22 11:26:24 -04:00
Brian Vaughn 51a3aa6afb DevTools 4.8.2 -> 4.9.0 bump 2020-10-19 11:20:54 -04:00
Saikat Guha 4eb589169c DevTools: Handle restricted browser pages properly like new tab page, extensions page etc(only chrome and edge for now) (#20023) 2020-10-14 13:59:05 -04:00
Nick Reiley 7e405d458d [DevTools] Add DevTools forked Feature flags (#18994)
Also resolve an uncaught error in extension build (#18843).

Co-authored-by: Brian Vaughn <brian.david.vaughn@gmail.com>
Co-authored-by: Brian Vaughn <bvaughn@fb.com>
2020-10-12 13:07:10 -04:00
Saikat Guha f46a80ae11 Update outdated links and fix two broken links (#19985)
* update all facebook.github.io links

* facebookincubator links : update some outdated links and fix two other broken links where they are actually the latest updated ones
2020-10-09 02:56:30 +01:00
Brian Vaughn 461cd84944 Revert "DevTools: Improve browser extension iframe support (#19854)" (#19959)
This reverts commit a99bf5c5f4.
2020-10-05 09:44:08 -04:00
Saikat Guha 91d2b6ef01 DevTools: Remove ReactJS.org version check "cheat" (#19939)
Remove dead code as facebook.github.io/react always redirects to reactjs.org, which has prod version of react. so removing the "cheat" (#19939)
2020-10-01 10:16:50 -04:00
6h057 a99bf5c5f4 DevTools: Improve browser extension iframe support (#19854)
Co-authored-by: Joel DSouza <joel.dsouza@kapturecrm.com>
Co-authored-by: Damien Maillard <damien.maillard@dailymotion.com>
Co-authored-by: Brian Vaughn <brian.david.vaughn@gmail.com>
2020-09-23 16:56:13 -04:00
Johnny Pribyl b3b1bb9ce2 Enable source maps for DevTools production builds (#19773)
Co-authored-by: Brian Vaughn <bvaughn@fb.com>
2020-09-18 10:07:22 -04:00
Brian Vaughn 26857ecfa9 Revert "DevTools: Improve browser extension iframe support (#19827)" (#19852)
This reverts commit ec39a5e901.
2020-09-17 14:57:44 -04:00
6h057 ec39a5e901 DevTools: Improve browser extension iframe support (#19827)
Co-authored-by: Joel DSouza <joel.dsouza@kapturecrm.com>
Co-authored-by: Damien Maillard <damien.maillard@dailymotion.com>
Co-authored-by: Brian Vaughn <brian.david.vaughn@gmail.com>
2020-09-14 10:04:46 -04:00
E-Liang Tan 38a512acad Scheduling Profiler: Redesign with DevTools styling (#19707)
Co-authored-by: Brian Vaughn <bvaughn@fb.com>
2020-09-03 12:08:40 -04:00
E-Liang Tan c641b611c4 Upgrade all @babel/* packages to fix DevTools builds on newer Node versions (#19647) 2020-08-20 11:47:16 -04:00
ᴜɴвʏтᴇ 24f1923b1b fix: open two same tabs on firefox (#19632)
close #19629
2020-08-18 10:17:00 -04:00
Brian Vaughn c3ee973c56 Fix emoji character displayed in Chrome extension (#19603) 2020-08-13 11:16:35 -04:00
Pascal Fong Kye b6e1d08604 DevTools bug fix: Proxied methods should be safely dehydrated for display 2020-08-12 12:15:53 -04:00
Brian Vaughn fed4ae0247 DevTools 4.8.1 -> 4.8.2 (and CHANGELOG) 2020-07-15 12:37:08 -04:00
Brian Vaughn a9ba5283d9 Disable DevTools minification (#19369)
DevTools isn't being downloaded like typical JavaScript, so bundle size concerns don't apply. Parsing is still a consideration (so I'm open for discussion here) but I think this change would provide a couple of benefits:
* People are more likely to *actually read* non-minified source code when e.g. a breakpoint is hit (as with the recent debugger statement)
* Component stacks will be easier to parse on bug reports
2020-07-15 10:38:30 -04:00