@angular/compiler 18.0.0-next.3 → 18.0.0-next.5

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.
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @license Angular v18.0.0-next.3
3
- * (c) 2010-2022 Google LLC. https://angular.io/
2
+ * @license Angular v18.0.0-next.5
3
+ * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
@@ -2662,10 +2662,6 @@ class Identifiers {
2662
2662
  name: 'ɵɵgetInheritedFactory',
2663
2663
  moduleName: CORE,
2664
2664
  }; }
2665
- static { this.InputFlags = {
2666
- name: 'ɵɵInputFlags',
2667
- moduleName: CORE,
2668
- }; }
2669
2665
  // sanitization-related functions
2670
2666
  static { this.sanitizeHtml = { name: 'ɵɵsanitizeHtml', moduleName: CORE }; }
2671
2667
  static { this.sanitizeStyle = { name: 'ɵɵsanitizeStyle', moduleName: CORE }; }
@@ -5638,19 +5634,19 @@ function conditionallyCreateDirectiveBindingLiteral(map, forInputs) {
5638
5634
  publicName = value.bindingPropertyName;
5639
5635
  const differentDeclaringName = publicName !== declaredName;
5640
5636
  const hasDecoratorInputTransform = value.transformFunction !== null;
5637
+ let flags = InputFlags.None;
5641
5638
  // Build up input flags
5642
- let flags = null;
5643
5639
  if (value.isSignal) {
5644
- flags = bitwiseOrInputFlagsExpr(InputFlags.SignalBased, flags);
5640
+ flags |= InputFlags.SignalBased;
5645
5641
  }
5646
5642
  if (hasDecoratorInputTransform) {
5647
- flags = bitwiseOrInputFlagsExpr(InputFlags.HasDecoratorInputTransform, flags);
5643
+ flags |= InputFlags.HasDecoratorInputTransform;
5648
5644
  }
5649
5645
  // Inputs, compared to outputs, will track their declared name (for `ngOnChanges`), support
5650
5646
  // decorator input transform functions, or store flag information if there is any.
5651
- if (forInputs && (differentDeclaringName || hasDecoratorInputTransform || flags !== null)) {
5652
- const flagsExpr = flags ?? importExpr(Identifiers.InputFlags).prop(InputFlags[InputFlags.None]);
5653
- const result = [flagsExpr, asLiteral(publicName)];
5647
+ if (forInputs &&
5648
+ (differentDeclaringName || hasDecoratorInputTransform || flags !== InputFlags.None)) {
5649
+ const result = [literal(flags), asLiteral(publicName)];
5654
5650
  if (differentDeclaringName || hasDecoratorInputTransform) {
5655
5651
  result.push(asLiteral(declaredName));
5656
5652
  if (hasDecoratorInputTransform) {
@@ -5671,26 +5667,6 @@ function conditionallyCreateDirectiveBindingLiteral(map, forInputs) {
5671
5667
  };
5672
5668
  }));
5673
5669
  }
5674
- /** Gets an output AST expression referencing the given flag. */
5675
- function getInputFlagExpr(flag) {
5676
- return importExpr(Identifiers.InputFlags).prop(InputFlags[flag]);
5677
- }
5678
- /** Combines a given input flag with an existing flag expression, if present. */
5679
- function bitwiseOrInputFlagsExpr(flag, expr) {
5680
- if (expr === null) {
5681
- return getInputFlagExpr(flag);
5682
- }
5683
- return getInputFlagExpr(flag).bitwiseOr(expr);
5684
- }
5685
- /**
5686
- * Remove trailing null nodes as they are implied.
5687
- */
5688
- function trimTrailingNulls(parameters) {
5689
- while (isNull(parameters[parameters.length - 1])) {
5690
- parameters.pop();
5691
- }
5692
- return parameters;
5693
- }
5694
5670
  /**
5695
5671
  * A representation for an object literal used during codegen of definition objects. The generic
5696
5672
  * type `T` allows to reference a documented type of the generated structure, such that the
@@ -8569,11 +8545,10 @@ function createAdvanceOp(delta, sourceSpan) {
8569
8545
  /**
8570
8546
  * Create a conditional op, which will display an embedded view according to a condtion.
8571
8547
  */
8572
- function createConditionalOp(target, targetSlot, test, conditions, sourceSpan) {
8548
+ function createConditionalOp(target, test, conditions, sourceSpan) {
8573
8549
  return {
8574
8550
  kind: OpKind.Conditional,
8575
8551
  target,
8576
- targetSlot,
8577
8552
  test,
8578
8553
  conditions,
8579
8554
  processed: null,
@@ -20813,21 +20788,7 @@ function pipeBindV(slot, varOffset, args) {
20813
20788
  ]);
20814
20789
  }
20815
20790
  function textInterpolate(strings, expressions, sourceSpan) {
20816
- if (strings.length < 1 || expressions.length !== strings.length - 1) {
20817
- throw new Error(`AssertionError: expected specific shape of args for strings/expressions in interpolation`);
20818
- }
20819
- const interpolationArgs = [];
20820
- if (expressions.length === 1 && strings[0] === '' && strings[1] === '') {
20821
- interpolationArgs.push(expressions[0]);
20822
- }
20823
- else {
20824
- let idx;
20825
- for (idx = 0; idx < expressions.length; idx++) {
20826
- interpolationArgs.push(literal(strings[idx]), expressions[idx]);
20827
- }
20828
- // idx points at the last string.
20829
- interpolationArgs.push(literal(strings[idx]));
20830
- }
20791
+ const interpolationArgs = collateInterpolationArgs(strings, expressions);
20831
20792
  return callVariadicInstruction(TEXT_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan);
20832
20793
  }
20833
20794
  function i18nExp(expr, sourceSpan) {
@@ -20909,8 +20870,8 @@ function call(instruction, args, sourceSpan) {
20909
20870
  const expr = importExpr(instruction).callFn(args, sourceSpan);
20910
20871
  return createStatementOp(new ExpressionStatement(expr, sourceSpan));
20911
20872
  }
20912
- function conditional(slot, condition, contextValue, sourceSpan) {
20913
- const args = [literal(slot), condition];
20873
+ function conditional(condition, contextValue, sourceSpan) {
20874
+ const args = [condition];
20914
20875
  if (contextValue !== null) {
20915
20876
  args.push(contextValue);
20916
20877
  }
@@ -21404,10 +21365,7 @@ function reifyUpdateOperations(_unit, ops) {
21404
21365
  if (op.processed === null) {
21405
21366
  throw new Error(`Conditional test was not set.`);
21406
21367
  }
21407
- if (op.targetSlot.slot === null) {
21408
- throw new Error(`Conditional slot was not set.`);
21409
- }
21410
- OpList.replace(op, conditional(op.targetSlot.slot, op.processed, op.contextValue, op.sourceSpan));
21368
+ OpList.replace(op, conditional(op.processed, op.contextValue, op.sourceSpan));
21411
21369
  break;
21412
21370
  case OpKind.Repeater:
21413
21371
  OpList.replace(op, repeater(op.collection, op.sourceSpan));
@@ -22184,72 +22142,27 @@ function transformTwoWayBindingSet(job) {
22184
22142
  for (const op of unit.create) {
22185
22143
  if (op.kind === OpKind.TwoWayListener) {
22186
22144
  transformExpressionsInOp(op, (expr) => {
22187
- if (expr instanceof TwoWayBindingSetExpr) {
22188
- return wrapAction(expr.target, expr.value);
22145
+ if (!(expr instanceof TwoWayBindingSetExpr)) {
22146
+ return expr;
22189
22147
  }
22190
- return expr;
22148
+ const { target, value } = expr;
22149
+ if (target instanceof ReadPropExpr || target instanceof ReadKeyExpr) {
22150
+ return twoWayBindingSet(target, value).or(target.set(value));
22151
+ }
22152
+ // ASSUMPTION: here we're assuming that `ReadVariableExpr` will be a reference
22153
+ // to a local template variable. This appears to be the case at the time of writing.
22154
+ // If the expression is targeting a variable read, we only emit the `twoWayBindingSet`
22155
+ // since the fallback would be attempting to write into a constant. Invalid usages will be
22156
+ // flagged during template type checking.
22157
+ if (target instanceof ReadVariableExpr) {
22158
+ return twoWayBindingSet(target, value);
22159
+ }
22160
+ throw new Error(`Unsupported expression in two-way action binding.`);
22191
22161
  }, VisitorContextFlag.InChildOperation);
22192
22162
  }
22193
22163
  }
22194
22164
  }
22195
22165
  }
22196
- function wrapSetOperation(target, value) {
22197
- // ASSUMPTION: here we're assuming that `ReadVariableExpr` will be a reference
22198
- // to a local template variable. This appears to be the case at the time of writing.
22199
- // If the expression is targeting a variable read, we only emit the `twoWayBindingSet` since
22200
- // the fallback would be attempting to write into a constant. Invalid usages will be flagged
22201
- // during template type checking.
22202
- if (target instanceof ReadVariableExpr) {
22203
- return twoWayBindingSet(target, value);
22204
- }
22205
- return twoWayBindingSet(target, value).or(target.set(value));
22206
- }
22207
- function isReadExpression(value) {
22208
- return value instanceof ReadPropExpr || value instanceof ReadKeyExpr ||
22209
- value instanceof ReadVariableExpr;
22210
- }
22211
- function wrapAction(target, value) {
22212
- // The only officially supported expressions inside of a two-way binding are read expressions.
22213
- if (isReadExpression(target)) {
22214
- return wrapSetOperation(target, value);
22215
- }
22216
- // However, historically the expression parser was handling two-way events by appending `=$event`
22217
- // to the raw string before attempting to parse it. This has led to bugs over the years (see
22218
- // #37809) and to unintentionally supporting unassignable events in the two-way binding. The
22219
- // logic below aims to emulate the old behavior while still supporting the new output format
22220
- // which uses `twoWayBindingSet`. Note that the generated code doesn't necessarily make sense
22221
- // based on what the user wrote, for example the event binding for `[(value)]="a ? b : c"`
22222
- // would produce `ctx.a ? ctx.b : ctx.c = $event`. We aim to reproduce what the parser used
22223
- // to generate before #54154.
22224
- if (target instanceof BinaryOperatorExpr && isReadExpression(target.rhs)) {
22225
- // `a && b` -> `ctx.a && twoWayBindingSet(ctx.b, $event) || (ctx.b = $event)`
22226
- return new BinaryOperatorExpr(target.operator, target.lhs, wrapSetOperation(target.rhs, value));
22227
- }
22228
- // Note: this also supports nullish coalescing expressions which
22229
- // would've been downleveled to ternary expressions by this point.
22230
- if (target instanceof ConditionalExpr && isReadExpression(target.falseCase)) {
22231
- // `a ? b : c` -> `ctx.a ? ctx.b : twoWayBindingSet(ctx.c, $event) || (ctx.c = $event)`
22232
- return new ConditionalExpr(target.condition, target.trueCase, wrapSetOperation(target.falseCase, value));
22233
- }
22234
- // `!!a` -> `twoWayBindingSet(ctx.a, $event) || (ctx.a = $event)`
22235
- // Note: previously we'd actually produce `!!(ctx.a = $event)`, but the wrapping
22236
- // node doesn't affect the result so we don't need to carry it over.
22237
- if (target instanceof NotExpr) {
22238
- let expr = target.condition;
22239
- while (true) {
22240
- if (expr instanceof NotExpr) {
22241
- expr = expr.condition;
22242
- }
22243
- else {
22244
- if (isReadExpression(expr)) {
22245
- return wrapSetOperation(expr, value);
22246
- }
22247
- break;
22248
- }
22249
- }
22250
- }
22251
- throw new Error(`Unsupported expression in two-way action binding.`);
22252
- }
22253
22166
 
22254
22167
  /**
22255
22168
  * When inside of a listener, we may need access to one or more enclosing views. Therefore, each
@@ -23634,7 +23547,6 @@ function ingestBoundText(unit, text, icuPlaceholder) {
23634
23547
  */
23635
23548
  function ingestIfBlock(unit, ifBlock) {
23636
23549
  let firstXref = null;
23637
- let firstSlotHandle = null;
23638
23550
  let conditions = [];
23639
23551
  for (let i = 0; i < ifBlock.branches.length; i++) {
23640
23552
  const ifCase = ifBlock.branches[i];
@@ -23654,15 +23566,13 @@ function ingestIfBlock(unit, ifBlock) {
23654
23566
  unit.create.push(templateOp);
23655
23567
  if (firstXref === null) {
23656
23568
  firstXref = cView.xref;
23657
- firstSlotHandle = templateOp.handle;
23658
23569
  }
23659
23570
  const caseExpr = ifCase.expression ? convertAst(ifCase.expression, unit.job, null) : null;
23660
23571
  const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, templateOp.xref, templateOp.handle, ifCase.expressionAlias);
23661
23572
  conditions.push(conditionalCaseExpr);
23662
23573
  ingestNodes(cView, ifCase.children);
23663
23574
  }
23664
- const conditional = createConditionalOp(firstXref, firstSlotHandle, null, conditions, ifBlock.sourceSpan);
23665
- unit.update.push(conditional);
23575
+ unit.update.push(createConditionalOp(firstXref, null, conditions, ifBlock.sourceSpan));
23666
23576
  }
23667
23577
  /**
23668
23578
  * Ingest an `@switch` block into the given `ViewCompilation`.
@@ -23673,7 +23583,6 @@ function ingestSwitchBlock(unit, switchBlock) {
23673
23583
  return;
23674
23584
  }
23675
23585
  let firstXref = null;
23676
- let firstSlotHandle = null;
23677
23586
  let conditions = [];
23678
23587
  for (const switchCase of switchBlock.cases) {
23679
23588
  const cView = unit.job.allocateView(unit.xref);
@@ -23689,7 +23598,6 @@ function ingestSwitchBlock(unit, switchBlock) {
23689
23598
  unit.create.push(templateOp);
23690
23599
  if (firstXref === null) {
23691
23600
  firstXref = cView.xref;
23692
- firstSlotHandle = templateOp.handle;
23693
23601
  }
23694
23602
  const caseExpr = switchCase.expression ?
23695
23603
  convertAst(switchCase.expression, unit.job, switchBlock.startSourceSpan) :
@@ -23698,8 +23606,7 @@ function ingestSwitchBlock(unit, switchBlock) {
23698
23606
  conditions.push(conditionalCaseExpr);
23699
23607
  ingestNodes(cView, switchCase.children);
23700
23608
  }
23701
- const conditional = createConditionalOp(firstXref, firstSlotHandle, convertAst(switchBlock.expression, unit.job, null), conditions, switchBlock.sourceSpan);
23702
- unit.update.push(conditional);
23609
+ unit.update.push(createConditionalOp(firstXref, convertAst(switchBlock.expression, unit.job, null), conditions, switchBlock.sourceSpan));
23703
23610
  }
23704
23611
  function ingestDeferView(unit, suffix, i18nMeta, children, sourceSpan) {
23705
23612
  if (i18nMeta !== undefined && !(i18nMeta instanceof BlockPlaceholder)) {
@@ -24696,11 +24603,12 @@ const ANIMATE_PROP_PREFIX = 'animate-';
24696
24603
  * Parses bindings in templates and in the directive host area.
24697
24604
  */
24698
24605
  class BindingParser {
24699
- constructor(_exprParser, _interpolationConfig, _schemaRegistry, errors) {
24606
+ constructor(_exprParser, _interpolationConfig, _schemaRegistry, errors, _allowInvalidAssignmentEvents = false) {
24700
24607
  this._exprParser = _exprParser;
24701
24608
  this._interpolationConfig = _interpolationConfig;
24702
24609
  this._schemaRegistry = _schemaRegistry;
24703
24610
  this.errors = errors;
24611
+ this._allowInvalidAssignmentEvents = _allowInvalidAssignmentEvents;
24704
24612
  }
24705
24613
  get interpolationConfig() {
24706
24614
  return this._interpolationConfig;
@@ -25080,6 +24988,11 @@ class BindingParser {
25080
24988
  if (ast instanceof PropertyRead || ast instanceof KeyedRead) {
25081
24989
  return true;
25082
24990
  }
24991
+ // TODO(crisbeto): this logic is only here to support the automated migration away
24992
+ // from invalid bindings. It should be removed once the migration is deleted.
24993
+ if (!this._allowInvalidAssignmentEvents) {
24994
+ return false;
24995
+ }
25083
24996
  if (ast instanceof Binary) {
25084
24997
  return (ast.operation === '&&' || ast.operation === '||' || ast.operation === '??') &&
25085
24998
  (ast.right instanceof PropertyRead || ast.right instanceof KeyedRead);
@@ -26604,8 +26517,8 @@ const LEADING_TRIVIA_CHARS = [' ', '\n', '\r', '\t'];
26604
26517
  * @param options options to modify how the template is parsed
26605
26518
  */
26606
26519
  function parseTemplate(template, templateUrl, options = {}) {
26607
- const { interpolationConfig, preserveWhitespaces, enableI18nLegacyMessageIdFormat } = options;
26608
- const bindingParser = makeBindingParser(interpolationConfig);
26520
+ const { interpolationConfig, preserveWhitespaces, enableI18nLegacyMessageIdFormat, allowInvalidAssignmentEvents } = options;
26521
+ const bindingParser = makeBindingParser(interpolationConfig, allowInvalidAssignmentEvents);
26609
26522
  const htmlParser = new HtmlParser();
26610
26523
  const parseResult = htmlParser.parse(template, templateUrl, {
26611
26524
  leadingTriviaChars: LEADING_TRIVIA_CHARS,
@@ -26683,8 +26596,8 @@ const elementRegistry = new DomElementSchemaRegistry();
26683
26596
  /**
26684
26597
  * Construct a `BindingParser` with a default configuration.
26685
26598
  */
26686
- function makeBindingParser(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
26687
- return new BindingParser(new Parser$1(new Lexer()), interpolationConfig, elementRegistry, []);
26599
+ function makeBindingParser(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG, allowInvalidAssignmentEvents = false) {
26600
+ return new BindingParser(new Parser$1(new Lexer()), interpolationConfig, elementRegistry, [], allowInvalidAssignmentEvents);
26688
26601
  }
26689
26602
 
26690
26603
  const COMPONENT_VARIABLE = '%COMP%';
@@ -28644,7 +28557,7 @@ function publishFacade(global) {
28644
28557
  * @description
28645
28558
  * Entry point for all public APIs of the compiler package.
28646
28559
  */
28647
- const VERSION = new Version('18.0.0-next.3');
28560
+ const VERSION = new Version('18.0.0-next.5');
28648
28561
 
28649
28562
  class CompilerConfig {
28650
28563
  constructor({ defaultEncapsulation = ViewEncapsulation.Emulated, preserveWhitespaces, strictInjectionParameters } = {}) {
@@ -30229,7 +30142,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
30229
30142
  function compileDeclareClassMetadata(metadata) {
30230
30143
  const definitionMap = new DefinitionMap();
30231
30144
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
30232
- definitionMap.set('version', literal('18.0.0-next.3'));
30145
+ definitionMap.set('version', literal('18.0.0-next.5'));
30233
30146
  definitionMap.set('ngImport', importExpr(Identifiers.core));
30234
30147
  definitionMap.set('type', metadata.type);
30235
30148
  definitionMap.set('decorators', metadata.decorators);
@@ -30247,7 +30160,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
30247
30160
  callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
30248
30161
  callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
30249
30162
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
30250
- definitionMap.set('version', literal('18.0.0-next.3'));
30163
+ definitionMap.set('version', literal('18.0.0-next.5'));
30251
30164
  definitionMap.set('ngImport', importExpr(Identifiers.core));
30252
30165
  definitionMap.set('type', metadata.type);
30253
30166
  definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
@@ -30342,7 +30255,7 @@ function createDirectiveDefinitionMap(meta) {
30342
30255
  const definitionMap = new DefinitionMap();
30343
30256
  const minVersion = getMinimumVersionForPartialOutput(meta);
30344
30257
  definitionMap.set('minVersion', literal(minVersion));
30345
- definitionMap.set('version', literal('18.0.0-next.3'));
30258
+ definitionMap.set('version', literal('18.0.0-next.5'));
30346
30259
  // e.g. `type: MyDirective`
30347
30260
  definitionMap.set('type', meta.type.value);
30348
30261
  if (meta.isStandalone) {
@@ -30757,7 +30670,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
30757
30670
  function compileDeclareFactoryFunction(meta) {
30758
30671
  const definitionMap = new DefinitionMap();
30759
30672
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
30760
- definitionMap.set('version', literal('18.0.0-next.3'));
30673
+ definitionMap.set('version', literal('18.0.0-next.5'));
30761
30674
  definitionMap.set('ngImport', importExpr(Identifiers.core));
30762
30675
  definitionMap.set('type', meta.type.value);
30763
30676
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -30792,7 +30705,7 @@ function compileDeclareInjectableFromMetadata(meta) {
30792
30705
  function createInjectableDefinitionMap(meta) {
30793
30706
  const definitionMap = new DefinitionMap();
30794
30707
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
30795
- definitionMap.set('version', literal('18.0.0-next.3'));
30708
+ definitionMap.set('version', literal('18.0.0-next.5'));
30796
30709
  definitionMap.set('ngImport', importExpr(Identifiers.core));
30797
30710
  definitionMap.set('type', meta.type.value);
30798
30711
  // Only generate providedIn property if it has a non-null value
@@ -30843,7 +30756,7 @@ function compileDeclareInjectorFromMetadata(meta) {
30843
30756
  function createInjectorDefinitionMap(meta) {
30844
30757
  const definitionMap = new DefinitionMap();
30845
30758
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
30846
- definitionMap.set('version', literal('18.0.0-next.3'));
30759
+ definitionMap.set('version', literal('18.0.0-next.5'));
30847
30760
  definitionMap.set('ngImport', importExpr(Identifiers.core));
30848
30761
  definitionMap.set('type', meta.type.value);
30849
30762
  definitionMap.set('providers', meta.providers);
@@ -30876,7 +30789,7 @@ function createNgModuleDefinitionMap(meta) {
30876
30789
  throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
30877
30790
  }
30878
30791
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
30879
- definitionMap.set('version', literal('18.0.0-next.3'));
30792
+ definitionMap.set('version', literal('18.0.0-next.5'));
30880
30793
  definitionMap.set('ngImport', importExpr(Identifiers.core));
30881
30794
  definitionMap.set('type', meta.type.value);
30882
30795
  // We only generate the keys in the metadata if the arrays contain values.
@@ -30927,7 +30840,7 @@ function compileDeclarePipeFromMetadata(meta) {
30927
30840
  function createPipeDefinitionMap(meta) {
30928
30841
  const definitionMap = new DefinitionMap();
30929
30842
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
30930
- definitionMap.set('version', literal('18.0.0-next.3'));
30843
+ definitionMap.set('version', literal('18.0.0-next.5'));
30931
30844
  definitionMap.set('ngImport', importExpr(Identifiers.core));
30932
30845
  // e.g. `type: MyPipe`
30933
30846
  definitionMap.set('type', meta.type.value);