From ce49fae8ffe75ee9afacf45a0cb6c7f3ef499075 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 22 Sep 2026 23:32:25 +0000 Subject: [PATCH] Document the removal of the z2ui5 frontend global abap2UI5 (branch claude/fervent-hopper-kkyo84) removes window.z2ui5 and everything that existed to reach it: cs_event-z2ui5, the js_loader popup, the z2ui5.Util / z2ui5.Formatter globals and the z2ui5/Util module. The deprecations page records them as removed in the next release, with the raw-expression migration for cs_event-z2ui5 and core:require for the date helpers; the formatter and renaming pages stop naming the global. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GKnAQ9xpQDU2FQkDrVhNYk --- docs/advanced/renaming.md | 3 +- docs/cookbook/model/formatter.md | 4 +- docs/resources/deprecations.md | 86 ++++++++++++++++++-------------- 3 files changed, 52 insertions(+), 41 deletions(-) diff --git a/docs/advanced/renaming.md b/docs/advanced/renaming.md index 0cec0fa9..3f2e3c9c 100644 --- a/docs/advanced/renaming.md +++ b/docs/advanced/renaming.md @@ -130,7 +130,6 @@ object at all: | Form | Example | |---|---| | Module IDs | `z2ui5/core/Server`, `z2ui5/model/formatter` | -| Globals | `z2ui5.Formatter` | | Custom control XML namespace | `xmlns:z2ui5="z2ui5.cc"` → `z2ui5/cc/` | | Reserved sibling roots | `z2ui5_cci` and `z2ui5_ccc`, each served from its own BSP (see above) | @@ -228,7 +227,7 @@ apps that use a user exit are affected — everything else in the renamed installation works without a change. ::: -**The frontend namespace.** Module IDs, globals and the `z2ui5.cc` XML namespace +**The frontend namespace.** Module IDs and the `z2ui5.cc` XML namespace stay `z2ui5` in a renamed installation — see [The Frontend Namespace](#the-frontend-namespace) above. diff --git a/docs/cookbook/model/formatter.md b/docs/cookbook/model/formatter.md index 9c5e3475..8306e4f6 100644 --- a/docs/cookbook/model/formatter.md +++ b/docs/cookbook/model/formatter.md @@ -159,8 +159,8 @@ a property that wants a **JavaScript `Date` object** — `DatePicker.dateValue`, `PlanningCalendarAppointment.startDate` — and JSON has no date type, so the model physically cannot carry one. For that, and for one text case, the framework ships a small curated formatter module. It is a public contract: -`z2ui5/model/formatter`, also published as the `z2ui5.Formatter` global for -releases without `core:require`. +`z2ui5/model/formatter`, reached through `core:require` (UI5 1.74 and later). +The `z2ui5.Formatter` global that used to cover older releases is gone. Load it once on the view root, then name a helper in the binding string: diff --git a/docs/resources/deprecations.md b/docs/resources/deprecations.md index 8e9e9928..8ff49fdf 100644 --- a/docs/resources/deprecations.md +++ b/docs/resources/deprecations.md @@ -65,7 +65,10 @@ tell you what is coming if you do not. | `cs_event-wizard_set_next_step` | two `control_by_id` calls | **removed**, *next release* | | `z2ui5_cl_xml_view` | `z2ui5_cl_ui5_view_builder` | 1.143.0 | | built-in popups | the [popups add-on](https://github.com/abap2UI5-addons/popups) | 1.142.0 | -| `z2ui5.Util` | `z2ui5.Formatter` | 1.142.0 | +| `z2ui5.Util`, `z2ui5.Formatter`, module `z2ui5/Util` | `core:require` of `z2ui5/model/formatter` | **removed**, *next release* | +| `cs_event-z2ui5` | a raw expression through `follow_up_action( )` | **removed**, *next release* | +| `z2ui5_cl_pop_js_loader` | a raw expression through `follow_up_action( )` | **removed**, *next release* | +| custom JS reading `window.z2ui5` | nothing - the global is gone | **removed**, *next release* | | `cs_config-title` | `cs_event-set_title` | 1.144.0 | | `z2ui5_if_types=>…` | the same type on the object that uses it | 1.144.0 | | `z2ui5_if_exit` | `z2ui5_if_ui5_exit` | 1.144.0 | @@ -260,24 +263,6 @@ travels as the *empty* slot where the removed constant injected the literal a container in the main view — it is wider, never narrower, and only an id that exists in two open slots at once could tell the two apart. -`cs_event-z2ui5` sits in the same obsolete group. It calls a function you -registered as a `z2ui5.*` global; passing the expression straight to -`follow_up_action( )` is the same call without the indirection: - -```abap -" old -client->follow_up_action( val = client->cs_event-z2ui5 - t_arg = VALUE #( ( `myFunction` ) ) ). - -" new -client->follow_up_action( `myFunction()` ). -``` - -It still works and is still dispatched. Note that both forms ship hand-written -JavaScript from the backend to the browser — read -[Raw JavaScript](/cookbook/event_navigation/frontend#raw-javascript) before -using either. - ### `z2ui5_cl_xml_view` → `z2ui5_cl_ui5_view_builder` `z2ui5_cl_ui5_view_builder` is the generic XML view builder that replaces the @@ -543,24 +528,6 @@ and runs exactly as before, and every moved type is identical field for field, so a variable declared the old way still fits the new signatures. There is no deadline; change it when you next touch the class. -### `z2ui5.Util` → `z2ui5.Formatter` - -`z2ui5.Util` (module `z2ui5/Util`) is a backward-compatible alias that -re-exports the date helpers from `z2ui5.Formatter` (module -`z2ui5/model/formatter`). It will not gain new helpers. - -```abap -" old -|\{ path: `{ client->_bind( val = mv_date path = abap_true ) }`, - formatter: 'z2ui5.Util.DateCreateObject' \}| - -" new -|\{ path: `{ client->_bind( val = mv_date path = abap_true ) }`, - formatter: 'Formatter.DateCreateObject' \}| -``` - -See [Formatter](/cookbook/model/formatter). - ## Removed: does not compile any more Every name below is **gone from the framework**, not merely marked. A call @@ -746,3 +713,48 @@ Both paths end in the same frontend code, so the options behave identically: `dependentOn` is still resolved to a control. The raw path can do one thing more — wired into a view it needs no round-trip at all. See [Message](/cookbook/translation_messages/message). + +### The `z2ui5` frontend global + +**Removed.** The frontend kept its state on a global object, `window.z2ui5`, and +apps could reach into it from custom JavaScript. That object is gone: the +frontend keeps its state to itself, and nothing abap2UI5 ships puts anything on +`window` any more. Everything that existed only to reach the global went with +it. + +`cs_event-z2ui5` called a function you had registered as a `z2ui5.*` member. +Define the function on `window` instead and pass the call as a raw expression - +the same call without the indirection: + +```abap +" old +client->follow_up_action( val = client->cs_event-z2ui5 + t_arg = VALUE #( ( `myFunction` ) ) ). + +" new +client->follow_up_action( `myFunction()` ). +``` + +A raw expression ships hand-written JavaScript from the backend to the browser +and needs a CSP that allows `unsafe-eval` - read +[Raw JavaScript](/cookbook/event_navigation/frontend#raw-javascript) before +using it. + +`z2ui5_cl_pop_js_loader`, the built-in popup that loaded such a function onto +the global, is removed with it; the popup had nothing left to write into. + +The `z2ui5.Util` and `z2ui5.Formatter` globals, and the `z2ui5/Util` module, +are gone too. The date helpers live in `z2ui5/model/formatter`, loaded on the +view root with `core:require` (UI5 1.74 and later): + +```abap +" old +|\{ path: `{ client->_bind( val = mv_date path = abap_true ) }`, + formatter: 'z2ui5.Util.DateCreateObject' \}| + +" new - view->a( n = `core:require` v = `{Formatter: 'z2ui5/model/formatter'}` ) +|\{ path: `{ client->_bind( val = mv_date path = abap_true ) }`, + formatter: 'Formatter.DateCreateObject' \}| +``` + +See [Formatter](/cookbook/model/formatter).