-
Notifications
You must be signed in to change notification settings - Fork 295
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
[EXPERIMENTAL] Compile records and unions as JS arrays #1316
Conversation
Some results when compiling new Fulma docs decorating several types with the attribute: See: Fulma/Fulma@6a17f3f
|
This look promising. 👍 And I am in favor of not making a special case of single case unions |
Decorating also options and inlining default options we can rip almost 100KB off 😸 Fulma/Fulma@dfb2497
|
@alfonsogarciacaro Looks promising, there must be some performace implications if we're shaving so much. Can this be available as a compiler option so we don't have to change source? It's the old compiler option vs attribute argument, but why not have both (when it's ready to be experimented with, of course). |
@ncave This is a bit tricky right now, because However, it would be possible to move the compiler in this direction and put members and reflection info in functions on the containing module (which is actually what the F# compiler does). This would have other implications though, I will open a different issue for discussion 👍 |
66d8122
to
3c5ee07
Compare
4a6b4d5
to
f17547b
Compare
This is already implemented in |
This is an attempt to implement #1308 but with a
CompileAsArray
attribute. It can be used both for records and unions. Same asPojo
, the types are erased so no reflection, members, etc can be used. Things like JSON serialization haven't been implemented yet. Also note, single case unions have no special handling.