From 6ee05138546543f8200dc2d2dbb66f56865f9343 Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Wed, 28 Jun 2023 18:05:11 +0800 Subject: [PATCH] Update docs (19422) Signed-off-by: ester.zhou --- .../OpenHarmony_3.2.9.1/changelogs-arkui.md | 46 +++---- .../OpenHarmony_4.0.7.3/changelog-web.md | 126 ++++++++++++++++++ .../OpenHarmony_4.0.7.5/changelogs-arkui.md | 17 +++ .../changelogs/v4.0-beta1/Readme-EN.md | 5 + .../changelogs/v4.0-beta1/changelogs-arkui.md | 95 +++++++++++++ .../changelogs/v4.0-beta1/changelogs-web.md | 126 ++++++++++++++++++ .../v4.0-beta1/figures/stack_after.jpg | Bin 0 -> 13672 bytes .../v4.0-beta1/figures/stack_before.jpg | Bin 0 -> 14566 bytes 8 files changed, 392 insertions(+), 23 deletions(-) create mode 100644 en/release-notes/changelogs/OpenHarmony_4.0.7.3/changelog-web.md create mode 100644 en/release-notes/changelogs/OpenHarmony_4.0.7.5/changelogs-arkui.md create mode 100644 en/release-notes/changelogs/v4.0-beta1/changelogs-arkui.md create mode 100644 en/release-notes/changelogs/v4.0-beta1/changelogs-web.md create mode 100644 en/release-notes/changelogs/v4.0-beta1/figures/stack_after.jpg create mode 100644 en/release-notes/changelogs/v4.0-beta1/figures/stack_before.jpg diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-arkui.md b/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-arkui.md index 80e5645eba..b962d69665 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-arkui.md +++ b/en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-arkui.md @@ -2,15 +2,15 @@ ## cl.arkui.1 xcomponent API Change -The following APIs of the **xcomponent** component of the ArkUI subsystem are changed: +Changed the following APIs of the **xcomponent** component of the ArkUI subsystem: - - **getXComponentSurfaceId** and **setXComponentSurfaceSize**: The **@systemapi** tag is removed. - - **getXComponentSurfaceId**, **getXComponentContext**, and **setXComponentSurfaceSize**: The return value types are specified. + - **getXComponentSurfaceId** and **setXComponentSurfaceSize**: Removed the **@systemapi** tag. + - **getXComponentSurfaceId**, **getXComponentContext**, and **setXComponentSurfaceSize**: Specified return value types. -You need to adapt your applications based on the following information. +You need to adapt your application based on the following information. -**Change Impacts** +**Change Impact** Released JS APIs are affected. The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. @@ -27,35 +27,35 @@ Startup rules for different scenarios are as follows: Adaptions to be made: - **getXComponentSurfaceId** - - OpenHarmony 3.2 Beta3 rules: + - In OpenHarmony 3.2 Beta3: - System API - No specified return value - - OpenHarmony 3.2 Beta4 rules: + - In OpenHarmony 3.2 Beta4: - Public API - Return value type specified as string - You need to process the return value as a string. - **setXComponentSurfaceSize** - - OpenHarmony 3.2 Beta3 rules: + - In OpenHarmony 3.2 Beta3: - System API - No specified return value - - OpenHarmony 3.2 Beta4 rules: + - In OpenHarmony 3.2 Beta4: - Public API - Return value type specified as void - You need to process the return value as a void. - **getXComponentContext** - - OpenHarmony 3.2 Beta3 rules: + - In OpenHarmony 3.2 Beta3: - No specified return value - - OpenHarmony 3.2 Beta4 rules: + - In OpenHarmony 3.2 Beta4: - Return value type specified as object - You need to process the return value as an object. - + ## cl.arkui.2 Change of Styles of Popup Component and APIs The styles of the **alertDialog**, **actionSheet**, and **customDialog** components, as well as the **prompt** and **promptAction** APIs were changed. Specifically speaking: The popup background blurring effect is added to **promptAction.showDialog**, **promptAction.showActionMenu**, **alertDialog**, **actionSheet**, and **customDialog**. -**Change Impacts** +**Change Impact** The popup background blurring effect is set by default. @@ -70,9 +70,10 @@ No adaptation is required. ## cl.arkui.3 Supplementation of the Initialization Mode and Restriction Verification Scenarios of Custom Components' Member Variables -For details, see [Restrictions and Extensions](../../../application-dev/quick-start/arkts-restrictions-and-extensions.md). +Added verification for scenarios previously left out concerning initialization of custom components' member variables. + -**Change Impacts** +**Change Impact** If custom components' member variables are initialized or assigned with values not according to the document specifications, an error will be reported during compilation. @@ -86,10 +87,10 @@ Make modification according to specifications in the above document. ## cl.arkui.4 Supplementation of Verification Scenarios of Value Assignment Restrictions on Member Variables of Custom Parent Components and Child Components -For details, see [Restrictions and Extensions](../../../application-dev/quick-start/arkts-restrictions-and-extensions.md). +Added verification for scenarios previously left out concerning value assignment of member variables of custom parent components and child components. -**Change Impacts** +**Change Impact** If member variables of the parent component or child component are initialized not according to the document specifications, an error will be reported during compilation. @@ -101,14 +102,13 @@ N/A Make modification according to specifications in the above document, using other decorators or normal member variables for value assignment. -## cl.arkui.5 Supplementation of Verification for a Single Subcomponent - -Verification for a single subcomponent is enabled for the following components: **Button**, **FlowItem**, **GridItem**, **GridCol**, **ListItem**, **Navigator**, **Refresh**, **RichText**, **ScrollBar**, **StepperItem**, and **TabContent**. +## cl.arkui.5 Supplementation of Verification for a Single Child Component +Added verification for a single child component for the following components: **Button**, **FlowItem**, **GridItem**, **GridCol**, **ListItem**, **Navigator**, **Refresh**, **RichText**, **ScrollBar**, **StepperItem**, and **TabContent**. -**Change Impacts** +**Change Impact** -If one of the preceding components contains more than one subcomponent, an error will be reported during compilation. +If one of the preceding components contains more than one child component, an error will be reported during compilation. **Key API/Component Changes** @@ -123,4 +123,4 @@ RichText('RichText') { **Adaptation Guide** -Make modification based on the error message. Make sure that the specified component contains only one subcomponent. +Make modification based on the error message. Make sure that the specified component contains only one child component. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.7.3/changelog-web.md b/en/release-notes/changelogs/OpenHarmony_4.0.7.3/changelog-web.md new file mode 100644 index 0000000000..f3ee5e7e3d --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_4.0.7.3/changelog-web.md @@ -0,0 +1,126 @@ +# Web Subsystem Changelog + +Compared with earlier versions, OpenHarmony 4.0.7.3 has the following API changes in its web subsystem: + +## cl.web.1 New Input Parameter Type of the setResponseData API + +Added the input parameter type **Resource** for the **setResponseData** API. + +**Change Impact** + +In the scenario where a HAP file is not decompressed, the file path in the HAP does not exist. Under this scenario, to access resources in the HAP file, you must use the input parameter **data:Resource** instead of **data:number**. + + +**Key API/Component Changes** + +- Involved APIs: + + setResponseData + +- Before change: + + ```ts + setResponseData(data: string | number) + ``` + +- After change: + + ```ts + setResponseData(data: string | number | Resource) + ``` + +**Adaptation Guide** + +When a HAP file is decompressed, open the hold the FD of the target resource file, and then transfer the resource response data to the kernel through **setResponseData(data:number)**. + +```ts +// xxx.ets +import web_webview from '@ohos.web.webview' +import fileio from '@ohos.fileio'; + +@Entry +@Component +struct WebComponent { + controller: web_webview.WebviewController = new web_webview.WebviewController() + responseweb: WebResourceResponse = new WebResourceResponse() + heads: Header[] = new Array() + + build() { + Column() { + Web({ src: 'www.example.com', controller: this.controller }) + .onInterceptRequest((event) => { + console.log('url:' + event.request.getRequestUrl()) + var head1:Header = { + headerKey:"Connection", + headerValue:"keep-alive" + } + var head2:Header = { + headerKey:"Cache-Control", + headerValue:"no-cache" + } + var length = this.heads.push(head1) + length = this.heads.push(head2) + this.responseweb.setResponseHeader(this.heads) + this.responseweb.setResponseEncoding('utf-8') + this.responseweb.setResponseMimeType('text/html') + this.responseweb.setResponseCode(200) + this.responseweb.setReasonMessage('OK') + + //// fd scheme --start + // '/xxx/.../test.html' is the local path of the file. + // @ts-ignore + let fd = fileio.openSync('/xxx/.../test.html', 0o102, 0o666) + this.responseweb.setResponseData(fd) + //// fd scheme --end + + return this.responseweb + }) + } + } +} +``` + +When a HAP file is decompressed, the file path in the HAP does not exist. In this case, transfer the resource response data to the kernel through **setResponseData(data:Resource)**. +```ts +// xxx.ets +import web_webview from '@ohos.web.webview' + +@Entry +@Component +struct WebComponent { + controller: web_webview.WebviewController = new web_webview.WebviewController() + responseweb: WebResourceResponse = new WebResourceResponse() + heads: Header[] = new Array() + + build() { + Column() { + Web({ src: 'www.example.com', controller: this.controller }) + .onInterceptRequest((event) => { + console.log('url:' + event.request.getRequestUrl()) + var head1:Header = { + headerKey:"Connection", + headerValue:"keep-alive" + } + var head2:Header = { + headerKey:"Cache-Control", + headerValue:"no-cache" + } + var length = this.heads.push(head1) + length = this.heads.push(head2) + this.responseweb.setResponseHeader(this.heads) + this.responseweb.setResponseEncoding('utf-8') + this.responseweb.setResponseMimeType('text/html') + this.responseweb.setResponseCode(200) + this.responseweb.setReasonMessage('OK') + + //// Resource scheme --start + // Specify the target file in the rawfile directory of the HAP file. + this.responseweb.setResponseData($rawfile('test.html')) + //// Resource scheme --end + + return this.responseweb + }) + } + } +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.7.5/changelogs-arkui.md b/en/release-notes/changelogs/OpenHarmony_4.0.7.5/changelogs-arkui.md new file mode 100644 index 0000000000..1e42e43eda --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_4.0.7.5/changelogs-arkui.md @@ -0,0 +1,17 @@ +# ArkUI Subsystem Changelog + +## cl.arkui.1 Change in the \