Open joshuagruenstein opened 8 years ago
What is wrong with their including JQuery or some other DOM manipulation library if they need DOM manipulation?
I don't think that this should be shipped in a v1. It is a ton of more work. If people want DOM manipulation, there are a ton of libraries out there. The whole bundling strategy is one of the very things that makes JQuery bad. Results in a bloated library. Not the right philosophy.
I see your point. It just feels wrong to ask people to include another library, especially because I'm not 100% confident snooze can handle a full blown webapp on it's own yet. We may need a teensy bit of DOM manipulation to fill in the corners. And I don't think it's a lot more work: for example, here's how I'd implement DOM selection:
function zzz(domQuery) {
return document.querySelector(domQuery);
}
Just tiny little wrappers and syntactic sugar to make dev lives easier, and to make sure you can finish an app while staying in the snooze environment.
We could even provide two releases, one with DOM manipulation and one without. However, I have a feeling the difference in size would be so negligible nobody would use the one without.
Oops. Didn't mean to close.
Why does it need to be able to handle a full blown webapp on its own? Large, one library projects are enormously rare. I need two libraries just to run JS unit tests effectively. That's fine. It's nice when libraries focus on what they are good at.
OK, hear me out. I know that's not the kind of library snooze is. But, snooze is supposed to be flexible, and we don't want people to have to also include jQuery. A simple
zzz("cssSelector")
DOM fetcher and some nice DOM utilities (CSS manipulation, setting escaped text) would be convenient syntactic sugar, and very few LOC. Now, I'm still not sure this is the right thing to do, but I thought I'd make the issue. Thoughts?