@angular/core 17.1.0-rc.0 → 17.1.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 (34) hide show
  1. package/esm2022/src/core_reactivity_export_internal.mjs +2 -2
  2. package/esm2022/src/defer/interfaces.mjs +3 -2
  3. package/esm2022/src/linker/compiler.mjs +1 -1
  4. package/esm2022/src/metadata/directives.mjs +1 -1
  5. package/esm2022/src/render3/component_ref.mjs +1 -1
  6. package/esm2022/src/render3/index.mjs +2 -3
  7. package/esm2022/src/render3/instructions/all.mjs +3 -2
  8. package/esm2022/src/render3/instructions/queries.mjs +98 -0
  9. package/esm2022/src/render3/interfaces/view.mjs +1 -1
  10. package/esm2022/src/render3/node_manipulation.mjs +2 -5
  11. package/esm2022/src/render3/query.mjs +11 -98
  12. package/esm2022/src/render3/reactivity/effect.mjs +15 -37
  13. package/esm2022/src/render3/util/global_utils.mjs +3 -1
  14. package/esm2022/src/version.mjs +1 -1
  15. package/esm2022/testing/src/component_fixture.mjs +5 -5
  16. package/esm2022/testing/src/logger.mjs +3 -3
  17. package/esm2022/testing/src/test_bed.mjs +7 -6
  18. package/fesm2022/core.mjs +8006 -8028
  19. package/fesm2022/core.mjs.map +1 -1
  20. package/fesm2022/primitives/signals.mjs +1 -1
  21. package/fesm2022/rxjs-interop.mjs +1 -1
  22. package/fesm2022/testing.mjs +10 -9
  23. package/fesm2022/testing.mjs.map +1 -1
  24. package/index.d.ts +9 -36
  25. package/package.json +1 -1
  26. package/primitives/signals/index.d.ts +1 -1
  27. package/rxjs-interop/index.d.ts +1 -1
  28. package/schematics/migrations/block-template-entities/bundle.js +42 -8
  29. package/schematics/migrations/block-template-entities/bundle.js.map +3 -3
  30. package/schematics/ng-generate/control-flow-migration/bundle.js +42 -8
  31. package/schematics/ng-generate/control-flow-migration/bundle.js.map +3 -3
  32. package/schematics/ng-generate/standalone-migration/bundle.js +481 -186
  33. package/schematics/ng-generate/standalone-migration/bundle.js.map +3 -3
  34. package/testing/index.d.ts +1 -1
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.1.0-rc.0
2
+ * @license Angular v17.1.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1221,9 +1221,6 @@ export declare abstract class CompilerFactory {
1221
1221
  /**
1222
1222
  * Options for creating a compiler.
1223
1223
  *
1224
- * Note: the `useJit` and `missingTranslation` config options are not used in Ivy, passing them has
1225
- * no effect. Those config options are deprecated since v13.
1226
- *
1227
1224
  * @publicApi
1228
1225
  */
1229
1226
  export declare type CompilerOptions = {
@@ -3886,16 +3883,6 @@ export declare interface FactorySansProvider {
3886
3883
 
3887
3884
  declare const FLAGS = 2;
3888
3885
 
3889
- /**
3890
- * Interface to an `EffectScheduler` capable of running scheduled effects synchronously.
3891
- */
3892
- declare interface FlushableEffectRunner {
3893
- /**
3894
- * Run any scheduled effects.
3895
- */
3896
- flush(): void;
3897
- }
3898
-
3899
3886
  /**
3900
3887
  * Allows to refer to references which are not yet defined.
3901
3888
  *
@@ -4213,6 +4200,7 @@ declare const globalUtilsFunctions: {
4213
4200
  getRootComponents: typeof getRootComponents;
4214
4201
  getDirectives: typeof ɵgetDirectives;
4215
4202
  applyChanges: typeof applyChanges;
4203
+ isSignal: typeof isSignal;
4216
4204
  };
4217
4205
 
4218
4206
  /**
@@ -6397,7 +6385,7 @@ declare interface LViewEnvironment {
6397
6385
  /** An optional custom sanitizer. */
6398
6386
  sanitizer: Sanitizer | null;
6399
6387
  /** Container for reactivity system `effect`s. */
6400
- inlineEffectRunner: FlushableEffectRunner | null;
6388
+ inlineEffectRunner: ɵEffectScheduler | null;
6401
6389
  /** Container for after render hooks */
6402
6390
  afterRenderEventManager: ɵAfterRenderEventManager | null;
6403
6391
  /** Scheduler for change detection to notify when application state changes. */
@@ -11598,11 +11586,12 @@ export declare const ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR: InjectionToken<ɵDefe
11598
11586
  export declare enum ɵDeferBlockBehavior {
11599
11587
  /**
11600
11588
  * Manual triggering mode for defer blocks. Provides control over when defer blocks render
11601
- * and which state they render. This is the default behavior in test environments.
11589
+ * and which state they render.
11602
11590
  */
11603
11591
  Manual = 0,
11604
11592
  /**
11605
11593
  * Playthrough mode for defer blocks. This mode behaves like defer blocks would in a browser.
11594
+ * This is the default behavior in test environments.
11606
11595
  */
11607
11596
  Playthrough = 1
11608
11597
  }
@@ -11837,6 +11826,10 @@ export declare abstract class ɵEffectScheduler {
11837
11826
  * It is an error to attempt to execute any effects synchronously during a scheduling operation.
11838
11827
  */
11839
11828
  abstract scheduleEffect(e: SchedulableEffect): void;
11829
+ /**
11830
+ * Run any scheduled effects.
11831
+ */
11832
+ abstract flush(): void;
11840
11833
  /** @nocollapse */
11841
11834
  static ɵprov: unknown;
11842
11835
  }
@@ -13277,26 +13270,6 @@ export declare type ɵWritable<T> = {
13277
13270
  */
13278
13271
  export declare const ɵXSS_SECURITY_URL = "https://g.co/ng/security#xss";
13279
13272
 
13280
- /**
13281
- * An `EffectScheduler` which is capable of queueing scheduled effects per-zone, and flushing them
13282
- * as an explicit operation.
13283
- */
13284
- export declare class ɵZoneAwareQueueingScheduler implements ɵEffectScheduler, FlushableEffectRunner {
13285
- private queuedEffectCount;
13286
- private queues;
13287
- scheduleEffect(handle: SchedulableEffect): void;
13288
- /**
13289
- * Run all scheduled effects.
13290
- *
13291
- * Execution order of effects within the same zone is guaranteed to be FIFO, but there is no
13292
- * ordering guarantee between effects scheduled in different zones.
13293
- */
13294
- flush(): void;
13295
- private flushQueue;
13296
- /** @nocollapse */
13297
- static ɵprov: unknown;
13298
- }
13299
-
13300
13273
  /**
13301
13274
  * Advances to an element for later binding instructions.
13302
13275
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "17.1.0-rc.0",
3
+ "version": "17.1.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.1.0-rc.0
2
+ * @license Angular v17.1.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.1.0-rc.0
2
+ * @license Angular v17.1.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -9651,7 +9651,7 @@ function createI18nContexts(job) {
9651
9651
  throw Error("AssertionError: Unexpected ICU outside of an i18n block.");
9652
9652
  }
9653
9653
  if (op.message.id !== currentI18nOp.message.id) {
9654
- const contextOp = createI18nContextOp(I18nContextKind.Icu, job.allocateXrefId(), currentI18nOp.xref, op.message, null);
9654
+ const contextOp = createI18nContextOp(I18nContextKind.Icu, job.allocateXrefId(), currentI18nOp.root, op.message, null);
9655
9655
  unit.create.push(contextOp);
9656
9656
  op.context = contextOp.xref;
9657
9657
  } else {
@@ -22205,7 +22205,7 @@ var TemplateData = class {
22205
22205
  }
22206
22206
  };
22207
22207
  var TemplateDefinitionBuilder = class {
22208
- constructor(constantPool, parentBindingScope, level = 0, contextName, i18nContext, templateIndex, templateName, _namespace, relativeContextFilePath, i18nUseExternalIds, deferBlocks, elementLocations, _constants = createComponentDefConsts()) {
22208
+ constructor(constantPool, parentBindingScope, level = 0, contextName, i18nContext, templateIndex, templateName, _namespace, relativeContextFilePath, i18nUseExternalIds, deferBlocks, elementLocations, allDeferrableDepsFn, _constants = createComponentDefConsts()) {
22209
22209
  this.constantPool = constantPool;
22210
22210
  this.level = level;
22211
22211
  this.contextName = contextName;
@@ -22216,6 +22216,7 @@ var TemplateDefinitionBuilder = class {
22216
22216
  this.i18nUseExternalIds = i18nUseExternalIds;
22217
22217
  this.deferBlocks = deferBlocks;
22218
22218
  this.elementLocations = elementLocations;
22219
+ this.allDeferrableDepsFn = allDeferrableDepsFn;
22219
22220
  this._constants = _constants;
22220
22221
  this._dataIndex = 0;
22221
22222
  this._bindingContext = 0;
@@ -22691,7 +22692,7 @@ var TemplateDefinitionBuilder = class {
22691
22692
  }
22692
22693
  const contextName = `${this.contextName}${contextNameSuffix}_${index}`;
22693
22694
  const name = `${contextName}_Template`;
22694
- const visitor = new TemplateDefinitionBuilder(this.constantPool, this._bindingScope, this.level + 1, contextName, this.i18n, index, name, this._namespace, this.fileBasedI18nSuffix, this.i18nUseExternalIds, this.deferBlocks, this.elementLocations, this._constants);
22695
+ const visitor = new TemplateDefinitionBuilder(this.constantPool, this._bindingScope, this.level + 1, contextName, this.i18n, index, name, this._namespace, this.fileBasedI18nSuffix, this.i18nUseExternalIds, this.deferBlocks, this.elementLocations, this.allDeferrableDepsFn, this._constants);
22695
22696
  this._nestedTemplateFns.push(() => {
22696
22697
  const templateFunctionExpr = visitor.buildTemplateFunction(children, variables, this._ngContentReservedSlots.length + this._ngContentSelectorsOffset, i18nMeta, variableAliases);
22697
22698
  this.constantPool.statements.push(templateFunctionExpr.toDeclStmt(name));
@@ -22863,6 +22864,7 @@ var TemplateDefinitionBuilder = class {
22863
22864
  });
22864
22865
  }
22865
22866
  visitDeferredBlock(deferred) {
22867
+ var _a2;
22866
22868
  const { loading, placeholder, error: error2, triggers, prefetchTriggers } = deferred;
22867
22869
  const metadata = this.deferBlocks.get(deferred);
22868
22870
  if (!metadata) {
@@ -22879,7 +22881,7 @@ var TemplateDefinitionBuilder = class {
22879
22881
  this.creationInstruction(deferred.sourceSpan, Identifiers.defer, trimTrailingNulls([
22880
22882
  literal(deferredIndex),
22881
22883
  literal(primaryTemplateIndex),
22882
- this.createDeferredDepsFunction(depsFnName, metadata),
22884
+ (_a2 = this.allDeferrableDepsFn) != null ? _a2 : this.createDeferredDepsFunction(depsFnName, metadata),
22883
22885
  literal(loadingIndex),
22884
22886
  literal(placeholderIndex),
22885
22887
  literal(errorIndex),
@@ -23893,6 +23895,17 @@ function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {
23893
23895
  const type = createDirectiveType(meta);
23894
23896
  return { expression, type, statements: [] };
23895
23897
  }
23898
+ function createDeferredDepsFunction(constantPool, name, deps) {
23899
+ const dependencyExp = [];
23900
+ for (const [symbolName, importPath] of deps) {
23901
+ const innerFn = arrowFn([new FnParam("m", DYNAMIC_TYPE)], variable("m").prop(symbolName));
23902
+ const importExpr2 = new DynamicImportExpr(importPath).prop("then").callFn([innerFn]);
23903
+ dependencyExp.push(importExpr2);
23904
+ }
23905
+ const depsFnExpr = arrowFn([], literalArr(dependencyExp));
23906
+ constantPool.statements.push(depsFnExpr.toDeclStmt(name, StmtModifier.Final));
23907
+ return variable(name);
23908
+ }
23896
23909
  function compileComponentFromMetadata(meta, constantPool, bindingParser) {
23897
23910
  const definitionMap = baseDirectiveFields(meta, constantPool, bindingParser);
23898
23911
  addFeatures(definitionMap, meta);
@@ -23910,8 +23923,13 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
23910
23923
  const templateTypeName = meta.name;
23911
23924
  const templateName = templateTypeName ? `${templateTypeName}_Template` : null;
23912
23925
  if (!USE_TEMPLATE_PIPELINE) {
23926
+ let allDeferrableDepsFn = null;
23927
+ if (meta.deferBlocks.size > 0 && meta.deferrableTypes.size > 0 && meta.deferBlockDepsEmitMode === 1) {
23928
+ const fnName = `${templateTypeName}_DeferFn`;
23929
+ allDeferrableDepsFn = createDeferredDepsFunction(constantPool, fnName, meta.deferrableTypes);
23930
+ }
23913
23931
  const template2 = meta.template;
23914
- const templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.createRootScope(), 0, templateTypeName, null, null, templateName, Identifiers.namespaceHTML, meta.relativeContextFilePath, meta.i18nUseExternalIds, meta.deferBlocks, /* @__PURE__ */ new Map());
23932
+ const templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.createRootScope(), 0, templateTypeName, null, null, templateName, Identifiers.namespaceHTML, meta.relativeContextFilePath, meta.i18nUseExternalIds, meta.deferBlocks, /* @__PURE__ */ new Map(), allDeferrableDepsFn);
23915
23933
  const templateFunctionExpression = templateBuilder.buildTemplateFunction(template2.nodes, []);
23916
23934
  const ngContentSelectors = templateBuilder.getNgContentSelectors();
23917
23935
  if (ngContentSelectors) {
@@ -24444,7 +24462,7 @@ var R3TargetBinder = class {
24444
24462
  const scopedNodeEntities = extractScopedNodeEntities(scope);
24445
24463
  const { directives, eagerDirectives, bindings, references } = DirectiveBinder.apply(target.template, this.directiveMatcher);
24446
24464
  const { expressions, symbols, nestingLevel, usedPipes, eagerPipes, deferBlocks } = TemplateBinder.applyWithScope(target.template, scope);
24447
- return new R3BoundTarget(target, directives, eagerDirectives, bindings, references, expressions, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, deferBlocks);
24465
+ return new R3BoundTarget(target, directives, eagerDirectives, bindings, references, expressions, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, deferBlocks, scope);
24448
24466
  }
24449
24467
  };
24450
24468
  var Scope2 = class {
@@ -24452,6 +24470,7 @@ var Scope2 = class {
24452
24470
  this.parentScope = parentScope;
24453
24471
  this.rootNode = rootNode;
24454
24472
  this.namedEntities = /* @__PURE__ */ new Map();
24473
+ this.elementsInScope = /* @__PURE__ */ new Set();
24455
24474
  this.childScopes = /* @__PURE__ */ new Map();
24456
24475
  this.isDeferred = parentScope !== null && parentScope.isDeferred ? true : rootNode instanceof DeferredBlock;
24457
24476
  }
@@ -24485,6 +24504,7 @@ var Scope2 = class {
24485
24504
  visitElement(element2) {
24486
24505
  element2.references.forEach((node) => this.visitReference(node));
24487
24506
  element2.children.forEach((node) => node.visit(this));
24507
+ this.elementsInScope.add(element2);
24488
24508
  }
24489
24509
  visitTemplate(template2) {
24490
24510
  template2.references.forEach((node) => this.visitReference(node));
@@ -24894,7 +24914,7 @@ var TemplateBinder = class extends RecursiveAstVisitor {
24894
24914
  }
24895
24915
  };
24896
24916
  var R3BoundTarget = class {
24897
- constructor(target, directives, eagerDirectives, bindings, references, exprTargets, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, deferredBlocks) {
24917
+ constructor(target, directives, eagerDirectives, bindings, references, exprTargets, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, deferredBlocks, rootScope) {
24898
24918
  this.target = target;
24899
24919
  this.directives = directives;
24900
24920
  this.eagerDirectives = eagerDirectives;
@@ -24907,6 +24927,7 @@ var R3BoundTarget = class {
24907
24927
  this.usedPipes = usedPipes;
24908
24928
  this.eagerPipes = eagerPipes;
24909
24929
  this.deferredBlocks = deferredBlocks;
24930
+ this.rootScope = rootScope;
24910
24931
  }
24911
24932
  getEntitiesInScope(node) {
24912
24933
  var _a2;
@@ -24986,6 +25007,15 @@ var R3BoundTarget = class {
24986
25007
  }
24987
25008
  return null;
24988
25009
  }
25010
+ isDeferred(element2) {
25011
+ for (const deferBlock of this.deferredBlocks) {
25012
+ const scope = this.rootScope.childScopes.get(deferBlock);
25013
+ if (scope && scope.elementsInScope.has(element2)) {
25014
+ return true;
25015
+ }
25016
+ }
25017
+ return false;
25018
+ }
24989
25019
  findEntityInScope(rootNode, name) {
24990
25020
  const entities = this.getEntitiesInScope(rootNode);
24991
25021
  for (const entitity of entities) {
@@ -25163,7 +25193,9 @@ var CompilerFacadeImpl = class {
25163
25193
  declarations: facade.declarations.map(convertDeclarationFacadeToMetadata),
25164
25194
  declarationListEmitMode: 0,
25165
25195
  deferBlocks,
25196
+ deferrableTypes: /* @__PURE__ */ new Map(),
25166
25197
  deferrableDeclToImportDecl: /* @__PURE__ */ new Map(),
25198
+ deferBlockDepsEmitMode: 0,
25167
25199
  styles: [...facade.styles, ...template2.styles],
25168
25200
  encapsulation: facade.encapsulation,
25169
25201
  interpolation,
@@ -25370,7 +25402,9 @@ function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMap
25370
25402
  viewProviders: decl.viewProviders !== void 0 ? new WrappedNodeExpr(decl.viewProviders) : null,
25371
25403
  animations: decl.animations !== void 0 ? new WrappedNodeExpr(decl.animations) : null,
25372
25404
  deferBlocks,
25405
+ deferrableTypes: /* @__PURE__ */ new Map(),
25373
25406
  deferrableDeclToImportDecl: /* @__PURE__ */ new Map(),
25407
+ deferBlockDepsEmitMode: 0,
25374
25408
  changeDetection: (_c2 = decl.changeDetection) != null ? _c2 : ChangeDetectionStrategy.Default,
25375
25409
  encapsulation: (_d2 = decl.encapsulation) != null ? _d2 : ViewEncapsulation.Emulated,
25376
25410
  interpolation,
@@ -25610,7 +25644,7 @@ function publishFacade(global) {
25610
25644
  }
25611
25645
 
25612
25646
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
25613
- var VERSION2 = new Version("17.1.0-rc.0");
25647
+ var VERSION2 = new Version("17.1.1");
25614
25648
 
25615
25649
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
25616
25650
  var _VisitorMode;