Commit Graph
135 Commits
Author SHA1 Message Date
Nicolas Chevobbe 29843b03b0 Bug 1826503 - [devtools] Properly vendor fuzzaldrin-plus. r=devtools-reviewers,sylvestre,ochameau.
The library is added in devtools/client/shared/vendor, like the other third-party
libraries we use in DevTools.

This was the latest file that justified the debugger-specific vendor machinery,
so we can clean that up now.

First, we can remove the vendor.js file.
With this, this means that bin/bundle.js now only bundles the workers, using rollup,
so we can remove webpack and its associated packages from package.json, as well
as the webpack.config.js.
Finally, we can stop handling debugger vendors in build-debugger.js

Differential Revision: https://phabricator.services.mozilla.com/D193916
2023-11-24 08:50:42 +00:00
Nicolas Chevobbe a7b06eb2a6 Bug 1862963 - [devtools] Use strictRequires option for commonjs rollup plugin. r=devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D192770
2023-11-07 05:54:52 +00:00
Nicolas Chevobbe 89f42791e8 Bug 1826504 - [devtools] Remove react-transition-group/Transition from Debugger vendors.js. r=devtools-reviewers,ochameau.
The library was only used to make the quick search panel
and the shortcut modal to show with a slide-in animation.
This can be replaced with a simple CSS animation instead.
I'm taking this as an opportunity to cleanup a few things
that were unecessary or not ideal in the CSS file.

Differential Revision: https://phabricator.services.mozilla.com/D192266
2023-11-03 10:00:06 +00:00
Hubert Boma Manilla ca067bf948 Bug 1853294 - [devtools] Pass the function and class symbols to the outline panel on the demand r=devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D188432
2023-10-19 08:36:25 +00:00
Alexandre Poirot bdd6eb6ba2 Bug 1857214 - [devtools] Avoid creating duplicated identifiers. r=devtools-reviewers,bomsy
We were creating them and later filtering them out.
Also `getUniqueIdentifiers` was duplicating a possibly 100M+ large array...

Differential Revision: https://phabricator.services.mozilla.com/D190177
2023-10-18 08:00:11 +00:00
Alexandre Poirot 7a266520f8 Bug 1857214 - [devtools] Avoid instantiating lots of intermediate arrays when computing the identifiers. r=devtools-reviewers,nchevobbe
On bug 1843454 STR, symbols.identifiers is a 100M large array.
So all these intermediate array cause a serious amount of short-lived arrays.

Differential Revision: https://phabricator.services.mozilla.com/D190176
2023-10-18 08:00:11 +00:00
Alexandre Poirot 7538ee82ae Bug 1857214 - [devtools] Stop collecting call expressions to know if the module is a react module. r=devtools-reviewers,nchevobbe
As `callExpressions` are only used for knowing if that's a react module...
We could avoid a bunch of intermediate objects by computing right away if we have a react import.

Differential Revision: https://phabricator.services.mozilla.com/D190782
2023-10-18 08:00:10 +00:00
Alexandre Poirot bb0be469e7 Bug 1857214 - [devtools] Stop collecting imports to know if the module is a react module. r=devtools-reviewers,nchevobbe
As `imports` are only used for knowing if that's a react module...
We could avoid a bunch of intermediate objects by computing right away if we have a react import.

Differential Revision: https://phabricator.services.mozilla.com/D190781
2023-10-18 08:00:09 +00:00
Hubert Boma Manilla 5b1fe0ca95 Bug 1854889 - [devtools] Add some documentation to the parsing for scope information r=devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D187734
2023-10-02 23:17:47 +00:00
Hubert Boma Manilla a9f1967710 Bug 1853296 - [devtools] Pass the function symbols to the main thread when the Quick open panel is opened r=devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D188423
2023-09-29 16:22:26 +00:00
Alexandre Poirot 55afd4cab1 Bug 1851566 - [devtools] Avoid passing large dataset out of the parser worker. r=devtools-reviewers,bomsy
These three attributes are very large arrays and we could easily keep them
within the worker thread by exposing new dedicated method.

