Skip to content

Commit

Permalink
292c987 refactor(compiler): add handler attribute to XMB output (#5…
Browse files Browse the repository at this point in the history
…4865)
  • Loading branch information
AndrewKushnir committed Apr 29, 2024
1 parent 380f4d9 commit f155033
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 28 deletions.
4 changes: 2 additions & 2 deletions BUILD_INFO
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Mon Apr 29 17:30:44 UTC 2024
0d78a92431178be73342aeddda4b62d9e49138ba
Mon Apr 29 19:01:56 UTC 2024
292c9877910bea72fa1f69f6d96913a836451e78
13 changes: 11 additions & 2 deletions esm2022/src/i18n/serializers/xmb.mjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions esm2022/src/render3/partial/class_metadata.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
export function compileDeclareClassMetadata(metadata) {
const definitionMap = new DefinitionMap();
definitionMap.set('minVersion', o.literal(MINIMUM_PARTIAL_LINKER_VERSION));
definitionMap.set('version', o.literal('18.1.0-next.0+sha-0d78a92'));
definitionMap.set('version', o.literal('18.1.0-next.0+sha-292c987'));
definitionMap.set('ngImport', o.importExpr(R3.core));
definitionMap.set('type', metadata.type);
definitionMap.set('decorators', metadata.decorators);
Expand All @@ -42,7 +42,7 @@ export function compileComponentDeclareClassMetadata(metadata, dependencies) {
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? o.literal(null));
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? o.literal(null));
definitionMap.set('minVersion', o.literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
definitionMap.set('version', o.literal('18.1.0-next.0+sha-0d78a92'));
definitionMap.set('version', o.literal('18.1.0-next.0+sha-292c987'));
definitionMap.set('ngImport', o.importExpr(R3.core));
definitionMap.set('type', metadata.type);
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
Expand Down
2 changes: 1 addition & 1 deletion esm2022/src/render3/partial/directive.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function createDirectiveDefinitionMap(meta) {
const definitionMap = new DefinitionMap();
const minVersion = getMinimumVersionForPartialOutput(meta);
definitionMap.set('minVersion', o.literal(minVersion));
definitionMap.set('version', o.literal('18.1.0-next.0+sha-0d78a92'));
definitionMap.set('version', o.literal('18.1.0-next.0+sha-292c987'));
// e.g. `type: MyDirective`
definitionMap.set('type', meta.type.value);
if (meta.isStandalone) {
Expand Down
2 changes: 1 addition & 1 deletion esm2022/src/render3/partial/factory.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION = '12.0.0';
export function compileDeclareFactoryFunction(meta) {
const definitionMap = new DefinitionMap();
definitionMap.set('minVersion', o.literal(MINIMUM_PARTIAL_LINKER_VERSION));
definitionMap.set('version', o.literal('18.1.0-next.0+sha-0d78a92'));
definitionMap.set('version', o.literal('18.1.0-next.0+sha-292c987'));
definitionMap.set('ngImport', o.importExpr(R3.core));
definitionMap.set('type', meta.type.value);
definitionMap.set('deps', compileDependencies(meta.deps));
Expand Down
2 changes: 1 addition & 1 deletion esm2022/src/render3/partial/injectable.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function compileDeclareInjectableFromMetadata(meta) {
export function createInjectableDefinitionMap(meta) {
const definitionMap = new DefinitionMap();
definitionMap.set('minVersion', o.literal(MINIMUM_PARTIAL_LINKER_VERSION));
definitionMap.set('version', o.literal('18.1.0-next.0+sha-0d78a92'));
definitionMap.set('version', o.literal('18.1.0-next.0+sha-292c987'));
definitionMap.set('ngImport', o.importExpr(R3.core));
definitionMap.set('type', meta.type.value);
// Only generate providedIn property if it has a non-null value
Expand Down
2 changes: 1 addition & 1 deletion esm2022/src/render3/partial/injector.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function compileDeclareInjectorFromMetadata(meta) {
function createInjectorDefinitionMap(meta) {
const definitionMap = new DefinitionMap();
definitionMap.set('minVersion', o.literal(MINIMUM_PARTIAL_LINKER_VERSION));
definitionMap.set('version', o.literal('18.1.0-next.0+sha-0d78a92'));
definitionMap.set('version', o.literal('18.1.0-next.0+sha-292c987'));
definitionMap.set('ngImport', o.importExpr(R3.core));
definitionMap.set('type', meta.type.value);
definitionMap.set('providers', meta.providers);
Expand Down
2 changes: 1 addition & 1 deletion esm2022/src/render3/partial/ng_module.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function createNgModuleDefinitionMap(meta) {
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
}
definitionMap.set('minVersion', o.literal(MINIMUM_PARTIAL_LINKER_VERSION));
definitionMap.set('version', o.literal('18.1.0-next.0+sha-0d78a92'));
definitionMap.set('version', o.literal('18.1.0-next.0+sha-292c987'));
definitionMap.set('ngImport', o.importExpr(R3.core));
definitionMap.set('type', meta.type.value);
// We only generate the keys in the metadata if the arrays contain values.
Expand Down
2 changes: 1 addition & 1 deletion esm2022/src/render3/partial/pipe.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function compileDeclarePipeFromMetadata(meta) {
export function createPipeDefinitionMap(meta) {
const definitionMap = new DefinitionMap();
definitionMap.set('minVersion', o.literal(MINIMUM_PARTIAL_LINKER_VERSION));
definitionMap.set('version', o.literal('18.1.0-next.0+sha-0d78a92'));
definitionMap.set('version', o.literal('18.1.0-next.0+sha-292c987'));
definitionMap.set('ngImport', o.importExpr(R3.core));
// e.g. `type: MyPipe`
definitionMap.set('type', meta.type.value);
Expand Down
2 changes: 1 addition & 1 deletion esm2022/src/version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
* Entry point for all public APIs of the compiler package.
*/
import { Version } from './util';
export const VERSION = new Version('18.1.0-next.0+sha-0d78a92');
export const VERSION = new Version('18.1.0-next.0+sha-292c987');
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyL3NyYy92ZXJzaW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVIOzs7O0dBSUc7QUFFSCxPQUFPLEVBQUMsT0FBTyxFQUFDLE1BQU0sUUFBUSxDQUFDO0FBRS9CLE1BQU0sQ0FBQyxNQUFNLE9BQU8sR0FBRyxJQUFJLE9BQU8sQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBMTEMgQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICovXG5cbi8qKlxuICogQG1vZHVsZVxuICogQGRlc2NyaXB0aW9uXG4gKiBFbnRyeSBwb2ludCBmb3IgYWxsIHB1YmxpYyBBUElzIG9mIHRoZSBjb21waWxlciBwYWNrYWdlLlxuICovXG5cbmltcG9ydCB7VmVyc2lvbn0gZnJvbSAnLi91dGlsJztcblxuZXhwb3J0IGNvbnN0IFZFUlNJT04gPSBuZXcgVmVyc2lvbignMC4wLjAtUExBQ0VIT0xERVInKTtcbiJdfQ==
31 changes: 20 additions & 11 deletions fesm2022/compiler.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Angular v18.1.0-next.0+sha-0d78a92
* @license Angular v18.1.0-next.0+sha-292c987
* (c) 2010-2024 Google LLC. https://angular.io/
* License: MIT
*/
Expand Down Expand Up @@ -5608,6 +5608,14 @@ function escapeXml(text) {
return _ESCAPED_CHARS.reduce((text, entry) => text.replace(entry[0], entry[1]), text);
}

/**
* Defines the `handler` value on the serialized XMB, indicating that Angular
* generated the bundle. This is useful for analytics in Translation Console.
*
* NOTE: Keep in sync with
* packages/localize/tools/src/extract/translation_files/xmb_translation_serializer.ts.
*/
const _XMB_HANDLER = 'angular';
const _MESSAGES_TAG = 'messagebundle';
const _MESSAGE_TAG = 'msg';
const _PLACEHOLDER_TAG$3 = 'ph';
Expand Down Expand Up @@ -5636,7 +5644,8 @@ class Xmb extends Serializer {
write(messages, locale) {
const exampleVisitor = new ExampleVisitor();
const visitor = new _Visitor$1();
let rootNode = new Tag(_MESSAGES_TAG);
const rootNode = new Tag(_MESSAGES_TAG);
rootNode.attrs['handler'] = _XMB_HANDLER;
messages.forEach((message) => {
const attrs = { id: message.id };
if (message.description) {
Expand Down Expand Up @@ -29012,7 +29021,7 @@ function publishFacade(global) {
* @description
* Entry point for all public APIs of the compiler package.
*/
const VERSION = new Version('18.1.0-next.0+sha-0d78a92');
const VERSION = new Version('18.1.0-next.0+sha-292c987');

class CompilerConfig {
constructor({ defaultEncapsulation = ViewEncapsulation.Emulated, preserveWhitespaces, strictInjectionParameters, } = {}) {
Expand Down Expand Up @@ -30643,7 +30652,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
function compileDeclareClassMetadata(metadata) {
const definitionMap = new DefinitionMap();
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
definitionMap.set('version', literal('18.1.0-next.0+sha-0d78a92'));
definitionMap.set('version', literal('18.1.0-next.0+sha-292c987'));
definitionMap.set('ngImport', importExpr(Identifiers.core));
definitionMap.set('type', metadata.type);
definitionMap.set('decorators', metadata.decorators);
Expand All @@ -30661,7 +30670,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
definitionMap.set('version', literal('18.1.0-next.0+sha-0d78a92'));
definitionMap.set('version', literal('18.1.0-next.0+sha-292c987'));
definitionMap.set('ngImport', importExpr(Identifiers.core));
definitionMap.set('type', metadata.type);
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
Expand Down Expand Up @@ -30756,7 +30765,7 @@ function createDirectiveDefinitionMap(meta) {
const definitionMap = new DefinitionMap();
const minVersion = getMinimumVersionForPartialOutput(meta);
definitionMap.set('minVersion', literal(minVersion));
definitionMap.set('version', literal('18.1.0-next.0+sha-0d78a92'));
definitionMap.set('version', literal('18.1.0-next.0+sha-292c987'));
// e.g. `type: MyDirective`
definitionMap.set('type', meta.type.value);
if (meta.isStandalone) {
Expand Down Expand Up @@ -31178,7 +31187,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
function compileDeclareFactoryFunction(meta) {
const definitionMap = new DefinitionMap();
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
definitionMap.set('version', literal('18.1.0-next.0+sha-0d78a92'));
definitionMap.set('version', literal('18.1.0-next.0+sha-292c987'));
definitionMap.set('ngImport', importExpr(Identifiers.core));
definitionMap.set('type', meta.type.value);
definitionMap.set('deps', compileDependencies(meta.deps));
Expand Down Expand Up @@ -31213,7 +31222,7 @@ function compileDeclareInjectableFromMetadata(meta) {
function createInjectableDefinitionMap(meta) {
const definitionMap = new DefinitionMap();
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
definitionMap.set('version', literal('18.1.0-next.0+sha-0d78a92'));
definitionMap.set('version', literal('18.1.0-next.0+sha-292c987'));
definitionMap.set('ngImport', importExpr(Identifiers.core));
definitionMap.set('type', meta.type.value);
// Only generate providedIn property if it has a non-null value
Expand Down Expand Up @@ -31264,7 +31273,7 @@ function compileDeclareInjectorFromMetadata(meta) {
function createInjectorDefinitionMap(meta) {
const definitionMap = new DefinitionMap();
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
definitionMap.set('version', literal('18.1.0-next.0+sha-0d78a92'));
definitionMap.set('version', literal('18.1.0-next.0+sha-292c987'));
definitionMap.set('ngImport', importExpr(Identifiers.core));
definitionMap.set('type', meta.type.value);
definitionMap.set('providers', meta.providers);
Expand Down Expand Up @@ -31297,7 +31306,7 @@ function createNgModuleDefinitionMap(meta) {
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
}
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
definitionMap.set('version', literal('18.1.0-next.0+sha-0d78a92'));
definitionMap.set('version', literal('18.1.0-next.0+sha-292c987'));
definitionMap.set('ngImport', importExpr(Identifiers.core));
definitionMap.set('type', meta.type.value);
// We only generate the keys in the metadata if the arrays contain values.
Expand Down Expand Up @@ -31348,7 +31357,7 @@ function compileDeclarePipeFromMetadata(meta) {
function createPipeDefinitionMap(meta) {
const definitionMap = new DefinitionMap();
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
definitionMap.set('version', literal('18.1.0-next.0+sha-0d78a92'));
definitionMap.set('version', literal('18.1.0-next.0+sha-292c987'));
definitionMap.set('ngImport', importExpr(Identifiers.core));
// e.g. `type: MyPipe`
definitionMap.set('type', meta.type.value);
Expand Down
2 changes: 1 addition & 1 deletion fesm2022/compiler.mjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Angular v18.1.0-next.0+sha-0d78a92
* @license Angular v18.1.0-next.0+sha-292c987
* (c) 2010-2024 Google LLC. https://angular.io/
* License: MIT
*/
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular/compiler",
"version": "18.1.0-next.0+sha-0d78a92",
"version": "18.1.0-next.0+sha-292c987",
"description": "Angular - the compiler library",
"author": "angular",
"license": "MIT",
Expand All @@ -11,7 +11,7 @@
"tslib": "^2.3.0"
},
"peerDependencies": {
"@angular/core": "18.1.0-next.0+sha-0d78a92"
"@angular/core": "18.1.0-next.0+sha-292c987"
},
"peerDependenciesMeta": {
"@angular/core": {
Expand Down

0 comments on commit f155033

Please sign in to comment.