Conversation
We'd like to be able to execute o-spreadsheet server-side where the DOM and Web API's are not available. We currently can't do it because loading the bundle file crashes because some DOM specifics are used at the root: e.g. `const elementProto = Element.prototype;` => `Element` is not defined One solution would be to create an other bundle for o-spreadsheet which would not depend on owl. And we actually did that already. The problem comes when we want to do the same for the odoo bundle. We depend on many parts of the framework (for core services, utils, etc.) While it may not be entirely impossible to split the framework bundle, it'll be very fragile because any file dependy change may break it. Also, with the up-coming Owl3, the framework will rely on owl (signals). The plan is therefore to make the bundle loadable with nodejs (even if it cannot be used!) We'll use the regular bundle and it'll be our responsibility to only use the parts that can work server-side. My goal with this commit is: ``` npm run build node dist/owl.cjs.js <- should not crash ``` Task-5156838
678e9ca to
d05f6f7
Compare
Contributor
|
Maybe we should build the bundle differently? Seems likes these files should not even be getting parsed if they're unused. |
ged-odoo
approved these changes
Mar 18, 2026
Contributor
|
i agree with Sam, but in the meantime, this PR solves the issue for now |
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.
We'd like to be able to execute o-spreadsheet server-side where the DOM and Web API's are not available.
We currently can't do it because loading the bundle file crashes because some DOM specifics are used at the root:
e.g.
const elementProto = Element.prototype;=>Elementis not definedOne solution would be to create an other bundle for o-spreadsheet which would not depend on owl. And we actually did that already. The problem comes when we want to do the same for the odoo bundle. We depend on many parts of the framework (for core services, utils, etc.)
While it may not be entirely impossible to split the framework bundle, it'll be very fragile because any file dependy change may break it.
Also, with the up-coming Owl3, the framework will rely on owl (signals).
The plan is therefore to make the bundle loadable with nodejs (even if it
cannot be used!)
We'll use the regular bundle and it'll be our responsibility to only use
the parts that can work server-side.
My goal with this commit is:
Task-5156838