Differential Revision: https://phabricator.services.mozilla.com/D187436
2023-09-11 13:51:24 +00:00
Tooru Fujisawa e789b641d5 Bug 1849144 - Fix the number of whitespaces used for preserving the column number of inline script. r=ochameau,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D186596
2023-08-22 09:25:34 +00:00
Natalia Csoregi f3a3b20d62 Backed out changeset b65a5303a7ae (bug 1849144) for causing eslint failure. CLOSED TREE 2023-08-21 21:48:36 +03:00
Tooru Fujisawa ff970a898a Bug 1849144 - Fix the number of whitespaces used for preserving the column number of inline script. r=ochameau,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D186596
2023-08-21 16:25:40 +00:00
Hubert Boma Manilla a6174b08c7 Bug 1724562 - [devtools] Move parse-script-tags module to the parser utils file r=devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D182665
2023-07-14 17:34:27 +00:00
Nicolas Chevobbe 1ace4e8d61 Bug 1837926 - [devtools] Support new RegExp v flag in parser worker. r=devtools-reviewers,ochameau.
Add plugin-proposal-unicode-sets-regex babel plugin and use it.
Add a jest test for it.

Differential Revision: https://phabricator.services.mozilla.com/D180676
2023-06-13 05:01:21 +00:00
Nicolas Chevobbe 2aad9f9607 Bug 1837926 - [devtools] Update babel/parser package. r=devtools-reviewers,ochameau.
This is needed to handle the new Regexp `v` flag.
I'm taking this as an opportunity to fix a couple issue in the bundle script.

Differential Revision: https://phabricator.services.mozilla.com/D180675
2023-06-13 05:01:21 +00:00
Alexandre Poirot 3a5f41c879 Bug 1836768 - [devtools] Stop wiping parser worker cache on navigation. r=devtools-reviewers,bomsy
Instead clear per removed thread so that state of the previous page
doesn't get cleared as the navigation of the next page starts.
This will also be useful for service worker debugging.

Differential Revision: https://phabricator.services.mozilla.com/D179941
2023-06-12 21:26:02 +00:00
Mark Banner 84b529bc1d Bug 1826062 - Manual fixes for Prettier 2.0.5 upgrade. r=mossop,devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D177907
2023-05-20 12:26:52 +00:00
Nicolas Chevobbe ced1b2515a Bug 1826502 - [devtools] Remove classnames package. r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D174954
2023-04-13 06:37:02 +00:00
Nicolas Chevobbe 17b6d80865 Bug 1826508 - [devtools] Use rollup for bundling debugger workers. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D174723
2023-04-11 05:55:17 +00:00
Hubert Boma Manilla 3307dbecf5 Bug 1811039 - [devtools] Add support for excluding sources r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D171491
2023-03-27 09:36:26 +00:00
Hubert Boma Manilla feec5e0ab7 Bug 1821931 - [devtools] Add the micromatch package to MC r=ochameau,devtools-reviewers,mhoye
Differential Revision: https://phabricator.services.mozilla.com/D172380
2023-03-27 09:36:25 +00:00
Hubert Boma Manilla 20a1c00258 Bug 1818962 - [devtools] Refactor search modifiers actions and reducers r=ochameau,devtools-reviewers
This patch makes the SearchInput a connected component, This allows us cleanup
all the seperate actions and reducer logic and makes it easier to add new SearchInput
with modifers functionality.

Differential Revision: https://phabricator.services.mozilla.com/D171034
2023-03-18 18:59:47 +00:00
Alexandre Poirot 187a45e360 Bug 1803616 - [devtools] Implement a Javascript Tracer in the debugger. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
On the server side, this patch introduces:
* a new "tracer" Target Scope actor to start and stop tracing per target
* a new TRACING_STATE resource in order to report to the client when we start/stop tracing and with which log method.

On the frontend side, this patch introduces:
* a global tracer button, which will enable/disable tracing for all targets/threads
  all at once.
* a global header, similar to pause, reporting if any target is tracing or not.
The header reuses the pause header and we may want to followup to better coordinate case
where we pause and trace at the same time. Only one of the two states is displayed.

We may want to followup here to be able to trace only one target and see the state per target.

Differential Revision: https://phabricator.services.mozilla.com/D163614
2023-03-14 17:17:05 +00:00
Nicolas Chevobbe 688dac2351 Bug 1819926 - [devtools] Use custom SourceNode classes to make prettyFast faster. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D171477
2023-03-11 11:26:00 +00:00
Nicolas Chevobbe 825b0f8767 Bug 1819939 - [devtools] Update source-map to 0.7.4. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D171476
2023-03-11 11:25:59 +00:00
Nicolas Chevobbe 2e67793dc6 Bug 1819937 - [devtools] Update acorn to 8.8.2. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D171474
2023-03-11 11:25:59 +00:00
Nicolas Chevobbe 69d1c9bfa3 Bug 1819350 - [devtools] Simplify prettyFast sanitize function. r=devtools-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D171242
2023-03-01 08:59:48 +00:00
Nicolas Chevobbe 9088f66806 Bug 1819350 - [devtools] Simplify prettyFast sanitize function. r=devtools-reviewers,jdescottes
Depends on D171187

