From f607cedce3ddcb57789398e118e35ac6da103b79 Mon Sep 17 00:00:00 2001 From: Peter Muessig Date: Tue, 10 Sep 2024 08:21:18 +0200 Subject: [PATCH] feat(ui5-tooling-modules): addToNamespace=true is the default now --- packages/ui5-tooling-modules/README.md | 4 ++-- packages/ui5-tooling-modules/lib/task.js | 1 + showcases/ui5-app-simple/ui5.yaml | 3 ++- showcases/ui5-app/ui5-pwa.yaml | 3 --- showcases/ui5-app/ui5.yaml | 2 -- showcases/ui5-tsapp-webc/ui5.yaml | 1 - showcases/ui5-tsapp/ui5.yaml | 2 -- showcases/ui5-tslib/ui5.yaml | 1 - 8 files changed, 5 insertions(+), 12 deletions(-) diff --git a/packages/ui5-tooling-modules/README.md b/packages/ui5-tooling-modules/README.md index 54261fbe8..9db00d4ad 100644 --- a/packages/ui5-tooling-modules/README.md +++ b/packages/ui5-tooling-modules/README.md @@ -114,9 +114,9 @@ The following configuration options are just relevant for the `task`:   - *addToNamespace*: `boolean|string` - Puts 3rd party modules into the namespace of the Component to make them Component-local. All used 3rd party modules will be moved by default into the sub-namespace `thirdparty` of the Component namespace at build time. If you use a string as value of `addToNamespace` you can define a custom namespace, e.g. `my/namespace/for/libs` which will be nested in the Components' namespace. With that option you can run your application using 3rd party modules in a Fiori launchpad environment. (defaults to `false`, disables *prependPathMappings* when set to `true`) + Puts 3rd party modules into the namespace of the Component to make them Component-local. All used 3rd party modules will be moved by default into the sub-namespace `thirdparty` of the Component namespace at build time. If you use a string as value of `addToNamespace` you can define a custom namespace, e.g. `my/namespace/for/libs` which will be nested in the Components' namespace. With that option you can run your application using 3rd party modules in a Fiori launchpad environment. In some cases (wrong dependency rewrite, wish to keep 3rd party modules in the `resources` path, ...) it might be necessary to disable this option. (defaults to `true`, disables *prependPathMappings* when set to `true`)   - > :warning: While this works great for any non-UI5 3rd party module, there are limitations for the consumption of UI5 modules from custom control 3rd party modules (NPM packages). The UI5 module names (used for `Object.extend(...)`, aggregation types, ...) are not rewritten and this may cause issues. UI5 assumes that the used module path (slash syntax) is matching the module name (dot syntax). This can lead to issues for `Object.isA(...)` checks, Renderer lookups (when not inlined or referenced by module), or for any other API which derives the module name from the module path or vice versa. + > :warning: While this works great for any non-UI5 3rd party module, there are limitations for the consumption of UI5 modules from custom control 3rd party modules (NPM packages). The UI5 module names (used for `Object.extend(...)`, aggregation types, ...) are not rewritten and this may cause issues. UI5 assumes that the used module path (slash syntax) is matching the module name (dot syntax). This can lead to issues for `Object.isA(...)` checks, Renderer lookups (when not inlined or referenced by module), or for any other API which derives the module name from the module path or vice versa. If you encounter such issues you may consider to disable the option and instruct the loader via `sap.ui.loader.config({ paths: ... })` to load the resources properly. - *removeScopePrefix*: `boolean` Removes the scope prefix `@` from the namespace/path of the 3rd party module when adding it to the namespace with the *addToNamespace* option. diff --git a/packages/ui5-tooling-modules/lib/task.js b/packages/ui5-tooling-modules/lib/task.js index eac8028a2..e0f8cc2d6 100644 --- a/packages/ui5-tooling-modules/lib/task.js +++ b/packages/ui5-tooling-modules/lib/task.js @@ -60,6 +60,7 @@ module.exports = async function ({ log, workspace, taskUtil, options }) { { debug: false, skipTransform: false, + addToNamespace: true, }, options.configuration, ); diff --git a/showcases/ui5-app-simple/ui5.yaml b/showcases/ui5-app-simple/ui5.yaml index de4d14f1a..34f1acece 100644 --- a/showcases/ui5-app-simple/ui5.yaml +++ b/showcases/ui5-app-simple/ui5.yaml @@ -21,7 +21,8 @@ builder: afterTask: ui5-tooling-transpile-task configuration: debug: true - addToNamespace: true + addToNamespace: false + prependPathMappings: true - name: ui5-task-zipper afterTask: generateVersionInfo configuration: diff --git a/showcases/ui5-app/ui5-pwa.yaml b/showcases/ui5-app/ui5-pwa.yaml index 272c48d9c..c70119862 100644 --- a/showcases/ui5-app/ui5-pwa.yaml +++ b/showcases/ui5-app/ui5-pwa.yaml @@ -45,9 +45,6 @@ builder: afterTask: replaceVersion - name: ui5-tooling-modules-task afterTask: replaceVersion - configuration: - prependPathMappings: true - addToNamespace: true - name: ui5-task-pwa-enabler afterTask: generateVersionInfo configuration: diff --git a/showcases/ui5-app/ui5.yaml b/showcases/ui5-app/ui5.yaml index 07312fa7c..73bb4fea0 100644 --- a/showcases/ui5-app/ui5.yaml +++ b/showcases/ui5-app/ui5.yaml @@ -76,8 +76,6 @@ builder: afterTask: ui5-tooling-transpile-task configuration: debug: true - prependPathMappings: true - addToNamespace: true removeScopePrefix: true includeAssets: "@octokit/core": diff --git a/showcases/ui5-tsapp-webc/ui5.yaml b/showcases/ui5-tsapp-webc/ui5.yaml index c494a16f5..0664bc23b 100644 --- a/showcases/ui5-tsapp-webc/ui5.yaml +++ b/showcases/ui5-tsapp-webc/ui5.yaml @@ -20,7 +20,6 @@ builder: afterTask: ui5-tooling-transpile-task configuration: debug: true - addToNamespace: true server: customMiddleware: - name: ui5-tooling-transpile-middleware diff --git a/showcases/ui5-tsapp/ui5.yaml b/showcases/ui5-tsapp/ui5.yaml index 8a92bd97e..e109a4482 100644 --- a/showcases/ui5-tsapp/ui5.yaml +++ b/showcases/ui5-tsapp/ui5.yaml @@ -50,8 +50,6 @@ builder: afterTask: ui5-tooling-transpile-task configuration: <<: *cfgModules - prependPathMappings: false - addToNamespace: true providedDependencies: - moment - name: ui5-task-copyright diff --git a/showcases/ui5-tslib/ui5.yaml b/showcases/ui5-tslib/ui5.yaml index a283f5e17..3ee755c30 100644 --- a/showcases/ui5-tslib/ui5.yaml +++ b/showcases/ui5-tslib/ui5.yaml @@ -20,7 +20,6 @@ builder: afterTask: ui5-tooling-transpile-task configuration: debug: true - addToNamespace: true server: customMiddleware: - name: ui5-tooling-transpile-middleware