From 43cb43a9c124214250da5c5890bd535efee131f2 Mon Sep 17 00:00:00 2001 From: akudev Date: Mon, 28 Oct 2024 13:46:52 +0100 Subject: [PATCH 1/2] UI5 2.x instructions --- README.md | 27 ++++++++++++++++++++++++++- package.json | 2 +- webapp/index.html | 2 +- webapp/test.html | 2 +- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5b5998bc..e503317b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,32 @@ -# A Small TypeScript UI5 Example App +# A Small TypeScript UI5 Example App - UI5 2.x Version [![REUSE status](https://api.reuse.software/badge/github.com/SAP-samples/ui5-typescript-helloworld)](https://api.reuse.software/info/github.com/SAP-samples/ui5-typescript-helloworld) +## *IMPORTANT* - This is the UI5 2.x Branch! Info in this Section only + +This branch demonstrates how a UI5 application written in TypeScript can already make use of UI5 2.0 and the UI5 2.0 type definitions before the official release. + +> ***NOTE:*** This branch is an exact copy of the `main` branch, except for this section here. There is no UI5 2.x specific information in other parts of the documentation; the other parts may even contradict because they have not been adapted. But actually, the difference is minimal and can be fully described as follows: + +To adapt the app to use the preview version of OpenUI5 2.0: +1. Change the bootstrap to load UI5 from https://sdk.openui5.org/nightly/2/. You can do so by changing the UI5 URL in `index.html` from just `src="resources/sap-ui-core.js"` to: + ``` + src="https://sdk.openui5.org/nightly/2/resources/sap-ui-core.js" + ``` + The same can be done in `test.html`. + *Note:* there is no UI5 2.x version available from npm or via the UI5 tooling yet. +2. Change the line in `package.json`, which declares the `@openui5/types` dev dependency, to: + ``` + "@types/openui5": "https://sdk.openui5.org/nightly/2/-/types.tgz", + ``` + Then, do `npm install` again. + +Everything else in the app can remain unchanged, as it is already built according to the best practices. Also, all instructions in the `main` branch for UI5 1.x still apply (except the two changes above). + +To summarize, you can test your existing app's compatibility with OpenUI5 2.x by loading the framework from https://sdk.openui5.org/nightly/2/resources/sap-ui-core.js and using the type definitions from https://sdk.openui5.org/nightly/2/-/types.tgz. + +The SAPUI5 2.x preview framework and type definitions are not yet available. + ## Description This app demonstrates a TypeScript setup for developing UI5 applications. diff --git a/package.json b/package.json index f2b00d8d..f8090a7a 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "url": "https://github.com/SAP-samples/ui5-typescript-helloworld.git" }, "devDependencies": { - "@types/openui5": "1.127.0", + "@types/openui5": "https://sdk.openui5.org/nightly/2/-/types.tgz", "@ui5/cli": "^4", "@ui5/linter": "^1.1.1", "eslint": "^9.13.0", diff --git a/webapp/index.html b/webapp/index.html index c7d5e002..618cfb69 100644 --- a/webapp/index.html +++ b/webapp/index.html @@ -4,7 +4,7 @@ UI5 TypeScript Hello World App