Skip to content

Commit 629d3cc

Browse files
committed
9ab663e refactor(migrations): Port standalone migration to standalone by default (#58169)
1 parent ea6b701 commit 629d3cc

File tree

5 files changed

+34
-20
lines changed

5 files changed

+34
-20
lines changed

BUILD_INFO

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Tue Oct 15 13:54:57 UTC 2024
2-
bf9fd31e2e7d21fa678815934fcbd78d5661708e
1+
Tue Oct 15 16:10:22 UTC 2024
2+
9ab663e7a29da63df03f453678ae9ed441c67a5d

fesm2022/compiler.mjs

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Angular v19.0.0-next.9+sha-bf9fd31
2+
* @license Angular v19.0.0-next.9+sha-9ab663e
33
* (c) 2010-2024 Google LLC. https://angular.io/
44
* License: MIT
55
*/
@@ -3096,6 +3096,19 @@ function partitionArray(arr, conditionFn) {
30963096
}
30973097
return [truthy, falsy];
30983098
}
3099+
const V1_TO_18 = /^([1-9]|1[0-8])\./;
3100+
function getJitStandaloneDefaultForVersion(version) {
3101+
if (version.startsWith('0.')) {
3102+
// 0.0.0 is always "latest", default is true.
3103+
return true;
3104+
}
3105+
if (V1_TO_18.test(version)) {
3106+
// Angular v2 - v18 default is false.
3107+
return false;
3108+
}
3109+
// All other Angular versions (v19+) default to true.
3110+
return true;
3111+
}
30993112

