Skip to content
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

Needs an optional compiler #2

Open
0kku opened this issue May 7, 2020 · 0 comments
Open

Needs an optional compiler #2

0kku opened this issue May 7, 2020 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@0kku
Copy link
Owner

0kku commented May 7, 2020

While the library works without a compiler, there are many optimization opportunities that would help apps perform better in production.

Optimization opportunities:

  • Code inside html` `; template literals should be minified using HTML minification.
  • All dynamic property accesses using bracket notation should be converted to ReactiveArray::get() to avoid need for a Proxy. I.E. arr[0] should be converted to arr.get(0), for example.
  • All dynamic property assignments using bracket notation should be converted to ReactiveArray.splice() to avoid need for a Proxy. I.E. arr[3] = "foo" should be converted to arr.splice(3, 1, "foo");, for example.
  • All mutating ReactiveArray methods should be converted to ReactiveArray::splice(). All modifications to an array are expressible with splice(), and that's exactly what the class does internally. For most things, this would be a simple transformation, so inlining it would improve performance.
  • Slotless HTML templates could be converted to a variant that doesn't go through the trouble of parsing the HTML at all
  • It should be able to aggressively tree-shake the library to get rid of class methods and other features that are not used by the app being compiled. Also, removing unused attribute namespace logic would be nice too (ex. if no elements in the app use destiny:out, logic for that shouldn't be bundled in).
@0kku 0kku added enhancement New feature or request help wanted Extra attention is needed labels May 7, 2020
@0kku 0kku added this to the Future milestone Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant