Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(framework): Support custom dynamic asset paths #2305

Merged
merged 6 commits into from
Oct 7, 2020

Conversation

vladitasev
Copy link
Contributor

@vladitasev vladitasev commented Oct 6, 2020

This change introduces the option to dynamically calculate the actual asset path of each asset at runtime.

Sample usage:

// Convert OpenUI5 asset paths to real paths
import { registerAssetPathMappingFunction } from "@ui5/webcomponents-base/dist/util/EffectiveAssetPath.js";
registerAssetPathMappingFunction(path => path.startsWith("sap/") ? sap.ui.require.toUrl(path) : path);

This feature would allow the UI5 Web Components build for OpenUI5 to generate OpenUI5-friendly paths.

Example:

	var ar = "sap/ui/webcomponents/thirdparty/_assets/messagebundle_ar.d20c665dc46a6f9b.json";
	var bg = "sap/ui/webcomponents/thirdparty/_assets/messagebundle_bg.38428028ff3b1869.json";
	var ca = "sap/ui/webcomponents/thirdparty/_assets/messagebundle_ca.c46423cc94896604.json";
	var cs = "sap/ui/webcomponents/thirdparty/_assets/messagebundle_cs.d9d68b2690954b4e.json";
	var da = "sap/ui/webcomponents/thirdparty/_assets/messagebundle_da.1189e997523b89f6.json";
	var de = "sap/ui/webcomponents/thirdparty/_assets/messagebundle_de.1edf86f620dd657a.json";

and then have these paths converted to URLs at runtime.

Note: the asset path mapping is applied independently of configured assetsPath. Both are rarely expected to be used at the same time.

@vladitasev vladitasev changed the title feat(framework): Support OpenUI5 asset paths feat(framework): Support custom dynamic asset paths Oct 7, 2020
@vladitasev vladitasev merged commit ff245fa into master Oct 7, 2020
@vladitasev vladitasev deleted the openui5-module-paths-support branch October 7, 2020 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants