@angular/core 17.3.0-rc.0 → 17.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/esm2022/src/application/application_ref.mjs +14 -11
  2. package/esm2022/src/authoring/input/input.mjs +4 -1
  3. package/esm2022/src/authoring/output/output.mjs +2 -2
  4. package/esm2022/src/authoring/output/output_emitter_ref.mjs +14 -3
  5. package/esm2022/src/authoring/queries.mjs +7 -1
  6. package/esm2022/src/change_detection/scheduling/zoneless_scheduling.mjs +1 -1
  7. package/esm2022/src/change_detection/scheduling/zoneless_scheduling_impl.mjs +10 -4
  8. package/esm2022/src/core_private_export.mjs +2 -3
  9. package/esm2022/src/defer/instructions.mjs +2 -2
  10. package/esm2022/src/di/contextual.mjs +9 -3
  11. package/esm2022/src/event_emitter.mjs +6 -7
  12. package/esm2022/src/hydration/annotate.mjs +4 -2
  13. package/esm2022/src/hydration/api.mjs +27 -2
  14. package/esm2022/src/hydration/cleanup.mjs +18 -2
  15. package/esm2022/src/hydration/error_handling.mjs +6 -3
  16. package/esm2022/src/hydration/interfaces.mjs +1 -1
  17. package/esm2022/src/hydration/node_lookup_utils.mjs +59 -39
  18. package/esm2022/src/hydration/tokens.mjs +6 -1
  19. package/esm2022/src/hydration/utils.mjs +5 -4
  20. package/esm2022/src/i18n/utils.mjs +16 -0
  21. package/esm2022/src/linker/template_ref.mjs +2 -2
  22. package/esm2022/src/render3/after_render_hooks.mjs +11 -8
  23. package/esm2022/src/render3/component_ref.mjs +1 -1
  24. package/esm2022/src/render3/i18n/i18n_apply.mjs +32 -7
  25. package/esm2022/src/render3/i18n/i18n_parse.mjs +50 -16
  26. package/esm2022/src/render3/instructions/control_flow.mjs +4 -2
  27. package/esm2022/src/render3/instructions/element.mjs +5 -3
  28. package/esm2022/src/render3/instructions/element_container.mjs +3 -2
  29. package/esm2022/src/render3/instructions/template.mjs +4 -2
  30. package/esm2022/src/render3/instructions/text.mjs +4 -2
  31. package/esm2022/src/render3/interfaces/i18n.mjs +1 -1
  32. package/esm2022/src/render3/node_manipulation.mjs +6 -2
  33. package/esm2022/src/render3/node_selector_matcher.mjs +37 -51
  34. package/esm2022/src/render3/queue_state_update.mjs +2 -4
  35. package/esm2022/src/render3/util/view_utils.mjs +2 -1
  36. package/esm2022/src/render3/view_manipulation.mjs +2 -2
  37. package/esm2022/src/sanitization/html_sanitizer.mjs +54 -14
  38. package/esm2022/src/version.mjs +1 -1
  39. package/esm2022/testing/src/component_fixture.mjs +11 -66
  40. package/esm2022/testing/src/logger.mjs +3 -3
  41. package/fesm2022/core.mjs +1460 -1264
  42. package/fesm2022/core.mjs.map +1 -1
  43. package/fesm2022/primitives/signals.mjs +1 -1
  44. package/fesm2022/rxjs-interop.mjs +1 -1
  45. package/fesm2022/testing.mjs +11 -66
  46. package/fesm2022/testing.mjs.map +1 -1
  47. package/index.d.ts +96 -12
  48. package/package.json +1 -1
  49. package/primitives/signals/index.d.ts +1 -1
  50. package/rxjs-interop/index.d.ts +1 -1
  51. package/schematics/migrations/block-template-entities/bundle.js +14 -2
  52. package/schematics/migrations/block-template-entities/bundle.js.map +2 -2
  53. package/schematics/migrations/invalid-two-way-bindings/bundle.js +14 -2
  54. package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +2 -2
  55. package/schematics/ng-generate/control-flow-migration/bundle.js +14 -2
  56. package/schematics/ng-generate/control-flow-migration/bundle.js.map +2 -2
  57. package/schematics/ng-generate/standalone-migration/bundle.js +386 -299
  58. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  59. package/testing/index.d.ts +1 -1
  60. package/esm2022/src/is_internal.mjs +0 -15
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.3.0-rc.0
2
+ * @license Angular v17.3.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -2708,6 +2708,15 @@ declare interface DehydratedView {
2708
2708
  * nodes detected in this view at serialization time.
2709
2709
  */
2710
2710
  disconnectedNodes?: Set<number> | null;
2711
+ /**
2712
+ * A mapping from a view to the first child to begin claiming nodes.
2713
+ *
2714
+ * This mapping is generated by an i18n block, and is the source of
2715
+ * truth for the nodes inside of it. Once a view has been hydrated,
2716
+ * the node is removed from the map. The remaining entries indicate
2717
+ * dehydrated nodes that need to be cleaned up.
2718
+ */
2719
+ i18nNodes?: Map<number, RNode>;
2711
2720
  }
