Skip to content

[REF] owl-blockdom: move blockdom into its own package - #2080

Merged
ged-odoo merged 1 commit into
odoo:masterfrom
mcm-odoo:master-blockdom-package-mcm
Nov 27, 2026
Merged

ged-odoo merged 1 commit into
odoo:masterfrom
mcm-odoo:master-blockdom-package-mcm

Conversation

@mcm-odoo

@mcm-odoo mcm-odoo commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Blockdom (the virtual DOM) lived in owl-runtime/src/blockdom, but it does not depend on the rest of Owl. This moves it into its own workspace package, @odoo/owl-blockdom, which owl-runtime now depends on.

This is the first step of a series that clarifies the boundaries between the packages (template contract, then splitting TemplateSet from App).

What changes

  • New package packages/owl-blockdom: the source and its tests, moved with history (git mv), plus the usual package files (build, tsconfigs, vitest config). It has no dependency.
  • owl-runtime imports blockdom as @odoo/owl-blockdom instead of ./blockdom.
  • Code moved or exported so blockdom stands alone:
    • inOwnerDocument, only used by blockdom's event handling, moves from runtime's utils.ts into blockdom.
    • filterOutModifiersFromData is now exported from blockdom's index, as runtime's event handling needs it.
  • Error on unsupported nodes: the OwlError("boom") thrown when a block template contains a node that is neither an element nor text (comment, CDATA, processing instruction) becomes a plain Error with a clear message. That was blockdom's only use of owl-core. Templates never produce such nodes (the parser drops them); only direct blockDom.createBlock calls can, and a test now covers it.
  • Tests are self-contained: the two blockdom tests that used runtime test helpers (the main event handler, logStep) no longer do.
  • Build and tooling:
    • The root build, build:bundle, build:runtime and test scripts include the new package, built right after owl-core.
    • tools/release.cjs bumps and cleans it with the other packages.
    • The owl bundle resolves blockdom to its built file, as it already does for owl-core, so it is bundled once.

No behaviour change apart from the error message above.

Checks

  • npm run build, npm run build:types, npm test (all packages), npm run test:types and npm run check-formatting pass.
  • The owl bundle contains blockdom once.

depends on #2079

Blockdom does not depend on the rest of Owl, so it can live in its own
workspace package, @odoo/owl-blockdom, which owl-runtime now depends on.

- inOwnerDocument, only used by blockdom, moves with it
- filterOutModifiersFromData is exported from the blockdom index, as
  owl-runtime's event handling needs it
- the blockdom tests no longer use owl-runtime test helpers
- the "boom" OwlError thrown on unsupported nodes in a block template
  becomes a plain Error with a clear message, which removes blockdom's
  only dependency on owl-core
@mcm-odoo
mcm-odoo force-pushed the master-blockdom-package-mcm branch from 37fd7b6 to d4f3bd1 Compare November 27, 2026 12:06
@ged-odoo
ged-odoo merged commit 452f0a7 into odoo:master Nov 27, 2026
2 checks passed
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.

2 participants