Skip to content

Document URL parts and rich-text changes in lib-portal (XP 8.1) - #90

Merged
rymsha merged 12 commits into
masterfrom
claude/page-url-parts-base
Oct 6, 2026
Merged

rymsha merged 12 commits into
masterfrom
claude/page-url-parts-base

Conversation

@rymsha

@rymsha rymsha commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Companion to enonic/xp#12420 (XP 8.1; master port enonic/xp#12395), its follow-ups enonic/xp#12435 and enonic/xp#12437, and enonic/app-guillotine#1542 and enonic/app-guillotine#1558, for XP 8.1.0. Guillotine's docs link here for what each URL component holds, so the anchors #portalscope, #pageurlparts, #imageurlparts, #attachmenturlparts and #processhtmlparts are what it references.

Changes

  • docs/libraries/lib-portal.adoc
    • Base URLs gains two subsections:
      • URL parts: the request-following functions and their configuration-only counterparts; the site or project resolved once by portalScope() and passed as scope; how to assemble each URL.
      • URLs that do not resolve: pageUrl(), imageUrl(), attachmentUrl() and processHtml() give a URL answered with 404 and log a warning; processHtmlParts() entries have no parts.
    • New functions: attachmentUrlParts, imageUrlParts, pageUrlParts, processHtmlParts, portalScope, with parameter tables and TypeScript examples taken from the xp examples.
    • New types: PortalScope, PageUrlParts, ImageUrlParts, AttachmentUrlParts, ProcessedHtml, ProcessedHtmlContentLink, ProcessedHtmlAttachmentLink, ProcessedHtmlImage, ProcessedHtmlImageStyle, ProcessedHtmlImageSource, ProcessedHtmlMacro.
    • baseUrl: the base URL of the current site request, with optional params; id, path, project and branch deprecated in favour of portalScope(). The example no longer uses them.
    • pageUrl: project and branch deprecated in favour of pageUrlParts() with a scope from portalScope().
    • processHtml: styles named <application>:<name> or by name alone; macros resolved when processing, an unknown macro left as written; srcset only for images the image API scales, sizes only along with it; imageSrcWidth for the width of the src, also in processHtmlParts.
    • imageUrl / attachmentUrl / pageUrl returns: point to the 404 behaviour. imageUrl names the image types it accepts.
  • docs/upgrade.adoc, in the XP 8.1 section: the lib-portal deprecations (before/after) under lib-portal, the Java MacroService.postProcessInstructionSerialize() deprecation under Java APIs, a new Behaviour changes subsection (404 URLs, srcset/sizes, their place after src, rounded image heights, macros), and three entries under Worth adopting, including imageSrcWidth. The intro now says no breaking changes for JavaScript code, since the Java macro instruction no longer executes. The 8.1 lib-portal links to imageUrl()/attachmentUrl() now use their actual anchors (#imageUrl, #attachmentUrl); they did not resolve before.
  • New functions, types and behaviour carry the existing 8.1.0 badge.

Verification

Rendered both pages with Asciidoctor (@asciidoctor/cli 4): no new warnings, and every in-page cross-reference of lib-portal.adoc resolves.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L8TCeZWgJjKTDhmntR9JtB


Generated by Claude Code

Adds urlBase, pageUrlParts, imageUrlParts, attachmentUrlParts and
processHtmlParts with their types, the 404 URLs for pages and media
that do not resolve, image styles named by application, macros resolved
when processing, and the XP 8.2 deprecations of pageUrl and baseUrl
project, branch and content parameters. Links to imageUrl and
attachmentUrl now use their anchors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8TCeZWgJjKTDhmntR9JtB
The change lands in XP 8.1.0: badge the new functions and types 8.1.0,
and fold the upgrade notes into the XP 8.1 section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8TCeZWgJjKTDhmntR9JtB
@rymsha rymsha changed the title Document URL parts and rich-text changes in lib-portal (XP 8.2) Document URL parts and rich-text changes in lib-portal (XP 8.1) Oct 3, 2026
claude added 6 commits October 3, 2026 15:03
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8TCeZWgJjKTDhmntR9JtB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8TCeZWgJjKTDhmntR9JtB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8TCeZWgJjKTDhmntR9JtB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8TCeZWgJjKTDhmntR9JtB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8TCeZWgJjKTDhmntR9JtB
@rymsha
rymsha marked this pull request as ready for review October 5, 2026 12:28
Copilot AI balanced review requested due to automatic review settings October 5, 2026 12:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The attachment error contract is contradictory, and two parameter descriptions need correction.

Review effort: Balanced
Findings: 3 Low severity

Open (3)
What changed in this PR

Documents XP 8.1 URL-part APIs, rich-text processing changes, and migration guidance.

Changes:

  • Adds five lib-portal functions and their result types.
  • Documents URL assembly, unresolved resources, macros, and responsive images.
  • Adds XP 8.1 deprecation and adoption guidance.
File Description
docs/​libraries/​lib-portal.adoc Expands the lib-portal reference.
docs/​upgrade.adoc Adds XP 8.1 migration guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/libraries/lib-portal.adoc
Comment thread docs/libraries/lib-portal.adoc Outdated
Comment thread docs/libraries/lib-portal.adoc Outdated
claude added 2 commits October 5, 2026 12:52
…s an array

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8TCeZWgJjKTDhmntR9JtB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8TCeZWgJjKTDhmntR9JtB
claude added 2 commits October 6, 2026 12:22
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8TCeZWgJjKTDhmntR9JtB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8TCeZWgJjKTDhmntR9JtB
@rymsha
rymsha merged commit 7baa4c9 into master Oct 6, 2026
2 checks passed
@rymsha
rymsha deleted the claude/page-url-parts-base branch October 6, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants