Commit Graph
11 Commits
Author SHA1 Message Date
Tim van der Lippe 779b46bac3 Inline and remove peekLast()
In the future we can use `.at()`, but that has not been shipped yet.

R=szuend@chromium.org

Bug: 1050549
Change-Id: I89e760db277ffb91bfbba93106e6e11d3ece91d6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2624711
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2021-01-13 14:09:52 +00:00
Tim van der Lippe 40440d9840 Add tests for HTMLFormatter
R=jacktfranklin@chromium.org

Bug: 1024752
Change-Id: I92dedd0efd1d3ca1574b21eecd13eef6cc8126bb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2581919
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-12-09 16:47:27 +00:00
Tim van der Lippe 2e38eeaf9f Remove all comments with only the unrestricted annotation
The unrestricted annotation is Closure-specific and can be removed.
This patch removes all comments with only the unrestricted annotation
in them.

R=szuend@chromium.org

No-Presubmit: True
Bug: 1011811
Change-Id: Iba0723644f53f5307c3077d341271af86becc32a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2569758
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-12-02 15:25:32 +00:00
Paul Lewis 4290f3d153 [TypeScript] Fix formatter_worker/HTMLFormatter types
R=tvanderlippe@chromium.org

Bug: 1011811, 1098730
Change-Id: I6c3c092f1ffb2f4bbb038802aba3193acc6c7c8f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2296421
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-14 19:02:22 +00:00
Tim van der Lippe 70ada5b1cf Prepare formatter_worker/ for typescriptification
This adds the existing files to the `ts_library`. As such, we can
parallelize the typescriptication work on these files, without
causing merge conflicts

It also adds several `.d.ts` files to the codemirror package, as
we are using these for typescript compilation.

R=aerotwist@chromium.org,jacktfranklin@chromium.org

Bug: 1011811, 1098730
Change-Id: Ie4e184ce1462fc8486e3b0139c3bb9bb8fcf5fae
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2266997
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-06-25 14:37:23 +00:00
Simon Zünd da7058fcd6 Move String#isWhitespace from the String prototype to a utiltiy function
R=jacktfranklin@chromium.org

Bug: chromium:1050549
Change-Id: Ief2e7c72d6faecd3849e66cfc7300891e22055b3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2080372
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-02 09:30:13 +00:00
Tim van der Lippe d3c3b72021 Migrate formatter_worker/ to ESM internally
Bug: 1006759
Change-Id: I895bd53ff3f5381cc7e159f0813b426f34e8fef7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1991638
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-01-10 13:59:37 +00:00
Tim van der Lippe fd90361fad Rollup workers and migrate dependent modules
Since workers do not support modules [1], it is not possible to
currently import any ESM DevTools module. To be able to migrate
text_utils/ to ESM, we would need to duplicate a large portion of
text_utils/, which would be unmaintainable.

We already had the same situation when we migrated platform/ to ESM and
decided to copy the relevant functions, but this time around that is no
longer an option.

Thus, the 2 workers (heap_snapshot_worker and formatter_worker) are now
being bundled on build time. This means that in a release build, the
respective entrypoints are bundled and inserted in the output.

To bundle, we use `rollup`, which is a bundler only concerned with
rolling up ES modules. All other functionality of rollup (such as
tree-shaking) is unused. We can revisit later if we need a bundler for
the rest of devtools, but since we are in active migration to ESM that
is infeasible at this point in time.

As part of this CL, the following folders are migrated to ESM:
- cm_headless/
- formatter_worker/
- heap_snapshot_model/
- heap_snapshot_worker/
- text_utils/

Since text_utils is also an autostart module for the shell, this is the
only module that is imported from root.js.

Some of these modules also include files that are annotated with
skip_compilation and thus run with dummy files during Closure
compilation.

Note that, because of the usages of import-statements in the workers
and the blocking bug [1], the workers are generated even when Chromium
is built with `debug_devtools=true`.

Since heap_snapshot_model/ also used in the profiler, we have to eagerly
load this module in root.js. Once all other dependencies of the profiler
have been migrated to ESM, we can remove this import-statement.

[1]: crbug.com/680046

Bug:1013129,1006759
Change-Id: I4c03c7b8a1f351ae9693cbcd922412083dd34bba
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1883707
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-07 11:55:25 +00:00
Tim van der Lippe 1d6e57a0e3 Always add braces to single-line if-statements
The Chromium/Google style guides does not enforce curly braces for
single-line if-statements, but does strongly recommend doing so. Adding
braces will improve code readability, by visually separating code
blocks. This will also prevent issues where accidental additions are
pushed to the "else"-clause instead of in the if-block.

This CL also updates the presubmit `eslint` to run the fix with the
correct configuration. It will now fix all issues it can fix.

Change-Id: I4b616f21a99393f168dec743c0bcbdc7f5db04a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821526
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jeff Fisher <jeffish@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#701070}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7e0bdbe2d7f9fc2386bfaefda3cc29c66ccc18f9
2019-09-30 11:55:34 +00:00
Joel Einbinder 67f34359dd DevTools: Pretty print scripts with "text/javascript" in html files
We were not considering that type attributes in scripts could be
wrapped in quotes.

Change-Id: Id2fd4859c1e1a68bd28bebe6fea46a62b58e417a
Reviewed-on: https://chromium-review.googlesource.com/1043463
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#556187}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 795391700f20cfaafb616c59e0cb3df042b6f64a
2018-05-04 21:06:13 +00:00
Blink Reformat 4c46d0969f The Great Blink mv for source files, part 2.
Move and rename files.

NOAUTOREVERT=true
NOPRESUBMIT=true
NOTREECHECKS=true
Bug: 768828
TBR=darin@chromium.org
NOTRY=true

Change-Id: I66d3b155808bc5bdbf237b80208e1e552bcf7f28
Reviewed-on: https://chromium-review.googlesource.com/1001153
Reviewed-by: Blink Reformat <blink-reformat@chromium.org>
Commit-Queue: Blink Reformat <blink-reformat@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#549061}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0aee4434a4dba42a42abaea9bfbc0cd196a63bc1
2018-04-07 15:32:37 +00:00