-
Notifications
You must be signed in to change notification settings - Fork 20
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
Consider better support for DCE #34
Comments
Will think about it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, because of the way the writer is set up, Google Closure will not DCE any CLJS core data structures that are otherwise unused by the developer.
Though,
transit-js
already support dynamically looking up an alias on the object itself. Thus by adding the alias to the prototype of the types, it'd enable proper DCE on lesser used types.So by using, for instance:
And removing the entries from the map in
transito.core/writer
, we enable DCE without losing any functionality.This also works fine with GCC's advanced minification.
Edit: Should probably not reuse the types since user's may provide customs handler for types in which case the alias could fail. We could introduce some simple dummy
deftypes
that can for sure handle the conversion and alias it to those instead.So:
The text was updated successfully, but these errors were encountered: