aurelia / templating-binding

An implementation of the templating engine's Binding Language abstraction which uses a pluggable command syntax.
MIT License
32 stars 26 forks source link

refactor(binding): reduced code size #111

Closed jods4 closed 7 years ago

jods4 commented 7 years ago

Members from exported classes and strings do not minify :(

I rewrote the creating of the mapping to be more compact, easily shaving ~200 bytes.

EisenbergEffect commented 7 years ago

@jdanyow Can you review this?

jods4 commented 7 years ago

@jdanyow I agree that maintainability is more important than code size. The two are not incompatible and often smaller code can be simpler code (e.g. we have Promise spaghetti 🍝 going on in a few places). I am really trying to not obfuscate anything for the sake of size.

In this particular case, I think the result is simple and clear enough, but that's subjective. The only thing that I find not intuitive is that attributes are lowercased by register, which is why I left a comment.

If you think the code is not clear enough then we can drop this PR (or maybe just keep the register improvement), it's only a 200 bytes reduction after all.

When I saw it I thought it was 200 easy bytes so I went for it.

EisenbergEffect commented 7 years ago

I think we should probably hold on this for now until after the move to TS.

On Feb 5, 2017 6:48 AM, "jods" notifications@github.com wrote:

@jdanyow https://github.com/jdanyow I agree that maintainability is more important than code size. The two are not incompatible and often smaller code can be simpler code (e.g. we have Promise spaghetti 🍝 going on in a few places). I am really trying to not obfuscate anything for the sake of size.

In this particular case, I think the result is simple and clear enough, but that's subjective. The only thing that I find not intuitive is that attributes are lowercased by register, which is why I left a comment.

If you think the code is not clear enough then we can drop this PR (or maybe just keep the register improvement), it's only a 200 bytes reduction after all.

When I saw it I thought it was 200 easy bytes so I went for it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aurelia/templating-binding/pull/111#issuecomment-277524430, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIBnemqGGaMfdvTeN9wZrZyNx15FaTvks5rZeE1gaJpZM4L3O2e .

EisenbergEffect commented 7 years ago

Closing this for now. Let's revisit after the move to TS.