Merged
Conversation
e0f7bce to
6edfcee
Compare
for stable ESM/CJS resoluton We currently have `main` + `module` but no `exports` map, which is the modern and compatible way of exposing entry points in node modules. so esm runtimes may import the wrong format from `main`, forcing lib consumers to understand the dist structure and import specific compatibles files or add local alias/mapping workarounds ([Example](https://github.com/ThanhDodeurOdoo/discuss-companion/pull/106/changes#diff-1e058ca1442e46581b13571fb8d261f9e1f5657e26c96634d4c1072f0f0347f1R10)), which makes them more sensitive to technical changes in owl. So this commit add epxlicit package `exports` so resolution is determinisitic and only exposes what is intended for comsumption: - `.` -> `import: ./dist/owl.es.js` - `.` -> `require: ./dist/owl.cjs.js` - `.` -> `types: ./dist/types/owl.d.ts` - `./dist/*` -> preserve deep imports (for example `@odoo/owl/dist/compile_templates.mjs`) - `./package.json` -> preserve metadata access for tooling This keeps existing public subpaths available and makes top-level `@odoo/owl` imports resolve to the expected format.
6edfcee to
f2e419b
Compare
ged-odoo
approved these changes
Mar 2, 2026
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.
for stable ESM/CJS resoluton
We currently have
main+modulebut noexportsmap, which is the modern and compatibleway of exposing entry points in node modules.
so esm runtimes may import the wrong format from
main, forcing lib consumers to understand the dist structure and import specific compatibles files or add local alias/mapping workarounds, which makes them moresensitive to technical changes in owl.
So this commit add epxlicit package
exportsso resolution is determinisitic and only exposes what is intended for comsumption:.->import: ./dist/owl.es.js.->require: ./dist/owl.cjs.js.->types: ./dist/types/owl.d.ts./dist/*-> preserve deep imports (for example@odoo/owl/dist/compile_templates.mjs)./package.json-> preserve metadata access for toolingThis keeps existing public subpaths available and makes top-level
@odoo/owlimports resolve to the expected format.see:
https://nodejs.org/api/packages.html#conditional-exports
https://hirok.io/posts/package-json-exports