mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-09 21:28:43 +08:00
This allows us to test the wasmparser_worker implementation in isolation in unit tests, while extracting out the worker integration into a separate file. A follow-up CL will migrate the wasmparser_worker to use URL-based worker construction, which will allow us to remove the wasmparser_worker-entrypoint in front_end/ and cleanup the RuntimeInstantiator.js logic. R=jacktfranklin@chromium.org,bmeurer@chromium.org Bug: 1009443 Change-Id: I77d04ab870b38ec9f9209c1a156c123c941d169b Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2581927 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
61 lines
1.9 KiB
Plaintext
61 lines
1.9 KiB
Plaintext
# Copyright 2020 The Chromium Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
import("../../../all_devtools_modules.gni")
|
|
import("../../../third_party/typescript/typescript.gni")
|
|
import("./copy.gni")
|
|
import("./vars.gni")
|
|
|
|
template("devtools_module") {
|
|
_typescript_target_name = target_name + "-typescript"
|
|
_typescript_target_dep = ":$_typescript_target_name"
|
|
|
|
ts_library(_typescript_target_name) {
|
|
forward_variables_from(invoker,
|
|
[
|
|
"sources",
|
|
"deps",
|
|
])
|
|
|
|
# To make sure that this target can be depended upon by other TypeScript targets,
|
|
# we have to name it the `target_name`. However, we can't name this `ts_library` the
|
|
# `target_name`, as the buildgraph requires the `copy_gen__to_resources` to happen *after*
|
|
# `ts_library` is finished.
|
|
typescript_config_name = invoker.target_name
|
|
}
|
|
|
|
if (is_debug) {
|
|
copy_gen_to_resources(target_name) {
|
|
sources = filter_include(get_target_outputs(_typescript_target_dep),
|
|
[
|
|
"*.js",
|
|
"*.map",
|
|
])
|
|
|
|
public_deps = [ _typescript_target_dep ]
|
|
|
|
visibility = invoker.visibility + [ ":*" ]
|
|
}
|
|
|
|
_target_outputs = get_target_outputs(":" + target_name + "-copy")
|
|
_filtered_target_outputs =
|
|
filter_exclude(
|
|
filter_exclude(_target_outputs, generated_typescript_modules),
|
|
[ "*.map" ])
|
|
assert(
|
|
_filtered_target_outputs == [],
|
|
"$_filtered_target_outputs are not listed in all_typescript_module_sources")
|
|
} else {
|
|
group(target_name) {
|
|
public_deps = [ _typescript_target_dep ]
|
|
|
|
visibility = invoker.visibility + [ ":*" ]
|
|
}
|
|
}
|
|
}
|
|
|
|
set_defaults("devtools_module") {
|
|
visibility = []
|
|
}
|