mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
90c2088679
This is basically a pre-step for combining devmode and prodmode into a
single compilation. We are already achieving this now, and can claim
with confidence that we reduced possible actions by half. This is
especially important now that prodmode is used more often, but rules
potentially still using the devmode ESM sources. We can avoid double
compilations (which existed before the whole ESM migration too!).
We will measure this more when we have more concrete documentation
of the changes & a better planning document.
Changes:
* ts_library will no longer generate devmode `d.ts`. Definitions are
generated as part of prodmode. That way only prodmode can be exposed
via providers.
* applied the same to `ng_module`.
* updates migrations to bundle because *everything* using `ts_library`
is now ESM. This is actually also useful in the future if
schematics rely on e.g. the compiler.
* updates schematics for localize to also bundle. similar reason as
above.
PR Close #48521
40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
# Copyright Google LLC All Rights Reserved.
|
|
#
|
|
# Use of this source code is governed by an MIT-style license that can be
|
|
# found in the LICENSE file at https://angular.io/license
|
|
|
|
load("//tools:defaults.bzl", "nodejs_binary", "nodejs_test")
|
|
|
|
"""
|
|
This test verifies that a set of top level symbols from a javascript file match a gold file.
|
|
"""
|
|
|
|
def js_expected_symbol_test(name, src, golden, data = [], **kwargs):
|
|
"""This test verifies that a set of top level symbols from a javascript file match a gold file.
|
|
"""
|
|
all_data = data + [
|
|
Label("//tools/symbol-extractor:lib"),
|
|
Label("@npm//typescript"),
|
|
src,
|
|
golden,
|
|
]
|
|
entry_point = "//tools/symbol-extractor:cli.ts"
|
|
|
|
nodejs_test(
|
|
name = name,
|
|
data = all_data,
|
|
entry_point = entry_point,
|
|
tags = kwargs.pop("tags", []) + ["symbol_extractor"],
|
|
templated_args = ["$(rootpath %s)" % src, "$(rootpath %s)" % golden],
|
|
**kwargs
|
|
)
|
|
|
|
nodejs_binary(
|
|
name = name + ".accept",
|
|
testonly = True,
|
|
data = all_data,
|
|
entry_point = entry_point,
|
|
templated_args = ["$(rootpath %s)" % src, "$(rootpath %s)" % golden, "--accept"],
|
|
**kwargs
|
|
)
|