From 1e8d9c997691f2d9e82cb8298031e7a0ef73755a Mon Sep 17 00:00:00 2001 From: LongYinan Date: Sun, 4 Oct 2026 22:58:58 +0800 Subject: [PATCH] 0.0.40 --- CHANGELOG.md | 14 ++++ napi/angular-compiler/index.d.ts | 10 +++ napi/angular-compiler/index.js | 128 ++++++++++++++++------------- napi/angular-compiler/package.json | 2 +- 4 files changed, 96 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 613e06e1f..bbe4e58c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.0.40 - 2026-10-04 + +- Aligned the DOM sanitization schema with Angular v22: SVG, i18n, and host-binding sinks, plus promoting unknown bare elements for element bindings. +- Compiled `inputs:`, `outputs:`, and `queries:` declared in decorator metadata, and validated input transforms like ngtsc. +- Added `ngAcceptInputType_*` typing from the transform's parameter type. +- Recognized Angular decorators and signal APIs by their `@angular/core` import, matching ngtsc. +- Fixed decorator metadata dropping object methods, accessors, and computed keys. +- Fixed the linker for `ɵ` identifiers written as `\u0275` escapes, template literals in styles and host bindings, and the file's own `@angular/core` namespace in generated templates. +- Fixed incomplete `@let` declarations to report like Angular. +- Ported `specializeControlProperties` for Angular >= 21.2 (Angular 22.2 compat). +- Fixed i18n parity for attribute and ICU messages. +- Fixed template HMR component ids containing `@`. +- Updated Oxc to 0.152, napi-rs, and other dependencies. + ## 0.0.39 - 2026-09-21 - Fixed JIT mode leaving dead bare imports when every specifier of an import statement is an inline `type` specifier. diff --git a/napi/angular-compiler/index.d.ts b/napi/angular-compiler/index.d.ts index a9a6471d5..8ed370ee6 100644 --- a/napi/angular-compiler/index.d.ts +++ b/napi/angular-compiler/index.d.ts @@ -1,5 +1,14 @@ /* auto-generated by NAPI-RS */ /* eslint-disable */ + +/** + * Which binding artifact the generated loader actually loaded: `'native'` for + * a native addon, otherwise the `platformArchABI` of the WASI flavor. Every + * flavor napi-rs can build is listed, because `NAPI_RS_NATIVE_LIBRARY_PATH` + * can point the loader at a WASI artifact this package does not build itself. + */ +export declare const __napiBindingTarget: 'native' | 'wasm32-wasi' | 'wasm32-wasip1' + /** Angular version for version-conditional behavior. */ export interface AngularVersion { /** Major version number (e.g., 19 for Angular 19.0.0). */ @@ -930,6 +939,7 @@ export interface TransformResult { */ dtsDeclarations: Array } + export interface Comment { type: 'Line' | 'Block' value: string diff --git a/napi/angular-compiler/index.js b/napi/angular-compiler/index.js index 24499fc8e..96b5ce828 100644 --- a/napi/angular-compiler/index.js +++ b/napi/angular-compiler/index.js @@ -1,14 +1,16 @@ -// prettier-ignore /* eslint-disable */ // @ts-nocheck /* auto-generated by NAPI-RS */ import { createRequire } from 'module' const require = createRequire(import.meta.url) -const __dirname = new URL('.', import.meta.url).pathname const { readFileSync } = require('fs') let nativeBinding = null +// Which artifact actually loaded. The WASI fallback chain overwrites it with +// the flavor it resolved; the late native retry below leaves it alone because +// it only runs while no WASI candidate has been loaded. +let __napiLoadedBindingTarget = 'native' const loadErrors = [] const isMusl = () => { @@ -67,7 +69,16 @@ const isMuslFromChildProcess = () => { function requireNative() { if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) { try { - return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH) + const overrideBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH) + // The override may be a generated WASI loader, which already reports its + // own flavor. Adopt it: `module.exports` aliases this object, so claiming + // 'native' would both misreport the artifact and overwrite the loader's + // marker through the alias. + __napiLoadedBindingTarget = + overrideBinding && typeof overrideBinding.__napiBindingTarget === 'string' + ? overrideBinding.__napiBindingTarget + : 'native' + return overrideBinding } catch (err) { loadErrors.push(err) } @@ -83,12 +94,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-android-arm64/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -106,12 +117,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-android-arm-eabi/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -141,12 +152,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-win32-x64-gnu/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -164,12 +175,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-win32-x64-msvc/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -188,12 +199,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-win32-ia32-msvc/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -211,12 +222,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-win32-arm64-msvc/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -237,12 +248,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-darwin-universal/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -260,12 +271,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-darwin-x64/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -283,12 +294,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-darwin-arm64/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -310,12 +321,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-freebsd-x64/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -333,12 +344,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-freebsd-arm64/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -361,12 +372,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-linux-x64-musl/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -384,12 +395,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-linux-x64-gnu/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -409,12 +420,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-linux-arm64-musl/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -432,12 +443,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-linux-arm64-gnu/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -457,12 +468,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-linux-arm-musleabihf/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -480,12 +491,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-linux-arm-gnueabihf/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -505,12 +516,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-linux-loong64-musl/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -528,12 +539,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-linux-loong64-gnu/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -553,12 +564,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-linux-riscv64-musl/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -576,12 +587,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-linux-riscv64-gnu/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -600,12 +611,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-linux-ppc64-gnu/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -623,12 +634,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-linux-s390x-gnu/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -650,12 +661,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-openharmony-arm64/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -673,12 +684,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-openharmony-x64/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -696,12 +707,12 @@ function requireNative() { const bindingPackageVersion = require('@oxc-angular/binding-openharmony-arm/package.json').version if ( - bindingPackageVersion !== '0.0.39' && + bindingPackageVersion !== '0.0.40' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) { throw new Error( - `Native binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `Native binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } return binding @@ -816,6 +827,7 @@ if (!nativeBinding || forceWasi) { if (!candidateFailed) { wasiBinding = require('./angular-compiler.wasi.cjs') nativeBinding = wasiBinding + __napiLoadedBindingTarget = 'wasm32-wasi' wasiBindingLoaded = true } } catch (err) { @@ -844,14 +856,15 @@ if (!nativeBinding || forceWasi) { ) { const bindingPackageVersion = require('@oxc-angular/binding-wasm32-wasi/package.json').version - if (bindingPackageVersion !== '0.0.39') { + if (bindingPackageVersion !== '0.0.40') { throw new Error( - `WASI binding package version mismatch, expected 0.0.39 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, + `WASI binding package version mismatch, expected 0.0.40 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`, ) } } wasiBinding = require('@oxc-angular/binding-wasm32-wasi') nativeBinding = wasiBinding + __napiLoadedBindingTarget = 'wasm32-wasi' wasiBindingLoaded = true } } catch (err) { @@ -934,3 +947,4 @@ export { parseComponentId } export { transformAngularFile } export { transformAngularFileSync } export { Severity } +export const __napiBindingTarget = __napiLoadedBindingTarget diff --git a/napi/angular-compiler/package.json b/napi/angular-compiler/package.json index 5f1cdd9e3..371eb5d70 100644 --- a/napi/angular-compiler/package.json +++ b/napi/angular-compiler/package.json @@ -1,6 +1,6 @@ { "name": "@oxc-angular/vite", - "version": "0.0.39", + "version": "0.0.40", "description": "Oxc Angular Compiler Vite plugin", "keywords": [ "angular",