-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Dicussion]: Possible to use formula parser as a backend library? #2187
Comments
Hello, For now, the formula parser logic is linked to others parts of the application, such as the list/definitions of functions in order to compile their arguments. It would require a little work to extract completely the parser, but it's possible. I didn't try but I think it would be possible to use o-spreadsheet for backend application. You can import helpers from |
i think i will give it a try. if it is just a matter of moving dependencies around (as in moving files and folders) then that should not be a problem, but if it depends on "owl", which is a frontend library, then it is not possible. I understand that this is not the case, right ? |
owl is a frontend library but can be used in the backend. While the |
makes sense. is there any good place (doc / code / type definitions) where you would advise getting started to understand the parser's logic ? i would like to make an initial assessment whether it would make sense to run it as server-side module |
Complementary information, we tried to install the library as a backend (full nodejs app) and it cannot run as it is. the data model is relying on the owl library as well, which simply cannot run on a nodejs server because it uses the web API. Sorry for misleading you. However, we are currently considering different approaches to make the lib backend-only asap. In the meantime, the whole parsing logic is, as @pro-odoo mentioned, related to other parts of the code, but the main logic is in https://github.com/odoo/o-spreadsheet/blob/saas-16.2/src/formulas/parser.ts. I think you could easily rebundle the parsing on your own by extracting that file and the imports it requires. |
thanks for the reply. Is there any update on this matter ? |
We have are not currently working on the possibility to make the lib run as a node application. As mentionned in my previous message, you can easily rebundle the parsing by yourself. |
hi there, i come back to my question, and would like to know if it would be possible to run the formula parser in the frontend, but without the need of mounting the whole spreadsheet component. i feel like this function should act as the "entrypoint" https://github.com/odoo/o-spreadsheet/blob/saas-17.3/src/formulas/parser.ts#L225 but then how could one inject additional formulas and additional plugins as described in: https://github.com/odoo/o-spreadsheet/blob/saas-17.3/doc/add_function.md ? would this be possible with the parser alone ? |
I see a "formulas" folder in the code:
The text was updated successfully, but these errors were encountered: