Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

feat(integrations): universal shared registry global bootstrap#1920

Merged
rubenvdlinde merged 2 commits into
developmentfrom
feat/universal-registry-global-bootstrap
May 25, 2026
Merged

feat(integrations): universal shared registry global bootstrap#1920
rubenvdlinde merged 2 commits into
developmentfrom
feat/universal-registry-global-bootstrap

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

What

Loads the integration registry on every full-page render, not just OpenRegister's own SPA, so leaf apps (e.g. OpenConnector's Synced from) render inside any consuming app's object detail page — with zero changes to that consuming app.

Why

The pluggable integration registry (pluggable-integration-registry) was only installed + populated by OpenRegister's own webpack bundles. On a page served by a consuming app (e.g. an OpenCatalogi publication), OpenRegister's bundle never runs, so:

  1. A leaf that loaded its Path-2 bundle and called registerIntegration(...) only ever populated a stub registry — nothing drained it.
  2. useIntegrationRegistry() in a foreign bundle read its own per-bundle module singleton, never the window-global the leaf queued onto.

Net: the leaf's tab/widget never rendered outside OpenRegister's SPA. This change closes that gap.

How

  • src/integration-global.js — tiny new webpack entry that calls the idempotent ensureIntegrationRegistry().
  • webpack.config.jsintegrationGlobal entry → openregister-integration-global.js.
  • src/integrations/bootstrap.jsensureIntegrationRegistry() now resolves the shared window-global registry via getSharedRegistry() (nc-vue converge-not-clobber + install-if-needed) and registers builtins + leaves into that instance, so every consuming app's useIntegrationRegistry() — which defaults to the same shared instance — sees them.
  • lib/Listener/IntegrationGlobalScriptListener.php — loads the global bundle on every BeforeTemplateRenderedEvent.
  • lib/AppInfo/Application.php — registers the listener (mirrors the existing MailAppScriptListener pattern).

Verification

On an OpenCatalogi page (no OpenCatalogi changes):

  • window.OCA.OpenRegister.integrations is a real registry (not a stub)
  • 25 integrations registered, including OpenConnector's sync-contract leaf
  • resolveWidget('sync-contract', 'detail-page') resolves to the real SyncedFromTab component cross-bundle

Companion

Depends on nc-vue universal-shared-integration-registry (ncv#443, merged to beta) which adds getSharedRegistry / sharedRegistryIfInstalled / converge-not-clobber installIntegrationRegistry and the shared-default composable.

🤖 Generated with Claude Code

Load the integration registry on EVERY full-page render, not just
OpenRegister's own SPA, so leaves (e.g. OpenConnector's "Synced from")
render inside any consuming app's object detail page — with ZERO changes
to that app.

- src/integration-global.js: tiny new webpack entry that calls
  ensureIntegrationRegistry() (idempotent).
- webpack.config.js: integrationGlobal entry -> openregister-integration-global.js.
- src/integrations/bootstrap.js: ensureIntegrationRegistry() now resolves the
  SHARED window-global registry via getSharedRegistry() (nc-vue
  converge-not-clobber + install-if-needed) and registers builtins + leaves
  into that instance, so every consuming app's useIntegrationRegistry() —
  which defaults to the same shared instance — sees them.
- lib/Listener/IntegrationGlobalScriptListener.php: loads the global bundle on
  every BeforeTemplateRenderedEvent.
- lib/AppInfo/Application.php: register the listener.

Verified: on an OpenCatalogi page (no OpenCatalogi changes),
window.OCA.OpenRegister.integrations is a real registry (not a stub) with 25
integrations including OpenConnector's sync-contract leaf, whose SyncedFromTab
component is resolvable cross-bundle via resolveWidget().

Companion to nc-vue universal-shared-integration-registry (ncv#443).
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openregister @ 831ae88

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 165/165
npm ✅ 539/539
PHPUnit ⏭️
Newman ⏭️
Playwright ⏭️

Quality workflow — 2026-05-25 22:39 UTC

Download the full PDF report from the workflow artifacts.

…ng style

- IntegrationGlobalScriptListener: add @SPEC tags to class + handle()
  docblocks, drop the blank line after the class brace (phpcs errors/warnings).
- integration-global.js: use JSDoc header (@package/@license) matching the
  other entry bundles instead of `// SPDX` line comments.
@rubenvdlinde rubenvdlinde merged commit 6391197 into development May 25, 2026
2 of 3 checks passed
@rubenvdlinde rubenvdlinde deleted the feat/universal-registry-global-bootstrap branch May 25, 2026 22:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant