babel-preset-transform-ui5 7.9.0 → 7.11.0
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.
- package/CHANGELOG.md +91 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,96 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 7.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#162](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/pull/162) [`db2ad98`](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/db2ad98648ac7971d7b6cc1264b8d7b32d4b0b56) Thanks [@petermuessig](https://github.com/petermuessig)! - feat: auto-detect UI5 extend-classes by filename suffix and known base-class module paths
|
|
8
|
+
|
|
9
|
+
## What's new
|
|
10
|
+
- **Auto-detection by known UI5 base classes**: Classes extending from known UI5 base-class module paths (e.g. `sap/ui/core/mvc/Controller`, `sap/ui/core/Control`, `sap/ui/base/ManagedObject`) are automatically converted to `.extend()` syntax without requiring explicit `@alias` or `@namespace` annotations. Controlled by new `autoConvertKnownUI5Classes` option (defaults to true).
|
|
11
|
+
|
|
12
|
+
- **Transitive inheritance resolution**: Auto-detection walks the superclass chain through local files (order-independent via on-demand ancestor reading from disk) and detects UI5 ancestry even through multiple levels of custom base classes.
|
|
13
|
+
|
|
14
|
+
- **File-type suffix detection**: New `autoConvertUI5FileTypes` option detects and converts classes based on filename patterns (`.controller.js|ts` and `.view.js|ts|jsx|tsx`). Controllers preserve legacy behavior (no namespace required). Views require a resolvable namespace.
|
|
15
|
+
|
|
16
|
+
- **Custom base-class paths**: New `additionalUI5Classes` option allows registering project-specific base-class module paths for auto-detection, supplementing the built-in UI5 class list.
|
|
17
|
+
|
|
18
|
+
- **Cycle detection**: Inheritance chain walking correctly handles cycles (A extends B extends A) via visited-set tracking instead of depth limits.
|
|
19
|
+
|
|
20
|
+
- **Watch-mode cache fixes**: Fixed stale cache entries persisting across rebuilds when files are renamed or deleted mid-watch. The `importDeclarations` cache entry is now cleared (not just overwritten) during re-processing.
|
|
21
|
+
|
|
22
|
+
- **Unmatched path warnings**: Added `console.warn` diagnostic when `additionalUI5Classes` paths are configured but never matched by any import in the build, helping catch typos and misconfigurations.
|
|
23
|
+
|
|
24
|
+
## Breaking changes
|
|
25
|
+
|
|
26
|
+
None. All new features are opt-in or preserve existing behavior.
|
|
27
|
+
|
|
28
|
+
**Internal API note:** `getImportDeclaration` (in `src/classes/helpers/imports.js`) now matches
|
|
29
|
+
`import { Foo as Bar }` by the _local_ binding name (`Bar`) rather than the _imported_ name (`Foo`).
|
|
30
|
+
This is the correct semantics — callers always pass the name as it appears at the use site — but if
|
|
31
|
+
you maintain a fork or plugin that calls this helper directly by the imported name, update those call
|
|
32
|
+
sites to pass the local name instead.
|
|
33
|
+
|
|
34
|
+
- [#168](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/pull/168) [`e31c07f`](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/e31c07f2e47478ae77e00e135d60c4c8fb896c88) Thanks [@petermuessig](https://github.com/petermuessig)! - feat: add `@movePropsToConstructor` per-property annotation to opt out of `moveControllerPropsToOnInit` ([#116](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/116))
|
|
35
|
+
|
|
36
|
+
When `moveControllerPropsToOnInit` is enabled, individual class properties can be kept in the
|
|
37
|
+
constructor by annotating them with `@movePropsToConstructor` (JSDoc block comment or decorator):
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
export default class MyController extends Controller {
|
|
41
|
+
/** Normal prop — moves to onInit as usual */
|
|
42
|
+
prop = 1;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @movePropsToConstructor
|
|
46
|
+
*/
|
|
47
|
+
formatter = { formatValue: (v: string) => v }; // stays in constructor
|
|
48
|
+
|
|
49
|
+
handler = () => true; // moves to onInit as usual
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- [#167](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/pull/167) [`d021d2e`](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/d021d2e6422494931ddeb8944ac443facc2c5e4b) Thanks [@petermuessig](https://github.com/petermuessig)! - fix: avoid crash when a default export uses `Object.assign(Object.create(null), …)` alongside named exports ([#148](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/148))
|
|
56
|
+
|
|
57
|
+
`getPropertiesOfObjectAssignOrExtendHelper` no longer leaks `undefined` entries for call-expression arguments
|
|
58
|
+
(e.g. `Object.create(null)`), which previously caused `Cannot read properties of undefined (reading 'key')` during
|
|
59
|
+
export collapsing.
|
|
60
|
+
|
|
61
|
+
- [#166](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/pull/166) [`506985d`](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/506985d2d5f9004faad9f4cbd9b5e4c04b4bd052) Thanks [@petermuessig](https://github.com/petermuessig)! - fix: handle string-literal import names and object property keys; escape regex metacharacters in noImportInteropPrefixes
|
|
62
|
+
|
|
63
|
+
Picks up the still-relevant fixes from PR [#163](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/163) (thanks @mauriciolauffer):
|
|
64
|
+
|
|
65
|
+
- Named imports using string-literal specifiers (`import { "some-export" as local } from "mod"`) now produce correct destructure output instead of `undefined`.
|
|
66
|
+
- `noImportInteropPrefixes` entries are now regex-escaped before being embedded in the regexp pattern, preventing metacharacters from acting as wildcards.
|
|
67
|
+
- `getPropNames` and `groupPropertiesByName` in `utils/ast.js` now handle `StringLiteral` property keys in addition to `Identifier` keys.
|
|
68
|
+
|
|
69
|
+
- Updated dependencies [[`db2ad98`](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/db2ad98648ac7971d7b6cc1264b8d7b32d4b0b56), [`e31c07f`](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/e31c07f2e47478ae77e00e135d60c4c8fb896c88), [`d021d2e`](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/d021d2e6422494931ddeb8944ac443facc2c5e4b), [`506985d`](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/506985d2d5f9004faad9f4cbd9b5e4c04b4bd052)]:
|
|
70
|
+
- babel-plugin-transform-modules-ui5@7.11.0
|
|
71
|
+
|
|
72
|
+
## 7.10.0
|
|
73
|
+
|
|
74
|
+
### Minor Changes
|
|
75
|
+
|
|
76
|
+
- [#154](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/pull/154) [`f62f9fb`](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/f62f9fba1a64dea2673662dd163fcc1eb5cff540) Thanks [@bbogovich-sap](https://github.com/bbogovich-sap)! - Add two comment pragmas to opt out of module transformation:
|
|
77
|
+
|
|
78
|
+
- `/* @ui5-no-wrap */` (file level) leaves a module completely unwrapped —
|
|
79
|
+
no `sap.ui.define`/`sap.ui.require` and no import/export rewriting — while
|
|
80
|
+
still stripping TypeScript types. Intended for modules consumed as native
|
|
81
|
+
ES modules, e.g. web workers.
|
|
82
|
+
- `/* @ui5-ignore-import */` (statement level) excludes a single static
|
|
83
|
+
`import` or dynamic `import()` from being converted into a UI5 dependency.
|
|
84
|
+
|
|
85
|
+
Note: `@ui5-ignore-import` on a static import only yields valid output in an
|
|
86
|
+
unwrapped module (no exports, or together with `@ui5-no-wrap`); a leftover
|
|
87
|
+
ES `import` inside a `sap.ui.define` factory is not valid at runtime.
|
|
88
|
+
|
|
89
|
+
### Patch Changes
|
|
90
|
+
|
|
91
|
+
- Updated dependencies [[`f62f9fb`](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/f62f9fba1a64dea2673662dd163fcc1eb5cff540)]:
|
|
92
|
+
- babel-plugin-transform-modules-ui5@7.10.0
|
|
93
|
+
|
|
3
94
|
## 7.9.0
|
|
4
95
|
|
|
5
96
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babel-preset-transform-ui5",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.11.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"directory": "packages/preset"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"babel-plugin-transform-modules-ui5": "^7.
|
|
15
|
+
"babel-plugin-transform-modules-ui5": "^7.11.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"prettier": "3.9.0"
|
|
@@ -36,4 +36,4 @@
|
|
|
36
36
|
"ts",
|
|
37
37
|
"preset"
|
|
38
38
|
]
|
|
39
|
-
}
|
|
39
|
+
}
|