Differential Revision: https://phabricator.services.mozilla.com/D171242
2023-03-01 06:40:13 +00:00
Nicolas Chevobbe cb8a712cf6 Bug 1819268 - [devtools] Don't add sourceFile when fetching tokens for pretty-printing. r=jdescottes.
We don't make any use of this information, so we'd better not pass the option.

Differential Revision: https://phabricator.services.mozilla.com/D171186
2023-03-01 06:40:13 +00:00
Cristina Horotan 5a1845ce9e Backed out 2 changesets (bug 1819268, bug 1817728) for causing devtools-bundle failure. CLOSED TREE
Backed out changeset 2da5ed051ee6 (bug 1819268)
Backed out changeset e8ff7001217f (bug 1817728)
2023-02-28 17:18:53 +02:00
Nicolas Chevobbe d2161cab0a Bug 1819268 - [devtools] Don't add sourceFile when fetching tokens for pretty-printing. r=jdescottes.
We don't make any use of this information, so we'd better not pass the option.

Depends on D171185

Differential Revision: https://phabricator.services.mozilla.com/D171186
2023-02-28 15:02:08 +00:00
Hubert Boma Manilla b3b59aa9a8 Bug 1817984 - [devtools] Add Search Modifiers for the project search component r=ochameau
In this patch
- Move search modifiers support into the SearchInput component, so that it can be shared across the Project Search, File Search and the Quick modal Search.
- Add on the actions, reducers and workers support for search modifiers to project search

Differential Revision: https://phabricator.services.mozilla.com/D168932
2023-02-26 23:45:00 +00:00
Butkovits Atila 8a435ba108 Backed out changeset 5aa8652bdc97 (bug 1817984) for causing failures at browser_dbg-project-search.js. CLOSED TREE 2023-02-27 00:03:47 +02:00
Hubert Boma Manilla b98a52625f Bug 1817984 - [devtools] Add Search Modifiers for the project search component r=ochameau
In this patch
- Move search modifiers support into the SearchInput component, so that it can be shared across the Project Search, File Search and the Quick modal Search.
- Add on the actions, reducers and workers support for search modifiers to project search

Differential Revision: https://phabricator.services.mozilla.com/D168932
2023-02-26 19:34:02 +00:00
Alexandre Poirot 12c15d77c5 Bug 1815497 - [devtools] Simplify a few things around pretty printing. r=devtools-reviewers,nchevobbe
* remove prettyPrint.spec.js as it only contains trivial assertions mostly covered by mochitests.
  Duplicated calls to toggle pretty print to the same source has been converted to a mochitest (browser_dbg-pretty-print-flow.js).
  But we can't easily replicate the exact same assertion as the assert() from `togglePrettyPrint` only thows on Node...
  I tweaked assert module to highlight how to try enabling it on mochitests via flags.testing.

  Removing this jest test helps remove useless export of `createPrettyPrintSource`, better highlighting the external API of prettyPrint.js
  About the mochitest, awaiting for togglePrettyPrint makes it useless to wait asynchronously for tabs opening.

* I removed a jest test from project-text-search.spec.js which started failing
  and should already be covered by mochitests?

* about `selectPrettyLocation`, we do not need to pass the generatedLocation argument,
  as this is always the currently selected location. Also we were selecting it once,
  mostly to force the loading of the original/pretty source via `selectSource()`.
  And then we were calling `selectSpecificLocation` a second time.
  We could select the source only once, if we force loading the original source first.
  We only need to populate the SourceMapLoader before trying to update the selection.
  This change may slow down the display of pretty printed source, but should avoid intermittents
  and unexpected changes of selected location.

* last but not least, `setSymbols` can be removed as this is done when calling `selectLocation`.
  This was the main goal, so that we can revise `setSymbols` more easily in following patches.

Differential Revision: https://phabricator.services.mozilla.com/D168425
2023-02-16 13:01:46 +00:00
Nicolas Chevobbe 71c11e2b03 Bug 1815452 - [devtools] Simplify mapping structure posted to/from workers. r=ochameau,bomsy.
We used to get the mappings array from the pretty fast worker to the prettyPrint
action, and then pass this array to the sourceMap service (also a worker).
As the mapping can be quite large, and given it has a complex shape, passing it
to and from workers (via `postMessage`) was costly.

So here, instead of passing only the mapping, we directly generate the sourceMap
from the pretty fast worker, and pass it to the action which forwards it to
the sourceMap service.

This helps reduce the overhead we were seeing when not buffering the lines in
the pretty print worker, in the previous patch of this stack.

