We recently reworked our `ng_rollup_bundle` rule to no longer output
ESM5 and to optimize applications properly (previously applications were
not optimized properly due to incorrect build optimizer setup).
This change meant that a lot of symbols have been removed from the
golden correctly. See: fd65958b88
Unfortunately though, a few symbols have been accidentally removed
because they are now part of the bundle as ES2015 classes which the
symbol extractor does not pick up. This commit fixes the symbol
extractor to capture ES2015 classes. We also update the golden to
reflect this change.
PR Close#38093
In 7cb8396, we improved the symbol test to remove suffixes from
the output, so "CIRCULAR$1" became "CIRCULAR". However, the logic
that checked for extra symbols depended on each symbol being unique.
If multiple symbols with the same name were added (e.g. pulled in
from separate files), they would be added to the map as "extras",
even if they were marked as expected in the golden file.
This commit updates the symbol checking logic to take multiple
symbols with the same name into account.
Closes#28406
PR Close#28459
The js_expected_symbol_test implementation extracts symbols names
from a rollup iife bundle. Previously, it only handled the case
with a simple 'var bundle = ...;' statement.
Sometimes, rollup produces a more complex bundle, where the 'bundle'
variable is not the only top-level variable declared in the same
declaration statement. This commit patches the symbol exctractor
to support this more complex case.
Additionally, when the symbol test fails, it prints a command to
accept the symbol diff. This command needs to include the
--define=compile flag to ensure the diff is applied in the same
compile mode as the test was run.
PR Close#24677