Skip to content
Permalink
Branch: master
Commits on Apr 19, 2019
  1. fix(ivy): allow TestBed.createComponent to create components in isola…

    AndrewKushnir authored and benlesh committed Apr 19, 2019
    …tion (#29981)
    
    Prior to this change, components created via TestBed.createComponent in the same test were placed into the same root context, which caused problems in conjunction with fixture.autoDetectChanges usage in the same test. Specifically, change detection was triggered immediately for created component (starting from the 2nd one) even if it was not required/desired. This commit makes Ivy and VE behavior consistent: now every component created via TestBed.createComponent is isolated from each other. Current solution uses host element id naming convention, which is not ideal, but helps avoid public API surface changes at this point (we might revisit this approach later).
    
    Note: this commit also adds extra tests to verify bootstrap and change detection behavior in case of multiple components in `bootstrap` array in @NgModule, to make sure this behavior is aligned between Ivy and VE.
    
    PR Close #29981
Commits on Apr 17, 2019
  1. fix(ivy): make metadata calls side-effect free in Closure (#29947)

    AndrewKushnir authored and benlesh committed Apr 17, 2019
    When compiling Angular classes, the compiler may decide to append statements with specific metadata that's only required for JIT. This includes things like decorator metadata as well as NgModule scope data.
    
    When the compiler generates such calls, the call sites are marked with Uglify's PURE annotation, so the optimizer will remove them in production builds. However, Closure does not have the PURE (or similar) annotation. We have a utility function `noSideEffects` in the runtime for this purpose. This commit wraps `setClassMetadata` and `setNgModuleScope` function bodies in `noSideEffect` closures to allow Closure remove them.
    
    PR Close #29947
Commits on Apr 16, 2019
  1. fix(ivy): multi provider override support in TestBed (#29919)

    AndrewKushnir authored and alxhub committed Apr 16, 2019
    Overriding multi provider values (providers with `multi: true` flag) via TestBed require additional handling: all existing multi-provider values for the same token should be removed from the override list, so that they are not included into the final value of a given provider. This commit adds this logic to make sure we handle multi providers correctly.
    
    PR Close #29919
Commits on Apr 12, 2019
  1. fix(ivy): keep i18n-annotated attributes in element attribute list (#…

    AndrewKushnir authored and alxhub committed Apr 11, 2019
    …29856)
    
    Prior to this change, element attributes annotated with i18n- prefix were removed from element attribute list and processed separately by i18n-specific logic. This behavior is causing issues with directive matching, since attributes are not present in the list of attrs for matching purposes. This commit updates i18n logic to retain attributes in the main attribute list, thus allowing directive matching logic to work correctly.
    
    PR Close #29856
Commits on Mar 28, 2019
  1. fix(ivy): allow TestBed to recompile AOT-compiled components in case …

    AndrewKushnir authored and mhevery committed Mar 27, 2019
    …of template overrides (#29555)
    
    Prior to this change, recompilation of AOT-compiled components in TestBed may fail when template override is requested. That was happening due to the `styleUrls` field defined for a Component, thus switching its state to "requires resolution" (i.e. having external resources) at compile time. This change avoids this issue by storing styles and resetting `styleUrls` field before recompilation. Once compilation is done, saved styles are patched back onto Component def.
    
    PR Close #29555
Commits on Mar 27, 2019
  1. fix(ivy): TestBed rewrite to avoid unnecessary recompilations (#29483)

    AndrewKushnir authored and mhevery committed Mar 21, 2019
    Prior to this change, Ivy version of TestBed was not designed to support the logic to avoid recompilations - most of the Components/Directives/Pipes were recompiled for each test, even if there were no overrides defined for a given Type. Additional checks to avoid recompilation were introduced in one of the previous commits (0244a24), but there were still some corner cases that required attention. In order to support the necessary logic better, Ivy TestBed was rewritten/refactored. Main results of this rewrite are:
    
    * no recompilation for Components/Directives/Pipes without overrides
    * the logic to restore state between tests (isolate tests) was improved
    * transitive scopes calculation no longer performs recompilation (it works with compiled defs)
    
    As a result of these changes we see reduction in memory consumption (3.5-4x improvement) and pefromance increase (4-4.5x improvement).
    
    PR Close #29483
Commits on Mar 19, 2019
  1. feat(ivy): avoid unnecessary recompilations in TestBed (#29294)

    AndrewKushnir authored and matsko committed Mar 11, 2019
    Prior to this change, we always recompile all Components/Directives/Pipes even if they were AOT-compiled and had no overrides. This is causing problems in case we try to recompile a Component with "templateUrl" or "styleUrls" (which were already resolved in case of AOT) and generally this unnecessary work that TestBed was doing is not required. This commit adds extra logic to check whether a Component/Directive/Pipe already have compiled NG def (like ngComponentDef) and whether there are no overrides present - in this case recompilation is skipped. Recompilation is also skipped in case a Component/Directive has only Provider overrides - in this situation providers resolver function is patched to reflect overrides. Provider overrides are very common in g3, thus this code path ensures no full recompilation.
    
    PR Close #29294
Commits on Mar 12, 2019
  1. fix(ivy): use default selector for Components if selector is empty (#…

    AndrewKushnir authored and kara committed Mar 12, 2019
    …29239)
    
    Prior to this change default selector for Components was not applied in case selector is missing or defined as an empty string. This update aligns this behavior between Ivy and VE: now default selector is used for Components when it's needed. Directives with empty selector are not allowed and trigger a compile-time error in both Ivy and VE.
    
    PR Close #29239
Commits on Mar 11, 2019
  1. fix(ivy): handle aliased Angular decorators (#29195)

    AndrewKushnir authored and kara committed Mar 8, 2019
    Prior to this change the code didn't take into account the fact that decorators can be aliases while importing into a script. As a result, these decorators were not recognized by Angular and various failures happened because of that. Now we take aliases into account and resolve decorator name properly.
    
    PR Close #29195
Commits on Mar 7, 2019
  1. fix(ivy): move i18n instructions after listener ones (#29173)

    AndrewKushnir authored and kara committed Mar 7, 2019
    Prior to this commit, i18n instructions (i18n, i18nStart) were generated before listener instructions. As a result, event listeners were attached to the wrong element (text node, not the parent element). This change updates the order of instructions and puts i18n ones after listeners, to make sure listeners are attached to the right elements.
    
    PR Close #29173
Commits on Mar 6, 2019
  1. fix(ivy): properly detect "inputs" and "outputs" field names that sho…

    AndrewKushnir committed Mar 6, 2019
    …uld be wrapped in quotes (#29126)
    
    Prior to this change, the RegExp that was used to check for dashes in field names used "g" (global) flag that retains lastIndex, which might result in skipping some fields that should be wrapped in quotes (since lastIndex advanced beyond the next "-" location). This commit removes this flag and updates the test to make sure there are no regressions.
    
    PR Close #29126
  2. release: cut the v8.0.0-beta.7 release

    AndrewKushnir committed Mar 6, 2019
  3. docs: release notes for the v7.2.8 release

    AndrewKushnir committed Mar 6, 2019
  4. fix(ivy): avoid innerHTML usage in exports test (to make it work in I…

    AndrewKushnir committed Mar 6, 2019
    …E11) (#29127)
    
    Some tests in exports spec rely on the exact output of innerHTML. In IE11 the order of attributes might change, thus causing tests to fail (in case an element contains more than one attribute). This commit avoids innerHTML usage and performs the necessary checks via element properties.
    
    PR Close #29127
Commits on Mar 4, 2019
  1. fix(ivy): wrap "inputs" and "outputs" keys if they contain unsafe cha…

    AndrewKushnir committed Feb 22, 2019
    …racters (#28919)
    
    Prior to this change, keys in "inputs" and "outputs" objects generated by compiler were not checked against unsafe characters. As a result, in some cases the generated code was throwing JS error. Now we check whether a given key contains any unsafe chars and wrap it in quotes if needed.
    
    PR Close #28919
Commits on Mar 2, 2019
  1. fix(ivy): change for-of to forEach for pipes represented with Map (#2…

    AndrewKushnir committed Mar 2, 2019
    …9068)
    
    This commit fixes the problem with using for-of for pipes represented with Map (by replacing it with forEach operation).
    
    PR Close #29068
Commits on Feb 27, 2019
  1. fix(ivy): avoid missing imports for types that can be represented as …

    AndrewKushnir committed Feb 23, 2019
    …values (#28941)
    
    Prior to this change, TypeScript stripped out some imports in case we reference a type that can be represented as a value (for ex. classes). This fix ensures that we use correct symbol identifier, which makes TypeScript retain the necessary import statements.
    
    PR Close #28941
  2. fix(ivy): process property bindings in i18n blocks similar to non-i18…

    AndrewKushnir authored and benlesh committed Feb 25, 2019
    …n bindings (#28969)
    
    Prior to this change i18n block bindings were converted to Expressions right away (once we first access them), when in non-i18n cases we processed them differently: the actual conversion happens at instructions generation. Because of this discrepancy, the output for bindings in i18n blocks was generated incorrectly (with invalid indicies in pipeBindN fns and invalid references to non-existent local variables). Now the bindings processing is unified and i18nExp instructions should contain right bind expressions.
    
    PR Close #28969
  3. fix(ivy): avoid duplicate i18n consts to be present in generated outp…

    AndrewKushnir authored and benlesh committed Feb 25, 2019
    …ut (#28967)
    
    Prior to this change, the logic that outputs i18n consts (like `const MSG_XXX = goog.getMsg(...)`) didn't have a check whether a given const that represent a certain i18n message was already included into the generated output. This commit adds the logic to mark corresponding i18n contexts after translation was generated, to avoid duplicate consts in the output.
    
    PR Close #28967
Commits on Feb 21, 2019
  1. fix(ivy): allow HTML comments to be present inside <ng-content> (#28849)

    AndrewKushnir authored and IgorMinar committed Feb 20, 2019
    Prior to this change presence of HTML comments inside <ng-content> caused compiler to throw an error that <ng-content> is not empty. Now HTML comments are not considered as a meaningful content, thus no error is thrown. This behavior is now aligned in Ivy/VE.
    
    PR Close #28849
  2. fix(ivy): correct absolute path processing for templateUrl and styleU…

    AndrewKushnir authored and IgorMinar committed Feb 18, 2019
    …rls (#28789)
    
    Prior to this change absolute file paths (like `/a/b/c/style.css`) were calculated taking current component file location into account. As a result, absolute file paths were calculated using current file as a root. This change updates this logic to ignore current file path in case of absolute paths.
    
    PR Close #28789
  3. fix(ivy): check the presence of .css resource for styleUrls (#28770)

    AndrewKushnir authored and IgorMinar committed Feb 15, 2019
    Prior to this change, Ivy and VE CSS resource resolution was different: in addition to specified styleUrl (with .scss, .less and .styl extensions), VE also makes an attempt to resolve resource with .css extension. This change introduces similar logic for Ivy to make sure Ivy behavior is backwards compatible.
    
    PR Close #28770
  4. fix(ivy): restore @fileoverview annotations for Closure (#28723)

    AndrewKushnir authored and IgorMinar committed Feb 14, 2019
    Prior to this change, the @fileoverview annotations added by users in source files or by tsickle during compilation might have change a location due to the fact that Ngtsc may prepend extra imports or constants. As a result, the output file is considered invalid by Closure (misplaced @fileoverview annotation). In order to resolve the problem we relocate @fileoverview annotation if we detect that its host node shifted.
    
    PR Close #28723
Commits on Feb 13, 2019
  1. fix(ivy): set proper implementation for module injector (#28667)

    AndrewKushnir authored and mhevery committed Feb 12, 2019
    Prior to this change we used current injector implementation for module injector, which was causing problems and produces circular dependencies in case the same token is referenced (with @SkipSelf flag) in the `deps` array. The origin of the problem was that once `directiveInject` implementation becomes active, it was used for module injector as well, thus searching deps in Component/Directive DI scope. This fix sets `injectInjectorOnly` implementation for module injector to resolve the problem.
    
    PR Close #28667
  2. refactor(ivy): combine contentQueries and contentQueriesRefresh funct…

    AndrewKushnir authored and mhevery committed Feb 2, 2019
    …ions (#28503)
    
    Prior to this update we had separate contentQueries and contentQueriesRefresh functions to handle creation and update phases. This approach was inconsistent with View Queries, Host Bindings and Template functions that we generate for Component/Directive defs. Now the mentioned 2 functions are combines into one (contentQueries), creation and update logic is separated with RenderFlags (similar to what we have in other generated functions).
    
    PR Close #28503
Commits on Feb 12, 2019
  1. fix(ivy): mark query test as modified in Ivy (#28660)

    AndrewKushnir authored and mhevery committed Feb 12, 2019
    Due to the fact that host nodes no longer match in ContentChild queries in Ivy, we disable test that was enabled previously in other commit.
    
    PR Close #28660
Commits on Feb 11, 2019
  1. feat(ivy): allow non-unique #localRefs to be defined in a template (#…

    AndrewKushnir authored and mhevery committed Feb 8, 2019
    …28627)
    
    Prior to this change in Ivy we had strict check that disabled non-unique #localRefs usage within a given template. While this limitation was technically present in View Engine, in many cases View Engine neglected this restriction and as a result, some apps relied on a fact that multiple non-unique #localRefs can be defined and utilized to query elements via @ViewChild(ren) and @ContentChild(ren). In order to provide better compatibility with View Engine, this commit removes existing restriction.
    
    As a part of this commit, are few tests were added to verify VE and Ivy compatibility in most common use-cases where multiple non-unique #localRefs were used.
    
    PR Close #28627
Commits on Feb 8, 2019
  1. test: update Material blocklist (#28605)

    AndrewKushnir authored and mhevery committed Feb 7, 2019
    This commit updates Material blocklist, which was changed as a result of a couple Material-related fixes merged into master.
    
    PR Close #28605
Commits on Feb 7, 2019
  1. fix(ivy): extended next pointer lookup while traversing tNode tree (#…

    AndrewKushnir authored and mhevery committed Feb 2, 2019
    …28533)
    
    Prior to this change we only checked whether current lView has a next pointer while traversing tNode tree. However in some cases this pointer can be undefined and we need to look up parents chain to find suitable next pointer. This commit adds the logic of searching for the next pointer taking parents chain into account.
    
    PR Close #28533
Commits on Feb 6, 2019
  1. fix(ivy): sanitize external i18n ids before generating const names (#…

    AndrewKushnir authored and matsko committed Jan 12, 2019
    …28522)
    
    Prior to this change there was no i18n id sanitization before we output goog.getMsg calls. Due to the fact that message ids are used as a part of const names, some characters were bcausing issues while executing generated code. This commit adds sanitization to i18n ids used to generate i18n-related consts.
    
    PR Close #28522
  2. fix(ivy): proper component resolution in case of inheritance (#28439)

    AndrewKushnir authored and matsko committed Jan 30, 2019
    Ivy allows Components to extend Directives (but not the other way around) and as a result we may have Component and Directive annotations present at the same time. The logic that resolves annotations to pick the necessary one didn't take this into account and as a result Components were recognized as Directives (and vice versa) in case of inheritance. This change updates the resolution logic by picking known annotation that is the nearest one (in inheritance tree) and compares it with expected type. That should help avoid mis-classification of Components/Directives during resolution.
    
    PR Close #28439
Commits on Feb 1, 2019
  1. refactor(ivy): create an Ivy version of tree-shakable providers test (#…

    AndrewKushnir authored and matsko committed Jan 31, 2019
    …28477)
    
    Due to the fact that the test in 'ng_module_integration_spec.ts' relied on internal VE data structures (the '_def' field) to verify the state and the structure has changed in Ivy, this commit adds an Ivy version of the same test.
    
    PR Close #28477
Commits on Jan 30, 2019
  1. fix(ivy): verify bootstrapped types are Components (#28386)

    AndrewKushnir authored and jasonaden committed Jan 26, 2019
    Prior to this change we didn't verify types passed to bootstrap as a part of NgModule semantics verification. Now we check whether all types passed to bootstrap are actually Components.
    
    PR Close #28386
  2. fix(ivy): update token used for fakeAsync test (#28383)

    AndrewKushnir authored and jasonaden committed Jan 26, 2019
    This commit updates the token used in fakeAsync test to the one available in both VE and R3 TestBeds. The goal of the test is to verify that fakeAsync works with inject function, so the actual token that is used for a test is irrelevant in that case. The logic to retrieve tokens from compiler injector (that the comment in "fixmeIvy" refers to) was implemented in PR #28196.
    
    PR Close #28383
  3. refactor(ivy): minor refactoring of Host Bindings function generation (

    AndrewKushnir authored and jasonaden committed Jan 25, 2019
    …#28379)
    
    Prior to this change, generation of host bindings and host styles was guarded by the "if" statement, which always returned true. Enforcing more strict check for bindings length broke some tests, since host styling instructions generation were inside the same "if" block. This update decouples bindings instruction generation from styling instructions, which makes it less error prone.
    
    PR Close #28379
Older
You can’t perform that action at this time.