@angular/core 19.0.0-next.7 → 19.0.0-next.9

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 (33) hide show
  1. package/LICENSE +21 -0
  2. package/fesm2022/core.mjs +363 -156
  3. package/fesm2022/core.mjs.map +1 -1
  4. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  5. package/fesm2022/primitives/signals.mjs +1 -1
  6. package/fesm2022/primitives/signals.mjs.map +1 -1
  7. package/fesm2022/rxjs-interop.mjs +1 -1
  8. package/fesm2022/testing.mjs +6 -4
  9. package/fesm2022/testing.mjs.map +1 -1
  10. package/index.d.ts +107 -69
  11. package/package.json +1 -1
  12. package/primitives/event-dispatch/index.d.ts +1 -1
  13. package/primitives/signals/index.d.ts +5 -1
  14. package/rxjs-interop/index.d.ts +1 -1
  15. package/schematics/bundles/{checker-637eee78.js → checker-3b2ea20f.js} +136 -78
  16. package/schematics/bundles/{compiler_host-1e62b899.js → compiler_host-b4ba5a28.js} +2 -2
  17. package/schematics/bundles/control-flow-migration.js +3 -3
  18. package/schematics/bundles/explicit-standalone-flag.js +5 -5
  19. package/schematics/bundles/group_replacements-e1b5cbf8.js +31571 -0
  20. package/schematics/bundles/{imports-44987700.js → imports-4ac08251.js} +1 -1
  21. package/schematics/bundles/inject-migration.js +24 -8
  22. package/schematics/bundles/{leading_space-6e7a8ec6.js → leading_space-d190b83b.js} +1 -1
  23. package/schematics/bundles/{nodes-b12e919a.js → nodes-0e7d45ca.js} +2 -2
  24. package/schematics/bundles/pending-tasks.js +5 -5
  25. package/schematics/bundles/{program-893e3fe7.js → program-6534a30a.js} +120 -32
  26. package/schematics/bundles/{project_tsconfig_paths-6c9cde78.js → project_tsconfig_paths-e9ccccbf.js} +1 -1
  27. package/schematics/bundles/route-lazy-loading.js +4 -4
  28. package/schematics/bundles/signal-input-migration.js +386 -31727
  29. package/schematics/bundles/signal-queries-migration.js +924 -0
  30. package/schematics/bundles/standalone-migration.js +8 -8
  31. package/schematics/collection.json +6 -0
  32. package/schematics/ng-generate/signal-queries-migration/schema.json +19 -0
  33. package/testing/index.d.ts +3 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.0.0-next.7
3
+ * @license Angular v19.0.0-next.9
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -2539,6 +2539,7 @@ class Identifiers {
2539
2539
  }; }
2540
2540
  static { this.forwardRef = { name: 'forwardRef', moduleName: CORE }; }
2541
2541
  static { this.resolveForwardRef = { name: 'resolveForwardRef', moduleName: CORE }; }
2542
+ static { this.replaceMetadata = { name: 'ɵɵreplaceMetadata', moduleName: CORE }; }
2542
2543
  static { this.ɵɵdefineInjectable = { name: 'ɵɵdefineInjectable', moduleName: CORE }; }
2543
2544
  static { this.declareInjectable = { name: 'ɵɵngDeclareInjectable', moduleName: CORE }; }