31003113
// https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
31013114
const VERSION$1 = 3;
@@ -7121,6 +7134,7 @@ function compilePipeFromMetadata(metadata) {
71217134
definitionMapValues.push({ key: 'type', value: metadata.type.value, quoted: false });
71227135
// e.g. `pure: true`
71237136
definitionMapValues.push({ key: 'pure', value: literal(metadata.pure), quoted: false });
7137+
// TODO: standalone as default value (invert the condition)
71247138
if (metadata.isStandalone) {
71257139
definitionMapValues.push({ key: 'standalone', value: literal(true), quoted: false });
71267140
}
@@ -29693,7 +29707,7 @@ function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
2969329707
deps: null,
2969429708
typeArgumentCount: 0,
2969529709
fullInheritance: false,
29696-
isStandalone: declaration.isStandalone ?? false,
29710+
isStandalone: declaration.isStandalone ?? getJitStandaloneDefaultForVersion(declaration.version),
2969729711
isSignal: declaration.isSignal ?? false,
2969829712
hostDirectives,
2969929713
};
@@ -30017,7 +30031,7 @@ function convertDeclarePipeFacadeToMetadata(declaration) {
3001730031
pipeName: declaration.name,
3001830032
deps: null,
3001930033
pure: declaration.pure ?? true,
30020-
isStandalone: declaration.isStandalone ?? false,
30034+
isStandalone: declaration.isStandalone ?? getJitStandaloneDefaultForVersion(declaration.version),
3002130035
};
3002230036
}
3002330037
function convertDeclareInjectorFacadeToMetadata(declaration) {
@@ -30042,7 +30056,7 @@ function publishFacade(global) {
3004230056
* @description
3004330057
* Entry point for all public APIs of the compiler package.
3004430058
*/
30045-
const VERSION = new Version('19.0.0-next.9+sha-bf9fd31');
30059+
const VERSION = new Version('19.0.0-next.9+sha-9ab663e');
3004630060

3004730061
class CompilerConfig {
3004830062
constructor({ defaultEncapsulation = ViewEncapsulation.Emulated, preserveWhitespaces, strictInjectionParameters, } = {}) {
@@ -31777,7 +31791,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
3177731791
function compileDeclareClassMetadata(metadata) {
3177831792
const definitionMap = new DefinitionMap();
3177931793
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
31780-
definitionMap.set('version', literal('19.0.0-next.9+sha-bf9fd31'));
31794+
definitionMap.set('version', literal('19.0.0-next.9+sha-9ab663e'));
3178131795
definitionMap.set('ngImport', importExpr(Identifiers.core));
3178231796
definitionMap.set('type', metadata.type);
3178331797
definitionMap.set('decorators', metadata.decorators);
@@ -31795,7 +31809,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
3179531809
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
3179631810
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
3179731811
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
31798-
definitionMap.set('version', literal('19.0.0-next.9+sha-bf9fd31'));
31812+
definitionMap.set('version', literal('19.0.0-next.9+sha-9ab663e'));
3179931813
definitionMap.set('ngImport', importExpr(Identifiers.core));
3180031814
definitionMap.set('type', metadata.type);
3180131815
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
@@ -31890,10 +31904,10 @@ function createDirectiveDefinitionMap(meta) {
3189031904
const definitionMap = new DefinitionMap();
3189131905
const minVersion = getMinimumVersionForPartialOutput(meta);
3189231906
definitionMap.set('minVersion', literal(minVersion));
31893-
definitionMap.set('version', literal('19.0.0-next.9+sha-bf9fd31'));
31907+
definitionMap.set('version', literal('19.0.0-next.9+sha-9ab663e'));
3189431908
// e.g. `type: MyDirective`
3189531909
definitionMap.set('type', meta.type.value);
31896-
if (meta.isStandalone) {
31910+
if (meta.isStandalone !== undefined) {
3189731911
definitionMap.set('isStandalone', literal(meta.isStandalone));
3189831912
}
3189931913
if (meta.isSignal) {
@@ -32312,7 +32326,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
3231232326
function compileDeclareFactoryFunction(meta) {
3231332327
const definitionMap = new DefinitionMap();
3231432328
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
32315-
definitionMap.set('version', literal('19.0.0-next.9+sha-bf9fd31'));
32329+
definitionMap.set('version', literal('19.0.0-next.9+sha-9ab663e'));
3231632330
definitionMap.set('ngImport', importExpr(Identifiers.core));
3231732331
definitionMap.set('type', meta.type.value);
3231832332
definitionMap.set('deps', compileDependencies(meta.deps));
@@ -32347,7 +32361,7 @@ function compileDeclareInjectableFromMetadata(meta) {
3234732361
function createInjectableDefinitionMap(meta) {
3234832362
const definitionMap = new DefinitionMap();
3234932363
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
32350-
definitionMap.set('version', literal('19.0.0-next.9+sha-bf9fd31'));
32364+
definitionMap.set('version', literal('19.0.0-next.9+sha-9ab663e'));
3235132365
definitionMap.set('ngImport', importExpr(Identifiers.core));
3235232366
definitionMap.set('type', meta.type.value);
3235332367
// Only generate providedIn property if it has a non-null value
@@ -32398,7 +32412,7 @@ function compileDeclareInjectorFromMetadata(meta) {
3239832412
function createInjectorDefinitionMap(meta) {
3239932413
const definitionMap = new DefinitionMap();
3240032414
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
32401-
definitionMap.set('version', literal('19.0.0-next.9+sha-bf9fd31'));
32415+
definitionMap.set('version', literal('19.0.0-next.9+sha-9ab663e'));
3240232416
definitionMap.set('ngImport', importExpr(Identifiers.core));
3240332417
definitionMap.set('type', meta.type.value);
3240432418
definitionMap.set('providers', meta.providers);
@@ -32431,7 +32445,7 @@ function createNgModuleDefinitionMap(meta) {
3243132445
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
3243232446
}
3243332447
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
32434-
definitionMap.set('version', literal('19.0.0-next.9+sha-bf9fd31'));
32448+
definitionMap.set('version', literal('19.0.0-next.9+sha-9ab663e'));
3243532449
definitionMap.set('ngImport', importExpr(Identifiers.core));
3243632450
definitionMap.set('type', meta.type.value);
3243732451
// We only generate the keys in the metadata if the arrays contain values.
@@ -32482,11 +32496,11 @@ function compileDeclarePipeFromMetadata(meta) {
3248232496
function createPipeDefinitionMap(meta) {
3248332497
const definitionMap = new DefinitionMap();
3248432498
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
32485-
definitionMap.set('version', literal('19.0.0-next.9+sha-bf9fd31'));
32499+
definitionMap.set('version', literal('19.0.0-next.9+sha-9ab663e'));
3248632500
definitionMap.set('ngImport', importExpr(Identifiers.core));
3248732501
// e.g. `type: MyPipe`
3248832502
definitionMap.set('type', meta.type.value);
32489-
if (meta.isStandalone) {
32503+
if (meta.isStandalone !== undefined) {
3249032504
definitionMap.set('isStandalone', literal(meta.isStandalone));
3249132505
}
3249232506
// e.g. `name: "myPipe"`

fesm2022/compiler.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Angular v19.0.0-next.9+sha-bf9fd31
2+
* @license Angular v19.0.0-next.9+sha-9ab663e
33
* (c) 2010-2024 Google LLC. https://angular.io/
44
* License: MIT
55
*/

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular/compiler",
3-
"version": "19.0.0-next.9+sha-bf9fd31",
3+
"version": "19.0.0-next.9+sha-9ab663e",
44
"description": "Angular - the compiler library",
55
"author": "angular",
66
"license": "MIT",
@@ -11,7 +11,7 @@
1111
"tslib": "^2.3.0"
1212
},
1313
"peerDependencies": {
14-
"@angular/core": "19.0.0-next.9+sha-bf9fd31"
14+
"@angular/core": "19.0.0-next.9+sha-9ab663e"
1515
},
1616
"peerDependenciesMeta": {
1717
"@angular/core": {

0 commit comments

Comments
 (0)