2712
2721
 
2713
2722
  /**
@@ -4723,6 +4732,62 @@ declare interface I18nDebug {
4723
4732
  debug?: string[];
4724
4733
  }
4725
4734
 
4735
+ /**
4736
+ * Represents a simple DOM element in a translation, such as `<div>...</div>`
4737
+ */
4738
+ declare interface I18nElementNode {
4739
+ /** The AST node kind */
4740
+ kind: I18nNodeKind.ELEMENT;
4741
+ /** The LView index */
4742
+ index: number;
4743
+ /** The child nodes */
4744
+ children: Array<I18nNode>;
4745
+ }
4746
+
4747
+ /**
4748
+ * Represents an ICU in a translation.
4749
+ */
4750
+ declare interface I18nICUNode {
4751
+ /** The AST node kind */
4752
+ kind: I18nNodeKind.ICU;
4753
+ /** The LView index */
4754
+ index: number;
4755
+ /** The branching cases */
4756
+ cases: Array<Array<I18nNode>>;
4757
+ /** The LView index that stores the active case */
4758
+ currentCaseLViewIndex: number;
4759
+ }
4760
+
4761
+ declare type I18nNode = I18nTextNode | I18nElementNode | I18nICUNode | I18nPlaceholderNode;
4762
+
4763
+ declare const enum I18nNodeKind {
4764
+ TEXT = 0,
4765
+ ELEMENT = 1,
4766
+ PLACEHOLDER = 2,
4767
+ ICU = 3
4768
+ }
4769
+
4770
+ /**
4771
+ * Represents special content that is embedded into the translation. This can
4772
+ * either be a special built-in element, such as <ng-container> and <ng-content>,
4773
+ * or it can be a sub-template, for example, from a structural directive.
4774
+ */
4775
+ declare interface I18nPlaceholderNode {
4776
+ /** The AST node kind */
4777
+ kind: I18nNodeKind.PLACEHOLDER;
4778
+ /** The LView index */
4779
+ index: number;
4780
+ /** The child nodes */
4781
+ children: Array<I18nNode>;
4782
+ /** The placeholder type */
4783
+ type: I18nPlaceholderType;
4784
+ }
4785
+
4786
+ declare const enum I18nPlaceholderType {
4787
+ ELEMENT = 0,
4788
+ SUBTEMPLATE = 1
4789
+ }
4790
+
4726
4791
  /**
4727
4792
  * Stores a list of nodes which need to be removed.
4728
4793
  *
@@ -4734,6 +4799,16 @@ declare interface I18nRemoveOpCodes extends Array<number> {
4734
4799
  __brand__: 'I18nRemoveOpCodes';
4735
4800
  }
4736
4801
 
4802
+ /**
4803
+ * Represents a block of text in a translation, such as `Hello, {{ name }}!`.
4804
+ */
4805
+ declare interface I18nTextNode {
4806
+ /** The AST node kind */
4807
+ kind: I18nNodeKind.TEXT;
4808
+ /** The LView index */
4809
+ index: number;
4810
+ }
4811
+
4737
4812
  /**
4738
4813
  * Stores DOM operations which need to be applied to update DOM render tree due to changes in
4739
4814
  * expressions.
@@ -7401,6 +7476,12 @@ declare type NodeOutputBindings = Record<string, (number | string)[]>;
7401
7476
 
7402
7477
  declare const NODES = "n";
7403
7478
 
7479
+
7480
+ declare const enum NotificationType {
7481
+ RefreshViews = 0,
7482
+ AfterRenderHooks = 1
7483
+ }
7484
+
7404
7485
  declare const NUM_ROOT_NODES = "r";
7405
7486
 
7406
7487
  /**
@@ -7566,7 +7647,7 @@ export declare interface Output {
7566
7647
  export declare const Output: OutputDecorator;
7567
7648
 
7568
7649
  /**
7569
- * The `outputs` function allows declaration of outputs in directives and
7650
+ * The `output` function allows declaration of outputs in directives and
7570
7651
  * components.
7571
7652
  *
7572
7653
  * Initializes an output that can emit values to consumers of your
@@ -7630,6 +7711,7 @@ export declare interface OutputDecorator {
7630
7711
  export declare class OutputEmitterRef<T> implements OutputRef<T> {
7631
7712
  private destroyed;
7632
7713
  private listeners;
7714
+ private errorHandler;
7633
7715
  constructor();
7634
7716
  subscribe(callback: (value: T) => void): OutputRefSubscription;
7635
7717
  /** Emits a new value to the output. */
@@ -9576,6 +9658,11 @@ declare interface TI18n {
9576
9658
  * DOM are required.
9577
9659
  */
9578
9660
  update: I18nUpdateOpCodes;
9661
+ /**
9662
+ * An AST representing the translated message. This is used for hydration (and serialization),
9663
+ * while the Update and Create OpCodes are used at runtime.
9664
+ */
9665
+ ast: Array<I18nNode>;
9579
9666
  }
9580
9667
 
