wavesoft / dot-dom

.dom is a tiny (512 byte) template engine that uses virtual DOM and some of react principles
Apache License 2.0
806 stars 53 forks source link

Expose more of dot-dom for NPM, handle window conditionally #25

Closed SilentCicero closed 7 years ago

SilentCicero commented 7 years ago

This is meant to expose more of dot-dom to NPM by binding dotdom to window. In addition to handling window if it already exists higher up in scope.

wavesoft commented 7 years ago

Hey @SilentCicero. I don't really get what you are trying to do here. I do get the idea of defining window only if it's not already there, but why do you need the reference to the wrapping function?

SilentCicero commented 7 years ago

@wavesoft referencing the wrapping function allows others to build with the module. It exposes your API more, perhaps they want to inject their own globals, transforms or modifiers, or trees. It's best to expose all of this IMO.

wavesoft commented 7 years ago

Well, I am going towards a single global (and that being the global variable) since converting the function arguments to var declarations actually saves a few bytes.

wavesoft commented 7 years ago

So I cannot see the benefit from exposing the wrapping function. Can you provide an example?

SilentCicero commented 7 years ago

Given what I have seen in the new release, we can close now.