Differential Revision: https://phabricator.services.mozilla.com/D168384
2023-02-07 15:05:35 +00:00
Nicolas Chevobbe 89adc4b21a Bug 1810409 - [devtools] Simplify pretty-fast.js .r=ochameau.
- Replace custom repeat function with String#repeat
- Switch dictionnaries from Objects to Sets

Differential Revision: https://phabricator.services.mozilla.com/D166892
2023-01-20 06:46:57 +00:00
Nicolas Chevobbe da478d65df Bug 1804886 - [devtools] Update pretty-print-worker bundle . r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D166674
2023-01-20 06:46:57 +00:00
Nicolas Chevobbe d907575b23 Bug 1804886 - [devtools] Move pretty-fast into debugger/src/workers/pretty-print. r=ochameau.
I disabled indivual eslint rules for the file and I'll
fix them in individual commits in this stack

Differential Revision: https://phabricator.services.mozilla.com/D166554
2023-01-20 06:46:54 +00:00
Nicolas Chevobbe 8006bd89d0 Bug 1811207 - [devtools] Remove debugger-tests task and run debugger jest test via devtools-tests. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D167241
2023-01-19 14:55:40 +00:00
Alexandre Poirot 54915478d2 Bug 1805378 - [devtools] Automatically start the worker on first WorkerDispatcher invoke/task call. r=bomsy,perftest-reviewers,kshampur
Because of this, we have to now pass the worker URL via WorkerDispatcher constructor.
Doing this should help then extend WorkerDispatcher instead of manually instantiating it.

About browser_jsterm_hide_when_devtools_chrome_enabled_false.js, as the SourceMapLoader
is now started lazily, the worker is no longer started during this test
and so we no longer have to wait for it.

And browser_jsterm_await_paused.js was failing because we resumed too quickly.
I added some code to better wait for awaitExpression full evaluation.

Differential Revision: https://phabricator.services.mozilla.com/D164547
2022-12-20 19:09:56 +00:00
Alexandre Poirot 55a93fba0f Bug 1805378 - [devtools] Convert WorkerDispatcher to ES Class. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D164546
2022-12-20 19:09:55 +00:00
Alexandre Poirot eb34965a44 Bug 1805378 - [devtools] Remove unused getNextStep method from the parser worker. r=bomsy
As well as its leftover dependencies.

Differential Revision: https://phabricator.services.mozilla.com/D164544
2022-12-20 19:09:54 +00:00
Stanca Serban a07226cd80 Backed out 7 changesets (bug 1805378) for causing failures in source-map-loader.js. CLOSED TREE
Backed out changeset 4dd1ad435728 (bug 1805378)
Backed out changeset 5479ff3a475f (bug 1805378)
Backed out changeset bd89280bde1a (bug 1805378)
Backed out changeset 1bd4fec4b964 (bug 1805378)
Backed out changeset 975bd01106d7 (bug 1805378)
Backed out changeset 9a1e0541748a (bug 1805378)
Backed out changeset 926ce2f2d51f (bug 1805378)
2022-12-19 23:29:20 +02:00
Alexandre Poirot 9f8dbaf1d5 Bug 1805378 - [devtools] Automatically start the worker on first WorkerDispatcher invoke/task call. r=bomsy
Because of this, we have to now pass the worker URL via WorkerDispatcher constructor.
Doing this should help then extend WorkerDispatcher instead of manually instantiating it.

About browser_jsterm_hide_when_devtools_chrome_enabled_false.js, as the SourceMapLoader
is now started lazily, the worker is no longer started during this test
and so we no longer have to wait for it.

And browser_jsterm_await_paused.js was failing because we resumed too quickly.
I added some code to better wait for awaitExpression full evaluation.

Differential Revision: https://phabricator.services.mozilla.com/D164547
2022-12-19 17:00:36 +00:00
Alexandre Poirot 1f395e8c48 Bug 1805378 - [devtools] Convert WorkerDispatcher to ES Class. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D164546
2022-12-19 17:00:36 +00:00
Alexandre Poirot b7a6b93267 Bug 1805378 - [devtools] Remove unused getNextStep method from the parser worker. r=bomsy
As well as its leftover dependencies.

Differential Revision: https://phabricator.services.mozilla.com/D164544
2022-12-19 17:00:35 +00:00
Alexandre Poirot 81c03b3484 Bug 1801695 - [devtools] Use ChromeWorker for devtools frontend workers. r=bomsy
This allows using a regular worker and no longer have to be related to any particular document.

Differential Revision: https://phabricator.services.mozilla.com/D162964
2022-12-12 13:15:51 +00:00