Move the site to the 0.2.0 client and configuration - #31
Merged
Merged
Conversation
cap2UI5 0.2.0 moved the plugin's settings to cds.requires.cap2ui5, where SAP's own plugins keep theirs, and renamed `requires` to `roles`. A user without the role now gets 403 in CAP's format instead of a 401, and an app module that fails to load fails the start instead of every roundtrip. The site still taught cds.cap2ui5 and the old symptoms, and verify-refs read the options from package.json#cds.cap2ui5, which no longer exists - so it flagged every option the docs named and check has been red since. verify-refs now reads cds.requires.cap2ui5 and reports 0.1.0's cds.cap2ui5.<key> as the deprecated place. Configuration, troubleshooting, user exit, deployment and project structure describe the current keys and behaviour; AGENTS.md records them and the plugin's current layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NwpbkojNzGmuJrFdbwo5JF
Since cap2UI5 0.2.0 the client an app's main( ) receives is abap2UI5's
z2ui5_if_client under its own method names - client.check_on_navigated(),
client._bind("name"), client.view_display(xml) - and the 0.1.0 names the
whole site taught (c.isDisplay, c.bind, c.view, c.navTo ...) throw. The
quickstart installed 0.3.0 and then showed code that fails on its first
roundtrip.
Every page that teaches app code now uses the current client: the
quickstart, the guide (lifecycle, events, data binding, popups,
navigation, views, persistence), the examples, the API reference and the
comparison and migration pages. What 0.2.0 and 0.3.0 added is documented
where it belongs: the view builder z2ui5_cl_ui5_view_builder, popovers and
the second nested slot, follow_up_action and _event's s_ctrl, cell and
option bindings, preset fields on nav_app_call and typed r_data,
get_app(id), the hash methods, t.numc/date/time, this.client for helper
methods, the TypeScript declarations, and npx cap2ui5 abap2js, which
translates an ABAP app line for line. CAP's start page lists the apps in
development, so the index.html redirect tip is gone. The roadmap drops
what these releases delivered.
`cds add cap2ui5` is mentioned with a caveat: in 0.3.0 it writes its
hello.js with require, which fails the start of the ES module project
`cds init --nodejs` creates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NwpbkojNzGmuJrFdbwo5JF
The why page sent "use the OData model (see set_odata_model)" to the external-OData example's "Where the data goes", which is about keeping fetched rows in a field and says nothing about the OData model. It now names the front-end action, z2ui5_if_client.cs_event.set_odata_model, and links the client reference's section on follow_up_action( ), which runs it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NwpbkojNzGmuJrFdbwo5JF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #30. cap2UI5 0.2.0 renamed the client after
z2ui5_if_clientand moved the configuration. The site still taught 0.1.0, so the quickstart installed 0.3.0 and then showed code that fails. The 0.1.0 names (c.isDisplay,c.bind,c.view,c.navTo…) now throw. This PR also fixes the redcheckon main.Sources: cap2UI5/cap2UI5
plugin/README.md,plugin/CHANGELOG.md(0.2.0, 0.3.0) andplugin/index.d.ts. Code examples are modelled on the verified apps inexamples/bookshop/srv/apps/.Commit 1: configuration (
cds.requires.cap2ui5)scripts/verify-refs.mjspackage.json#cds.requires.cap2ui5, which yieldsapps,rolesandroutes. It used to readcds.cap2ui5, which no longer exists, so it flagged every option and main has been red since 0.2.0.cds.cap2ui5.<key>as the deprecated place.cds.requires.cap2ui5, andrequiresis nowroles.body_parser.limitand the"cap2ui5": falseswitch.overridesto load another release.requirein an ES-module project) now fails the start. It used to make every roundtrip answer 500.[cap2ui5] -prefix.Commit 2: the client, by its
z2ui5_if_clientnamesclient.mdis rewritten as the reference forz2ui5_if_client, covering every method inindex.d.ts.app-interface.mdadds the view builder and constants exports,t.numc/date/time,this.clientfor helper methods, and theClient<>TypeScript annotation.protocol.mdandarchitecture.mdare corrected.check_on_initvscheck_on_navigated_eventwitht_arg,argands_ctrlfollow_up_actionand_event_nav_app_leavenest_view_displaywith explicitmethod_insert/method_destroynav_app_callpresetsr_dataread viaget().r_event_dataget_app(id)and the hash methodsapp/…/index.htmlredirect tip is replaced by the fact that CAP's start page lists the apps in development. The ES-module failure is described as it now happens.z2ui5_cl_ui5_view_builder. Theabap.Classesworkaround and the 0.1.0c.event()warning are removed.npx cap2ui5 abap2jswith its limits and the samples it translated.Checks
npm run checkagainst current cap2UI5 and abap2UI5 main: verify-refs reports OK (no findings), and the VitePress build passes, including dead links. The code examples were not run: the runtime isn't assembled here. They follow the bookshop apps the plugin's CI runs.Worth knowing
cds add cap2ui5always writessrv/apps/hello.jswithrequire, even in the ES-module project thatcds init --nodejscreates, where that file fails the start. The fix belongs in cap2UI5'splugin/lib/add.js, which should honour"type": "module". Until then the docs mentioncds addwith that caveat and keep the hand-written, import-basedhello.jsas the main path.tiny-sampledata the quickstart searches ("Raven"), and theclient.rawexample on the client page. That example uses the same call form as the plugin itself:{ v, result: 1 }.🤖 Generated with Claude Code
https://claude.ai/code/session_01NwpbkojNzGmuJrFdbwo5JF
Generated by Claude Code