d5b87d32b0
Currently Ivy stores the element attributes into an array above the component def and passes it into the relevant instructions, however the problem is that upon minification the array will get a unique name which won't compress very well. These changes move the attributes array into the component def and pass in the index into the instructions instead. Before: ``` const _c0 = ['foo', 'bar']; SomeComp.ngComponentDef = defineComponent({ template: function() { element(0, 'div', _c0); } }); ``` After: ``` SomeComp.ngComponentDef = defineComponent({ consts: [['foo', 'bar']], template: function() { element(0, 'div', 0); } }); ``` A couple of cases that this PR doesn't handle: * Template references are still in a separate array. * i18n attributes are still in a separate array. PR Close #32798 |
||
---|---|---|
.. | ||
BUILD.bazel | ||
README.md | ||
mock_compile.ts | ||
mock_compiler_spec.ts | ||
r3_compiler_compliance_spec.ts | ||
r3_view_compiler_binding_spec.ts | ||
r3_view_compiler_di_spec.ts | ||
r3_view_compiler_directives_spec.ts | ||
r3_view_compiler_i18n_spec.ts | ||
r3_view_compiler_input_outputs_spec.ts | ||
r3_view_compiler_listener_spec.ts | ||
r3_view_compiler_providers_spec.ts | ||
r3_view_compiler_spec.ts | ||
r3_view_compiler_styling_spec.ts | ||
r3_view_compiler_template_spec.ts |
README.md
Tests in this directory should be run with:
yarn bazel test --define=compile=aot packages/compiler-cli/test/compliance:compliance