9581
9668
  declare interface TIcu {
@@ -11771,12 +11858,11 @@ export declare const enum ɵBypassType {
11771
11858
  Style = "Style"
11772
11859
  }
11773
11860
 
11774
-
11775
11861
  /**
11776
11862
  * Injectable that is notified when an `LView` is made aware of changes to application state.
11777
11863
  */
11778
11864
  export declare abstract class ɵChangeDetectionScheduler {
11779
- abstract notify(): void;
11865
+ abstract notify(source?: NotificationType): void;
11780
11866
  }
11781
11867
 
11782
11868
  export declare function ɵclearResolutionOfComponentResourcesQueue(): Map<Type<any>, Component>;
@@ -12579,14 +12665,6 @@ export declare function ɵisComponentDefPendingResolution(type: Type<any>): bool
12579
12665
 
12580
12666
  export declare function ɵisEnvironmentProviders(value: Provider | EnvironmentProviders | ɵInternalEnvironmentProviders): value is ɵInternalEnvironmentProviders;
12581
12667
 
12582
- /**
12583
- * Used to patch behavior that needs to _temporarily_ be different between g3 and external.
12584
- *
12585
- * For example, make breaking changes ahead of the main branch targeting a major version.
12586
- * Permanent differences between g3 and external should be configured by individual patches.
12587
- */
12588
- export declare const ɵisG3 = false;
12589
-
12590
12668
  export declare function ɵisInjectable(type: any): boolean;
12591
12669
 
12592
12670
  export declare function ɵisNgModule<T>(value: Type<T>): value is Type<T> & {
@@ -13738,6 +13816,12 @@ export declare function ɵwhenStable(applicationRef: ApplicationRef): Promise<vo
13738
13816
  */
13739
13817
  export declare function ɵwithDomHydration(): EnvironmentProviders;
13740
13818
 
13819
+ /**
13820
+ * Returns a set of providers required to setup support for i18n hydration.
13821
+ * Requires hydration to be enabled separately.
13822
+ */
13823
+ export declare function ɵwithI18nHydration(): EnvironmentProviders;
13824
+
13741
13825
  /**
13742
13826
  * Returns a writable type version of type.
13743
13827
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "17.3.0-rc.0",
3
+ "version": "17.3.1",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.3.0-rc.0
2
+ * @license Angular v17.3.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.3.0-rc.0
2
+ * @license Angular v17.3.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -18769,10 +18769,13 @@ function transformTwoWayBindingSet(job) {
18769
18769
  }
18770
18770
  }
18771
18771
  function wrapSetOperation(target, value) {
18772
+ if (target instanceof ReadVariableExpr) {
18773
+ return twoWayBindingSet(target, value);
18774
+ }
18772
18775
  return twoWayBindingSet(target, value).or(target.set(value));
18773
18776
  }
18774
18777
  function isReadExpression2(value) {
18775
- return value instanceof ReadPropExpr || value instanceof ReadKeyExpr;
18778
+ return value instanceof ReadPropExpr || value instanceof ReadKeyExpr || value instanceof ReadVariableExpr;
18776
18779
  }
18777
18780
  function wrapAction(target, value) {
18778
18781
  if (isReadExpression2(target)) {
@@ -20330,6 +20333,12 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
20330
20333
  const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);
20331
20334
  unit.update.push(createBindingOp(xref, BindingKind.Attribute, attr.name, literal(attr.value), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan));
20332
20335
  }
20336
+ for (const attr of root.inputs) {
20337
+ if (attr.type !== 4 && attr.type !== 1) {
20338
+ const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);
20339
+ unit.create.push(createExtractedAttributeOp(xref, BindingKind.Property, null, attr.name, null, null, null, securityContext));
20340
+ }
20341
+ }
20333
20342
  const tagName = root instanceof Element ? root.name : root.tagName;
20334
20343
  return tagName === NG_TEMPLATE_TAG_NAME ? null : tagName;
20335
20344
  }
@@ -20974,6 +20983,9 @@ function parseForLoopParameters(block, errors, bindingParser) {
20974
20983
  errors.push(new ParseError(param.sourceSpan, '@for loop can only have one "track" expression'));
20975
20984
  } else {
20976
20985
  const expression = parseBlockParameterToBinding(param, bindingParser, trackMatch[1]);
20986
+ if (expression.ast instanceof EmptyExpr) {
20987
+ errors.push(new ParseError(param.sourceSpan, '@for loop must have a "track" expression'));
20988
+ }
20977
20989
  const keywordSpan = new ParseSourceSpan(param.sourceSpan.start, param.sourceSpan.start.moveBy("track".length));
20978
20990
  result.trackBy = { expression, keywordSpan };
20979
20991
  }
@@ -26055,7 +26067,7 @@ function publishFacade(global) {
26055
26067
  }
26056
26068
 
26057
26069
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
26058
- var VERSION2 = new Version("17.3.0-rc.0");
26070
+ var VERSION2 = new Version("17.3.1");
26059
26071
 
26060
26072
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
26061
26073
  var _VisitorMode;