angular/packages/compiler-cli/test
Paul Gschwendtner b46b3cf43e refactor: remove remaining dynamic require usages in package output (#43431)
Removes the remaining usages of dynamic require statements in the
package output. Since we declare all shipped packages as strict ESM,
we cannot use dynamic require statements anymore. This commit switches
these usages to actual `import` statements.

Note: Tsickle continues to remain an optional dependency since bundling
does not work with its UMD package output. Also tsickle is rarely used by
consumers, if at all, so bundling does not really provide any significant
value. To continue keeping tsickle optional (since it's still needed by the
`annotateForClosureCompiler` option which is also respected in ngtsc), we
pass-through a tsickle instance as a parameter to `main`. This allows us to
keep the compile functions synchronous without having to refactor the majority
of the watch compilation code, and majority of tests for ngc, ngtsc.

Consumers (like the `ngc` bin entry-point) can then load tsickle based on their
module format. e.g. tsickle can be imported through `require` to keep everything
sync, but in ESM, the dynamic import can be used beforehand to pass `tsickle` to
the `main` function. We can revisit this in the future but for now this does the
trick without exceeding the scope of this commit..

PR Close #43431
2021-10-01 18:28:45 +00:00
..
compliance refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
diagnostics refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
metadata refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
ngtsc refactor: remove remaining dynamic require usages in package output (#43431) 2021-10-01 18:28:45 +00:00
transformers refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
BUILD.bazel refactor: remove remaining dynamic require usages in package output (#43431) 2021-10-01 18:28:45 +00:00
extract_i18n_spec.ts refactor(compiler): element.sourceSpan should span the outerHTML (#38581) 2020-09-02 14:47:31 -07:00
mocks.ts refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
ngc_spec.ts refactor: remove remaining dynamic require usages in package output (#43431) 2021-10-01 18:28:45 +00:00
perform_compile_spec.ts refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
perform_watch_spec.ts refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
test_support.ts refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
typescript_support_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00