You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moonbit is great!
I am thinking about writing Core of my browser project on Moonbit.
I am trying to start and face export case (or problem)
I create test code of Xxx struct with new functionality
When I tried to export my class, object Xxx to my browser JavaScript I tryed this code
{
"link": {
"js": {
"exports": [
"Xxx::new", // not working
"Xxx:new", // not working
"Xxx.new", // not working
"new" // working, but result exported function is just new
],
"format": "esm"
}
}
}
"new" is working, but result exported function is just named new
it conflicts with js new
it is full separete of my Xxx struct, on js layer not connected to it, and I can not connect this logically. Just new.
I think need to make some good model to make exported code more freandly and structured.
May be to allow "Xxx::new" to export with name Xxx_new or to allow any custom export name like. Or to make all Xxx methods export in container object Xxx { method1, method2 } to use as Xxx.method?
And the second question, is there way to export full Xxx struct with all functions and all related data?
Sorry for my bad english
The text was updated successfully, but these errors were encountered:
DmitrijOkeanij
changed the title
Export Struct::method
Export to JS output Struct::method logic upgrade
Nov 23, 2024
I am thinking about how to export things as core domain objects (constants, functions, data types and others) in JS Project (Vue, Svelte...)
For example, I have Page item with id, title, and text in domain logic of my project. I want to write all core on moonbit and then use it from JS (Svelte or Vue) on site level.
The best way is to write directly on moonbit all site on Vue , Svelte...
This is a question about plans of moonbit, and future capabilities.
It is under discussion. We currently have generated .d.ts type signature, and I think we currently only use any. We need to determine our ABI and see how we export them.
Moonbit is great!
I am thinking about writing Core of my browser project on Moonbit.
I am trying to start and face export case (or problem)
I create test code of Xxx struct with new functionality
When I tried to export my class, object Xxx to my browser JavaScript I tryed this code
"new" is working, but result exported function is just named new
I think need to make some good model to make exported code more freandly and structured.
May be to allow "Xxx::new" to export with name Xxx_new or to allow any custom export name like. Or to make all Xxx methods export in container object Xxx { method1, method2 } to use as Xxx.method?
And the second question, is there way to export full Xxx struct with all functions and all related data?
Sorry for my bad english
The text was updated successfully, but these errors were encountered: