Commit Graph
4 Commits
Author SHA1 Message Date
Paul Lewis 26afc1e4f9 Adds migration script for refs
This script expects that -legacy.js files are in place for a
given module. So, for example, if migrating front_end/search
one would run move-side-effects-to-legacy for search, then follow
that with this script, replace-internal-references, which will
step through the files in front_end/search and update all globals
to refer to imports.

This script also supports cross-module rewrites, such that if a
namespace is passed through, the -legacy.js file for the namespace
will be loaded instead and used for the replacements.

Bug: 1006759
Change-Id: I7af5e1343a028aed82d5c3f536be886011cf9a2c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1958525
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2019-12-10 13:47:05 +00:00
Paul Lewis da0fab38e1 Adds migration script to moving side-effects to legacy file
TBR=tvanderlippe@chromium.org
Bug: 1006759
Change-Id: I145e029b427900995468e86a522085553cb5c1cf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1953769
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2019-12-09 10:59:22 +00:00
Tim van der Lippe 5e2f45a379 Add script to remove unused globals
It Traverses all expression statements that put stuff on the global
scope and checks if it is only used once (e.g. in that particular
assignment). Anything that is only exported but never used is deleted.

This works for extensions declared in the module.json as well.

Change-Id: Ie3d9759da8593f8c66f1c12ba2e8ee1724f240d6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1942289
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-28 17:40:34 +00:00
Tim van der Lippe 29011f8a88 Introduce migration script for JavaScript modules
Example invocation of the script:

./refactor-folder-to-es-modules.sh ui

It will consequently refactor all files in the ui folder to JavaScript
modules. It will also update the BUILD.gn variables to remove the
references from the old all_devtools_files into the new modules
variables.

Change-Id: I35ad6360b15d1aff250afffc8a28774c4e8cc1ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808867
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#697602}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6d48f36bc75c558ac1ee899ccb20877b800e9410
2019-09-18 14:33:56 +00:00