refactor(compiler): compile{Component,Directive} take only local information (#23545)
Previously, the compileComponent() and compileDirective() APIs still required the output of global analysis, even though they only read local information from that output. With this refactor, compileComponent() and compileDirective() now define their inputs explicitly, with the new interfaces R3ComponentMetadata and R3DirectiveMetadata. compileComponentGlobal() and compileDirectiveGlobal() are introduced and convert from global analysis output into the new metadata format. This refactor also splits out the view compiler into separate files as r3_view_compiler_local.ts was getting unwieldy. Finally, this refactor also splits out generation of DI factory functions into a separate r3_factory utility as the logic is utilized between different compilers. PR Close #23545
This commit is contained in:

committed by
Igor Minar

parent
d01ec03f54
commit
b0eca85e51
@ -2021,6 +2021,7 @@ describe('ngc transformer command-line', () => {
|
||||
const exitCode = main(['-p', path.join(basePath, 'tsconfig.json')]);
|
||||
expect(exitCode).toBe(0, 'Compile failed');
|
||||
expect(emittedFile('hello-world.js')).toContain('ngComponentDef');
|
||||
expect(emittedFile('hello-world.js')).toContain('HelloWorldComponent_Factory');
|
||||
});
|
||||
|
||||
it('should emit an injection of a string token', () => {
|
||||
|
Reference in New Issue
Block a user