devpunks / snuggsi

snuggsi ツ - Easy Custom Elements in ~1kB
https://snuggsi.com
MIT License
398 stars 17 forks source link

<to-do> #89

Closed snuggs closed 7 years ago

snuggs commented 7 years ago

Fixes #85

brandondees commented 7 years ago

http://todomvc.com/

snuggs commented 7 years ago

@brandondees already on it.

snuggs commented 7 years ago

@tmornini @brandondees First working pass to-do

snuggs commented 7 years ago

https://github.com/tastejs/todomvc-app-template

@brandondees this is rediculous the amount of code they want you to have for their boilerplate. I feel we should have a <to-do> and <to-do-mvc> custom element. One for OUR conventions. And the latter for us to abide by what they consider a "working TODO Example" which truth be told is about 60% more code than is needed.

Please advise...

/cc @tmornini @halorium

brandondees commented 7 years ago

yeah i agree but it still helps advertise if we can play by their rules to at least be in the game, i think. then also do the lighter variant and make a hullabaloo about how the snuggsi way is even better faster stronger and can still pass all the acceptance tests. you might look at how other tools have done their entries, i assume stuff like polymer is represented already and might give you some idea of ways this competition can be approached.

tmornini commented 7 years ago

@snuggs You need to speed things up a bit.

The app loads and runs slowly and it took you way more than 12 hours to get this done. 😄

Oh, and while you're at it, this has way too few commits. Break that shit up! 👍

tmornini commented 7 years ago

@halorium Your name in lights!

snuggs commented 7 years ago

@tmornini Minus filtering been done. Looks like we're coming in under 100LOC (Whitespace included). Prunin' the bonzai bush. Take a look @ React while you wait. https://github.com/tastejs/todomvc/tree/gh-pages/examples/react/js

/cc @brandondees @halorium

tmornini commented 7 years ago

@snuggs I count 181+62+108+87+50 = 488 LOC for React

tmornini commented 7 years ago

Surprised you didn't say anything about

@snuggs Just a drive-by-review. Squirrel! 😄

snuggs commented 7 years ago

Functionality complete. @halorium @tmornini. Givin' 'er a paint job now. loren

image

tmornini commented 7 years ago

@snuggs Looking good! 🍿

snuggs commented 7 years ago

@tmornini AND under 98LOC to be "spec compliant" 🎉 pay no attention to style.css that's all fluff hehe. However there IS some actual "LOGIC" that is needed to satisfy the spec that we do in CSS. I kept that separate from the styling segments. For feature's sake in our experiment yes? 👍

snuggs commented 7 years ago

AH found a bug @tmornini no wonder Complete All wasn't working. I actually never set the tasks to be complete. Just the view. That's why when i clicked on a checked task the second time after pressing Complete All it did not update properly if you noticed.

snuggs commented 7 years ago

🐛 💥 🔫 @tmornini https://github.com/devpunks/snuggsi/pull/89/commits/a4017bc4aab8ca96f7634df289e7ed6c90b3333b

snuggs commented 7 years ago

@brandondees @halorium @pachonk @tmornini total time to add one task, reflow / repaint 3.9ms start to finish. capture d ecran 2017-07-07 a 18 32 08

brandondees commented 7 years ago

is this thing deployed yet? i want to poke at it

snuggs commented 7 years ago

@brandondees it is ... NOW (pun intended) /cc @halorium https://snuggsi-twkdzgiian.now.sh/examples/to-do

https://now.sh as "staging"? It's SUPER simple. Just type $ now and the rest is magic. Even keyboard copy.

brandondees commented 7 years ago

looking good, be sure to link from snuggsi site as well as from the to-do's docs/readme.

~is it supposed to persist using local storage? that doesn't seem to be happening yet.~ [sees checklist]

snuggs commented 7 years ago

@tmornini @brandondees @halorium since we use CSS to toggle visibility of Active vs Completed tasks on our TODOMVC we don't trigger a reflow. Only a repaint due to us not fucking with the DOM tree. Repaints happen in less than 2ms. Entailing our operation of less than 190μ (0.2ms in yellow). Half the time of actually adding a task to the list which is 3.9ms. Perfect example of how a touch of knowledge of CSS can decrease your JS therefore less load on the browser.

Just to set scale the amount of time it takes to release the mouse button during event is 8ms. We could paint 2 times during that time (avg. 4 repaints per 16ms frame in 60fps). Probably scales as there is no javascript call stack to deal with therefore the "Waste Monster" AKA Garbage Collector never boards our ship. YAAAARRRRRRR :skull_and_crossbones: @pachonk. Most work is done by the GPU.

Makin @mholzschlag & @misscs proud ;-)

capture d ecran 2017-07-07 a 21 16 28

capture d ecran 2017-07-07 a 21 25 23

snuggs commented 7 years ago

@halorium and that's how you make a MODERN TODOMVC. At least from an MVP perspective. Just thought would be a nice stopgap to provide a big picture snapshot before finishing styling and converting to an import (The part I think you will really have an "A-HA" moment).

Declarative (HTML) - top left (~40LOC) Imperative (es) - Right (~60LOC) Styling (CSS) - bottom left (~24LOC)

Sorry @tmornini couldn't fall within 100LOC. (Without double line spacing it is tho hehe)

capture d ecran 2017-07-07 a 22 19 24

snuggs commented 7 years ago

PR Dependent upon #100

tmornini commented 7 years ago

@snuggs

Repaints happen in less than 2ms. Entailing our operation of less than 190μ (0.2ms in yellow). Half the time of actually adding a task to the list which is 3.9ms

Arithmetic check:

3.9 / .2 ≅ 19x faster (always round down) .2 / 3.9 ≅ 6% of the time (always round up)

The rounding helps with "under-promise and over-deliver" 😄

snuggs commented 7 years ago

Rebased due to #100. @brandondees @halorium https://github.com/devpunks/snuggsi/pull/89/commits/621563f2c9c4e26a62e46b43d731ee49d352dec3

the benefits of string interpolation. 💪

snuggs commented 7 years ago

Issue blocked on https://github.com/koajs/send/issues/86 /cc @btakita any help would be appreciated.

snuggs commented 7 years ago

@brandondees UGH that was painful. https://github.com/devpunks/snuggsi/pull/89/commits/1d35ae1055660c4e627492bc5e06b63c3a436939

Dialogue with the CSS masterz here. https://twitter.com/snuggsi/status/887312662610268160

@brandondees don't want to pull the "wildcard" and hit Dom but is there anywhere we should lean on to tap on shoulder? This should be unacceptable behavior. Who maintains CSS/OM? W3C I would think.

@halorium @tmornini found a bug in the platform vendor implementations and patched before release. The spec is right. They just didn't get it right. 🐛 https://github.com/devpunks/snuggsi/pull/89/commits/1d35ae1055660c4e627492bc5e06b63c3a436939 🐞

capture d ecran 2017-07-18 a 10 06 14

brandondees commented 7 years ago

@snuggs so it's a browser implementation bug, not a spec bug, right? guess you'd have to take it up with each browser independently. with Edge you can at least vote for it

snuggs commented 7 years ago

DAMMIT man i may have to go into issue trackers. Or just troll their repos until they make a move. That should be unexcusable. ESPECIALLY since Safari (of all people) found a "patch" @brandondees.

snuggs commented 7 years ago

@brandondees @mrbernnz @tmornini @halorium @btakita @kurtcagle @dcchuck @janz93 @pachonk @henryarbolaez @RobertChristopher

BEHOLD! https://snuggsi-kwwwdjwzvw.now.sh/examples/to-do

to-do