2544
2545
  static { this.InjectableDeclaration = {
@@ -2652,6 +2653,10 @@ class Identifiers {
2652
2653
  name: 'ɵɵInputTransformsFeature',
2653
2654
  moduleName: CORE,
2654
2655
  }; }
2656
+ static { this.ExternalStylesFeature = {
2657
+ name: 'ɵɵExternalStylesFeature',
2658
+ moduleName: CORE,
2659
+ }; }
2655
2660
  static { this.listener = { name: 'ɵɵlistener', moduleName: CORE }; }
2656
2661
  static { this.getInheritedFactory = {
2657
2662
  name: 'ɵɵgetInheritedFactory',
@@ -6711,7 +6716,7 @@ class ShadowCss {
6711
6716
  * captures how many (if any) leading whitespaces are present or a comma
6712
6717
  * - (?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))
6713
6718
  * captures two different possible keyframes, ones which are quoted or ones which are valid css
6714
- * idents (custom properties excluded)
6719
+ * indents (custom properties excluded)
6715
6720
  * - (?=[,\s;]|$)
6716
6721
  * simply matches the end of the possible keyframe, valid endings are: a comma, a space, a
6717
6722
  * semicolon or the end of the string
@@ -6940,7 +6945,7 @@ class ShadowCss {
6940
6945
  */
6941
6946
  _scopeCssText(cssText, scopeSelector, hostSelector) {
6942
6947
  const unscopedRules = this._extractUnscopedRulesFromCssText(cssText);
6943
- // replace :host and :host-context -shadowcsshost and -shadowcsshost respectively
6948
+ // replace :host and :host-context with -shadowcsshost and -shadowcsshostcontext respectively
6944
6949
  cssText = this._insertPolyfillHostInCssText(cssText);
6945
6950
  cssText = this._convertColonHost(cssText);
6946
6951
  cssText = this._convertColonHostContext(cssText);
@@ -7018,7 +7023,7 @@ class ShadowCss {
7018
7023
  * .foo<scopeName> .bar { ... }
7019
7024
  */
7020
7025
  _convertColonHostContext(cssText) {
7021
- return cssText.replace(_cssColonHostContextReGlobal, (selectorText) => {
7026
+ return cssText.replace(_cssColonHostContextReGlobal, (selectorText, pseudoPrefix) => {
7022
7027
  // We have captured a selector that contains a `:host-context` rule.
7023
7028
  // For backward compatibility `:host-context` may contain a comma separated list of selectors.
7024
7029
  // Each context selector group will contain a list of host-context selectors that must match
@@ -7067,10 +7072,10 @@ class ShadowCss {
7067
7072
  selectorText = match[2];
7068
7073
  }
7069
7074
  // The context selectors now must be combined with each other to capture all the possible
7070
- // selectors that `:host-context` can match. See `combineHostContextSelectors()` for more
7075
+ // selectors that `:host-context` can match. See `_combineHostContextSelectors()` for more
7071
7076
  // info about how this is done.
7072
7077
  return contextSelectorGroups
7073
- .map((contextSelectors) => combineHostContextSelectors(contextSelectors, selectorText))
7078
+ .map((contextSelectors) => _combineHostContextSelectors(contextSelectors, selectorText, pseudoPrefix))
7074
7079
  .join(', ');
7075
7080
  });
7076
7081
  }
@@ -7087,7 +7092,12 @@ class ShadowCss {
7087
7092
  let selector = rule.selector;
7088
7093
  let content = rule.content;
7089
7094
  if (rule.selector[0] !== '@') {
7090
- selector = this._scopeSelector(rule.selector, scopeSelector, hostSelector);
7095
+ selector = this._scopeSelector({
7096
+ selector,
7097
+ scopeSelector,
7098
+ hostSelector,
7099
+ isParentSelector: true,
7100
+ });
7091
7101
  }
7092
7102
  else if (scopedAtRuleIdentifiers.some((atRule) => rule.selector.startsWith(atRule))) {
7093
7103
  content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);
@@ -7127,15 +7137,29 @@ class ShadowCss {
7127
7137
  return new CssRule(selector, rule.content);
7128
7138
  });
7129
7139
  }
7130
- _scopeSelector(selector, scopeSelector, hostSelector) {
7140
+ // `isParentSelector` is used to distinguish the selectors which are coming from
7141
+ // the initial selector string and any nested selectors, parsed recursively,
7142
+ // for example `selector = 'a:where(.one)'` could be the parent, while recursive call
7143
+ // would have `selector = '.one'`.
7144
+ _scopeSelector({ selector, scopeSelector, hostSelector, isParentSelector = false, }) {
7145
+ // Split the selector into independent parts by `,` (comma) unless
7146
+ // comma is within parenthesis, for example `:is(.one, two)`.
7147
+ // Negative lookup after comma allows not splitting inside nested parenthesis,
7148
+ // up to three levels (((,))).
7149
+ const selectorSplitRe = / ?,(?!(?:[^)(]*(?:\([^)(]*(?:\([^)(]*(?:\([^)(]*\)[^)(]*)*\)[^)(]*)*\)[^)(]*)*\))) ?/;
7131
7150
  return selector
7132
- .split(/ ?, ?/)
7151
+ .split(selectorSplitRe)
7133
7152
  .map((part) => part.split(_shadowDeepSelectors))
7134
7153
  .map((deepParts) => {
7135
7154
  const [shallowPart, ...otherParts] = deepParts;
7136
7155
  const applyScope = (shallowPart) => {
7137
7156
  if (this._selectorNeedsScoping(shallowPart, scopeSelector)) {
7138
- return this._applySelectorScope(shallowPart, scopeSelector, hostSelector);
7157
+ return this._applySelectorScope({
7158
+ selector: shallowPart,
7159
+ scopeSelector,
7160
+ hostSelector,
7161
+ isParentSelector,
7162
+ });
7139
7163
  }
7140
7164
  else {
7141
7165
  return shallowPart;
@@ -7162,8 +7186,8 @@ class ShadowCss {
7162
7186
  if (_polyfillHostRe.test(selector)) {
7163
7187
  const replaceBy = `[${hostSelector}]`;
7164
7188
  return selector
7165
- .replace(_polyfillHostNoCombinatorRe, (hnc, selector) => {
7166
- return selector.replace(/([^:]*)(:*)(.*)/, (_, before, colon, after) => {
7189
+ .replace(_polyfillHostNoCombinatorReGlobal, (_hnc, selector) => {
7190
+ return selector.replace(/([^:\)]*)(:*)(.*)/, (_, before, colon, after) => {
7167
7191
  return before + replaceBy + colon + after;
7168
7192
  });
7169
7193
  })
@@ -7173,7 +7197,7 @@ class ShadowCss {
7173
7197
  }
7174
7198
  // return a selector with [name] suffix on each simple selector
7175
7199
  // e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[name] /** @internal */
7176
- _applySelectorScope(selector, scopeSelector, hostSelector) {
7200
+ _applySelectorScope({ selector, scopeSelector, hostSelector, isParentSelector, }) {
7177
7201
  const isRe = /\[is=([^\]]*)\]/g;
7178
7202
  scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
7179
7203
  const attrName = '[' + scopeSelector + ']';
@@ -7184,6 +7208,10 @@ class ShadowCss {
7184
7208
  }
7185
7209
  if (p.includes(_polyfillHostNoCombinator)) {
7186
7210
  scopedP = this._applySimpleSelectorScope(p, scopeSelector, hostSelector);
7211
+ if (_polyfillHostNoCombinatorWithinPseudoFunction.test(p)) {
7212
+ const [_, before, colon, after] = scopedP.match(/([^:]*)(:*)(.*)/);
7213
+ scopedP = before + attrName + colon + after;
7214
+ }
7187
7215
  }
7188
7216
  else {
7189
7217
  // remove :host since it should be unnecessary
@@ -7197,12 +7225,50 @@ class ShadowCss {
7197
7225
  }
7198
7226
  return scopedP;
7199
7227
  };
7200
- const safeContent = new SafeSelector(selector);
7201
- selector = safeContent.content();
7228
+ // Wraps `_scopeSelectorPart()` to not use it directly on selectors with
7229
+ // pseudo selector functions like `:where()`. Selectors within pseudo selector
7230
+ // functions are recursively sent to `_scopeSelector()`.
7231
+ const _pseudoFunctionAwareScopeSelectorPart = (selectorPart) => {
7232
+ let scopedPart = '';
7233
+ const cssPrefixWithPseudoSelectorFunctionMatch = selectorPart.match(_cssPrefixWithPseudoSelectorFunction);
7234
+ if (cssPrefixWithPseudoSelectorFunctionMatch) {
7235
+ const [cssPseudoSelectorFunction] = cssPrefixWithPseudoSelectorFunctionMatch;
7236
+ // Unwrap the pseudo selector to scope its contents.
7237
+ // For example,
7238
+ // - `:where(selectorToScope)` -> `selectorToScope`;
7239
+ // - `:is(.foo, .bar)` -> `.foo, .bar`.
7240
+ const selectorToScope = selectorPart.slice(cssPseudoSelectorFunction.length, -1);
7241
+ if (selectorToScope.includes(_polyfillHostNoCombinator)) {
7242
+ this._shouldScopeIndicator = true;
7243
+ }
7244
+ const scopedInnerPart = this._scopeSelector({
7245
+ selector: selectorToScope,
7246
+ scopeSelector,
7247
+ hostSelector,
7248
+ });
7249
+ // Put the result back into the pseudo selector function.
7250
+ scopedPart = `${cssPseudoSelectorFunction}${scopedInnerPart})`;
7251
+ }
7252
+ else {
7253
+ this._shouldScopeIndicator =
7254
+ this._shouldScopeIndicator || selectorPart.includes(_polyfillHostNoCombinator);
7255
+ scopedPart = this._shouldScopeIndicator ? _scopeSelectorPart(selectorPart) : selectorPart;
7256
+ }
7257
+ return scopedPart;
7258
+ };
7259
+ if (isParentSelector) {
7260
+ this._safeSelector = new SafeSelector(selector);
7261
+ selector = this._safeSelector.content();
7262
+ }
7202
7263
  let scopedSelector = '';
7203
7264
  let startIndex = 0;
7204
7265
  let res;
7205
- const sep = /( |>|\+|~(?!=))\s*/g;
7266
+ // Combinators aren't used as a delimiter if they are within parenthesis,
7267
+ // for example `:where(.one .two)` stays intact.
7268
+ // Similarly to selector separation by comma initially, negative lookahead
7269
+ // is used here to not break selectors within nested parenthesis up to three
7270
+ // nested layers.
7271
+ const sep = /( |>|\+|~(?!=))(?!([^)(]*(?:\([^)(]*(?:\([^)(]*(?:\([^)(]*\)[^)(]*)*\)[^)(]*)*\)[^)(]*)*\)))\s*/g;
7206
7272
  // If a selector appears before :host it should not be shimmed as it
7207
7273
  // matches on ancestor elements and not on elements in the host's shadow
7208
7274
  // `:host-context(div)` is transformed to
@@ -7215,8 +7281,13 @@ class ShadowCss {
7215
7281
  // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a
7216
7282
  // `:host-context(tag)`)
7217
7283
  const hasHost = selector.includes(_polyfillHostNoCombinator);
7218
- // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present
7219
- let shouldScope = !hasHost;
7284
+ // Only scope parts after or on the same level as the first `-shadowcsshost-no-combinator`
7285
+ // when it is present. The selector has the same level when it is a part of a pseudo
7286
+ // selector, like `:where()`, for example `:where(:host, .foo)` would result in `.foo`
7287
+ // being scoped.
7288
+ if (isParentSelector || this._shouldScopeIndicator) {
7289
+ this._shouldScopeIndicator = !hasHost;
7290
+ }
7220
7291
  while ((res = sep.exec(selector)) !== null) {
7221
7292
  const separator = res[1];
7222
7293
  // Do not trim the selector, as otherwise this will break sourcemaps
@@ -7232,16 +7303,15 @@ class ShadowCss {
7232
7303
  if (part.match(/__esc-ph-(\d+)__/) && selector[res.index + 1]?.match(/[a-fA-F\d]/)) {
7233
7304
  continue;
7234
7305
  }
7235
- shouldScope = shouldScope || part.includes(_polyfillHostNoCombinator);
7236
- const scopedPart = shouldScope ? _scopeSelectorPart(part) : part;
7306
+ const scopedPart = _pseudoFunctionAwareScopeSelectorPart(part);
7237
7307
  scopedSelector += `${scopedPart} ${separator} `;
7238
7308
  startIndex = sep.lastIndex;
7239
7309
  }
7240
7310
  const part = selector.substring(startIndex);
7241
- shouldScope = shouldScope || part.includes(_polyfillHostNoCombinator);
7242
- scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
7311
+ scopedSelector += _pseudoFunctionAwareScopeSelectorPart(part);
7243
7312
  // replace the placeholders with their original values
7244
- return safeContent.restore(scopedSelector);
7313
+ // using values stored inside the `safeSelector` instance.
7314
+ return this._safeSelector.restore(scopedSelector);
7245
7315
  }
7246
7316
  _insertPolyfillHostInCssText(selector) {
7247
7317
  return selector
@@ -7296,6 +7366,8 @@ class SafeSelector {
7296
7366
  });
7297
7367
  }
7298
7368
  }
7369
+ const _cssScopedPseudoFunctionPrefix = '(:(where|is)\\()?';
7370
+ const _cssPrefixWithPseudoSelectorFunction = /^:(where|is)\(/i;
7299
7371
  const _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\s]*?(['"])(.*?)\1[;\s]*}([^{]*?){/gim;
7300
7372
  const _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
7301
7373
  const _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
@@ -7304,10 +7376,12 @@ const _polyfillHost = '-shadowcsshost';
7304
7376
  const _polyfillHostContext = '-shadowcsscontext';
7305
7377
  const _parenSuffix = '(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)';
7306
7378
  const _cssColonHostRe = new RegExp(_polyfillHost + _parenSuffix, 'gim');
7307
- const _cssColonHostContextReGlobal = new RegExp(_polyfillHostContext + _parenSuffix, 'gim');
7379
+ const _cssColonHostContextReGlobal = new RegExp(_cssScopedPseudoFunctionPrefix + '(' + _polyfillHostContext + _parenSuffix + ')', 'gim');
7308
7380
  const _cssColonHostContextRe = new RegExp(_polyfillHostContext + _parenSuffix, 'im');
7309
7381
  const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';
7382
+ const _polyfillHostNoCombinatorWithinPseudoFunction = new RegExp(`:.*\\(.*${_polyfillHostNoCombinator}.*\\)`);
7310
7383
  const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
7384
+ const _polyfillHostNoCombinatorReGlobal = new RegExp(_polyfillHostNoCombinatorRe, 'g');
7311
7385
  const _shadowDOMSelectorsRe = [
7312
7386
  /::shadow/g,
7313
7387
  /::content/g,
@@ -7541,7 +7615,7 @@ function unescapeQuotes(str, isQuoted) {
7541
7615
  * @param contextSelectors an array of context selectors that will be combined.
7542
7616
  * @param otherSelectors the rest of the selectors that are not context selectors.
7543
7617
  */
7544
- function combineHostContextSelectors(contextSelectors, otherSelectors) {
7618
+ function _combineHostContextSelectors(contextSelectors, otherSelectors, pseudoPrefix = '') {
7545
7619
  const hostMarker = _polyfillHostNoCombinator;
7546
7620
  _polyfillHostRe.lastIndex = 0; // reset the regex to ensure we get an accurate test
7547
7621
  const otherSelectorsHasHost = _polyfillHostRe.test(otherSelectors);
@@ -7567,8 +7641,8 @@ function combineHostContextSelectors(contextSelectors, otherSelectors) {
7567
7641
  // (A<hostMarker>) or as an ancestor (A <hostMarker>).
7568
7642
  return combined
7569
7643
  .map((s) => otherSelectorsHasHost
7570
- ? `${s}${otherSelectors}`
7571
- : `${s}${hostMarker}${otherSelectors}, ${s} ${hostMarker}${otherSelectors}`)
7644
+ ? `${pseudoPrefix}${s}${otherSelectors}`
7645
+ : `${pseudoPrefix}${s}${hostMarker}${otherSelectors}, ${pseudoPrefix}${s} ${hostMarker}${otherSelectors}`)
7572
7646
  .join(',');
7573
7647
  }
7574
7648
  /**
@@ -24455,29 +24529,9 @@ function convertAst(ast, job, baseSourceSpan) {
24455
24529
  return convertAst(ast.ast, job, baseSourceSpan);
24456
24530
  }
24457
24531
  else if (ast instanceof PropertyRead) {
24458
- const isThisReceiver = ast.receiver instanceof ThisReceiver;
24459
24532
  // Whether this is an implicit receiver, *excluding* explicit reads of `this`.
24460
24533
  const isImplicitReceiver = ast.receiver instanceof ImplicitReceiver && !(ast.receiver instanceof ThisReceiver);
24461
- // Whether the name of the read is a node that should be never retain its explicit this
24462
- // receiver.
24463
- const isSpecialNode = ast.name === '$any' || ast.name === '$event';
24464
- // TODO: The most sensible condition here would be simply `isImplicitReceiver`, to convert only
24465
- // actual implicit `this` reads, and not explicit ones. However, TemplateDefinitionBuilder (and
24466
- // the Typecheck block!) both have the same bug, in which they also consider explicit `this`
24467
- // reads to be implicit. This causes problems when the explicit `this` read is inside a
24468
- // template with a context that also provides the variable name being read:
24469
- // ```
24470
- // <ng-template let-a>{{this.a}}</ng-template>
24471
- // ```
24472
- // The whole point of the explicit `this` was to access the class property, but TDB and the
24473
- // current TCB treat the read as implicit, and give you the context property instead!
24474
- //
24475
- // For now, we emulate this old behavior by aggressively converting explicit reads to to
24476
- // implicit reads, except for the special cases that TDB and the current TCB protect. However,
24477
- // it would be an improvement to fix this.
24478
- //
24479
- // See also the corresponding comment for the TCB, in `type_check_block.ts`.
24480
- if (isImplicitReceiver || (isThisReceiver && !isSpecialNode)) {
24534
+ if (isImplicitReceiver) {
24481
24535
  return new LexicalReadExpr(ast.name);
24482
24536
  }
24483
24537
  else {
@@ -27326,6 +27380,10 @@ function addFeatures(definitionMap, meta) {
27326
27380
  if (meta.hasOwnProperty('template') && meta.isStandalone) {
27327
27381
  features.push(importExpr(Identifiers.StandaloneFeature));
27328
27382
  }
27383
+ if ('externalStyles' in meta && meta.externalStyles?.length) {
27384
+ const externalStyleNodes = meta.externalStyles.map((externalStyle) => literal$1(externalStyle));
27385
+ features.push(importExpr(Identifiers.ExternalStylesFeature).callFn([literalArr(externalStyleNodes)]));
27386
+ }
27329
27387
  if (features.length) {
27330
27388
  definitionMap.set('features', literalArr(features));
27331
27389
  }
@@ -27401,6 +27459,7 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
27401
27459
  if (meta.encapsulation === null) {
27402
27460
  meta.encapsulation = exports.ViewEncapsulation.Emulated;
27403
27461
  }
27462
+ let hasStyles = !!meta.externalStyles?.length;
27404
27463
  // e.g. `styles: [str1, str2]`
27405
27464
  if (meta.styles && meta.styles.length) {
27406
27465
  const styleValues = meta.encapsulation == exports.ViewEncapsulation.Emulated
@@ -27413,10 +27472,11 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
27413
27472
  return result;
27414
27473
  }, []);
27415
27474
  if (styleNodes.length > 0) {
27475
+ hasStyles = true;
27416
27476
  definitionMap.set('styles', literalArr(styleNodes));
27417
27477
  }
27418
27478
  }
27419
- else if (meta.encapsulation === exports.ViewEncapsulation.Emulated) {
27479
+ if (!hasStyles && meta.encapsulation === exports.ViewEncapsulation.Emulated) {
27420
27480
  // If there is no style, don't generate css selectors on elements
27421
27481
  meta.encapsulation = exports.ViewEncapsulation.None;
27422
27482
  }
@@ -28377,18 +28437,12 @@ class TemplateBinder extends RecursiveAstVisitor {
28377
28437
  maybeMap(ast, name) {
28378
28438
  // If the receiver of the expression isn't the `ImplicitReceiver`, this isn't the root of an
28379
28439
  // `AST` expression that maps to a `Variable` or `Reference`.
28380
- if (!(ast.receiver instanceof ImplicitReceiver)) {
28440
+ if (!(ast.receiver instanceof ImplicitReceiver) || ast.receiver instanceof ThisReceiver) {
28381
28441
  return;
28382
28442
  }
28383
28443
  // Check whether the name exists in the current scope. If so, map it. Otherwise, the name is
28384
28444
  // probably a property on the top-level component context.
28385
28445
  const target = this.scope.lookup(name);
28386
- // It's not allowed to read template entities via `this`, however it previously worked by
28387
- // accident (see #55115). Since `@let` declarations are new, we can fix it from the beginning,
28388
- // whereas pre-existing template entities will be fixed in #55115.
28389
- if (target instanceof LetDeclaration$1 && ast.receiver instanceof ThisReceiver) {
28390
- return;
28391
- }
28392
28446
  if (target !== null) {
28393
28447
  this.bindings.set(ast, target);
28394
28448
  }
@@ -29245,7 +29299,7 @@ function publishFacade(global) {
29245
29299
  * @description
29246
29300
  * Entry point for all public APIs of the compiler package.
29247
29301
  */
29248
- new Version('19.0.0-next.7');
29302
+ new Version('19.0.0-next.9');
29249
29303
 
29250
29304
  const _I18N_ATTR = 'i18n';
29251
29305
  const _I18N_ATTR_PREFIX = 'i18n-';
@@ -29806,6 +29860,10 @@ exports.ErrorCode = void 0;
29806
29860
  * pipe.
29807
29861
  */
29808
29862
  ErrorCode[ErrorCode["COMPONENT_UNKNOWN_DEFERRED_IMPORT"] = 2022] = "COMPONENT_UNKNOWN_DEFERRED_IMPORT";
29863
+ /**
29864
+ * Raised when a `standalone: false` component is declared but `strictStandalone` is set.
29865
+ */
29866
+ ErrorCode[ErrorCode["NON_STANDALONE_NOT_ALLOWED"] = 2023] = "NON_STANDALONE_NOT_ALLOWED";
29809
29867
  ErrorCode[ErrorCode["SYMBOL_NOT_EXPORTED"] = 3001] = "SYMBOL_NOT_EXPORTED";
29810
29868
  /**
29811
29869
  * Raised when a relationship between directives and/or pipes would cause a cyclic import to be
@@ -30589,7 +30647,7 @@ class NodeJSPathManipulation {
30589
30647
  // G3-ESM-MARKER: G3 uses CommonJS, but externally everything in ESM.
30590
30648
  // CommonJS/ESM interop for determining the current file name and containing dir.
30591
30649
  const isCommonJS = typeof __filename !== 'undefined';
30592
- const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('checker-637eee78.js', document.baseURI).href));
30650
+ const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('checker-3b2ea20f.js', document.baseURI).href));
30593
30651
  const currentFileName = isCommonJS ? __filename : url.fileURLToPath(currentFileUrl);
30594
30652
  /**
30595
30653
  * A wrapper around the Node.js file-system that supports readonly operations and path manipulation.
@@ -41982,21 +42040,9 @@ class TcbExpressionTranslator {
41982
42040
  * context). This method assists in resolving those.
41983
42041
  */
41984
42042
  resolve(ast) {
41985
- // TODO: this is actually a bug, because `ImplicitReceiver` extends `ThisReceiver`. Consider a
41986
- // case when the explicit `this` read is inside a template with a context that also provides the
41987
- // variable name being read:
41988
- // ```
41989
- // <ng-template let-a>{{this.a}}</ng-template>
41990
- // ```
41991
- // Clearly, `this.a` should refer to the class property `a`. However, because of this code,
41992
- // `this.a` will refer to `let-a` on the template context.
41993
- //
41994
- // Note that the generated code is actually consistent with this bug. To fix it, we have to:
41995
- // - Check `!(ast.receiver instanceof ThisReceiver)` in this condition
41996
- // - Update `ingest.ts` in the Template Pipeline (see the corresponding comment)
41997
- // - Turn off legacy TemplateDefinitionBuilder
41998
- // - Fix g3, and release in a major version
41999
- if (ast instanceof PropertyRead && ast.receiver instanceof ImplicitReceiver) {
42043
+ if (ast instanceof PropertyRead &&
42044
+ ast.receiver instanceof ImplicitReceiver &&
42045
+ !(ast.receiver instanceof ThisReceiver)) {
42000
42046
  // Try to resolve a bound target for this expression. If no such target is available, then
42001
42047
  // the expression is referencing the top-level component context. In that case, `null` is
42002
42048
  // returned here to let it fall through resolution so it will be caught when the
@@ -43456,9 +43502,11 @@ class SymbolBuilder {
43456
43502
  return this.getSymbol(expressionTarget);
43457
43503
  }
43458
43504
  let withSpan = expression.sourceSpan;
43459
- // The `name` part of a `PropertyWrite` and a non-safe `Call` does not have its own
43505
+ // The `name` part of a `PropertyWrite` and `ASTWithName` do not have their own
43460
43506
  // AST so there is no way to retrieve a `Symbol` for just the `name` via a specific node.
43461
- if (expression instanceof PropertyWrite) {
43507
+ // Also skipping SafePropertyReads as it breaks nullish coalescing not nullable extended diagnostic
43508
+ if (expression instanceof PropertyWrite ||
43509
+ (expression instanceof ASTWithName && !(expression instanceof SafePropertyRead))) {
43462
43510
  withSpan = expression.nameSpan;
43463
43511
  }
43464
43512
  let node = null;
@@ -43511,6 +43559,9 @@ class SymbolBuilder {
43511
43559
  if (ts__default["default"].isPropertyAccessExpression(node)) {
43512
43560
  tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.name);
43513
43561
  }
43562
+ else if (ts__default["default"].isCallExpression(node)) {
43563
+ tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.expression);
43564
+ }
43514
43565
  else {
43515
43566
  tsSymbol = this.getTypeChecker().getSymbolAtLocation(node);
43516
43567
  }
@@ -43642,7 +43693,7 @@ class TemplateTypeCheckerImpl {
43642
43693
  this.elementTagCache = new Map();
43643
43694
  this.isComplete = false;
43644
43695
  }
43645
- getTemplate(component) {
43696
+ getTemplate(component, optimizeFor) {
43646
43697
  const { data } = this.getLatestComponentState(component);
43647
43698
  if (data === null) {
43648
43699
  return null;
@@ -43655,8 +43706,15 @@ class TemplateTypeCheckerImpl {
43655
43706
  getUsedPipes(component) {
43656
43707
  return this.getLatestComponentState(component).data?.boundTarget.getUsedPipes() || null;
43657
43708
  }
43658
- getLatestComponentState(component) {
43659
- this.ensureShimForComponent(component);
43709
+ getLatestComponentState(component, optimizeFor = exports.OptimizeFor.SingleFile) {
43710
+ switch (optimizeFor) {
43711
+ case exports.OptimizeFor.WholeProgram:
43712
+ this.ensureAllShimsForAllFiles();
43713
+ break;
43714
+ case exports.OptimizeFor.SingleFile:
43715
+ this.ensureShimForComponent(component);
43716
+ break;
43717
+ }
43660
43718
  const sf = component.getSourceFile();
43661
43719
  const sfPath = absoluteFromSourceFile(sf);
43662
43720
  const shimPath = TypeCheckShimGenerator.shimFor(sfPath);
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.0.0-next.7
3
+ * @license Angular v19.0.0-next.9
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
8
8
 
9
9
  var ts = require('typescript');
10
- var checker = require('./checker-637eee78.js');
10
+ var checker = require('./checker-3b2ea20f.js');
11
11
  require('os');
12
12
  var p = require('path');
13
13
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.0.0-next.7
3
+ * @license Angular v19.0.0-next.9
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -10,8 +10,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
10
10
 
11
11
  var schematics = require('@angular-devkit/schematics');
12
12
  var p = require('path');
13
- var compiler_host = require('./compiler_host-1e62b899.js');
14
- var checker = require('./checker-637eee78.js');
13
+ var compiler_host = require('./compiler_host-b4ba5a28.js');
14
+ var checker = require('./checker-3b2ea20f.js');
15
15
  var ts = require('typescript');
16
16
  require('os');
17
17
  require('fs');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.0.0-next.7
3
+ * @license Angular v19.0.0-next.9
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -10,12 +10,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
10
10
 
11
11
  var schematics = require('@angular-devkit/schematics');
12
12
  var p = require('path');
13
- var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
14
- var compiler_host = require('./compiler_host-1e62b899.js');
13
+ var project_tsconfig_paths = require('./project_tsconfig_paths-e9ccccbf.js');
14
+ var compiler_host = require('./compiler_host-b4ba5a28.js');
15
15
  var ts = require('typescript');
16
- var imports = require('./imports-44987700.js');
16
+ var imports = require('./imports-4ac08251.js');
17
17
  require('@angular-devkit/core');
18
- require('./checker-637eee78.js');
18
+ require('./checker-3b2ea20f.js');
19
19
  require('os');
20
20
  require('fs');
21
21
  require('module');