News for hackers. Stuff that matters.
Re:Next.js 9.4 – Fast Refresh, Incremental Static Regeneration by gnalck on Monday May 11, 2020 @01:48PM (#23144865)
Whether or not JS-SSR with hydration is performant is an interesting topic, but sort of misses the forest for the trees, no? The thread you link to is about a post which speaks about whether that extra level of complexity is even necessary for many use cases (it isn't).

HTML + JQuery, which the hydration approach is compared with, is not used for performance reasons per se. It's used because its easier to reason about and the incremental interactivity that something like JQuery brings to HTML is better than writing your entire frontend in React for something as simple as a blog, for example.

Re:Next.js 9.4 – Fast Refresh, Incremental Static Regeneration by leeoniya on Monday May 11, 2020 @01:52PM (#23144918)
it does not take much complexity to start feeling the pain of jquery-style imperative DOM sync & manip. you don't need to go too far past "simple blog" for this to become obvious.

FWIW, the linked site is built with a 300 line custom build script, Rollup, Buble & Terser - even the dev dependencies are extremely minimal. no, it doesnt have the latest HMR hotness, so the DX could be a bit better if i wanted more bloat.

Re:Next.js 9.4 – Fast Refresh, Incremental Static Regeneration by manigandham on Wednesday May 13, 2020 @05:22AM (#23165045)
This kind of progressive enhancement but with the latest JS frontend component models is where Vue shines. Vue 3.0 will be making it even better and faster.
Re:Next.js 9.4 – Fast Refresh, Incremental Static Regeneration by searchableguy on Monday May 11, 2020 @01:51PM (#23144905)
You don't need jquery in most situations unless you are supporting old browsers. Modern js is good enough. At best, you will end up writing a few lines to abstract what jQuery abstracts away from you.
Re:Next.js 9.4 – Fast Refresh, Incremental Static Regeneration by leeoniya on Monday May 11, 2020 @01:54PM (#23144932)
if you still want jquery in 2020 (and that's ok because raw DOM apis still need sugar), for the love of god please use https://umbrellajs.com/ instead.

it's like 1/10th the size, api-compatible and well-architectured.

Re:Next.js 9.4 – Fast Refresh, Incremental Static Regeneration by whycombagator on Monday May 11, 2020 @02:05PM (#23145086)
Re:Next.js 9.4 – Fast Refresh, Incremental Static Regeneration by manigandham on Thursday May 14, 2020 @01:54AM (#23175847)
Re:Next.js 9.4 – Fast Refresh, Incremental Static Regeneration by gnalck on Monday May 11, 2020 @02:27PM (#23145346)
This is pretty neat! I was just looking around for a "modern, smaller" JQuery equivalent and did not come across this. The older equivalents in this space I saw were Zepto and Cash.

Out of curiosity, what do you think of Alpine.js and Stimulus.js, which come to mind when I think of smaller utility libraries for adding "sprinkles" of JS?

Re:Next.js 9.4 – Fast Refresh, Incremental Static Regeneration by leeoniya on Monday May 11, 2020 @02:30PM (#23145380)
> Out of curiosity, what do you think of Alpine.js and Stimulus.js

no experience with those, but if you're feeling masochistic, try these:

https://github.com/finom/balalaika

https://github.com/finom/bala

Re:Next.js 9.4 – Fast Refresh, Incremental Static Regeneration by earthboundkid on Monday May 11, 2020 @09:42PM (#23149680)
I have been using Alpine and enjoying it. Stimulus is too much like Rails—convention over configuration—for me to get into. Alpine feels like a nice middle ground between Vue and Vanilla.
Re:Next.js 9.4 – Fast Refresh, Incremental Static Regeneration by ww520 on Monday May 11, 2020 @02:51PM (#23145586)
Does it support bubbling event handling? In the form of: $(".outer").on("click", ".inner", function(){ ... } )

Without bubbling event handling, it's a no go for handling event on dynamically generated inner content.

Re:Next.js 9.4 – Fast Refresh, Incremental Static Regeneration by leeoniya on Monday May 11, 2020 @02:56PM (#23145639)
Re:Next.js 9.4 – Fast Refresh, Incremental Static Regeneration by ww520 on Monday May 11, 2020 @03:55PM (#23146254)
I mean, sure, I can use the lower level API to check in a separate step. The point of a library is to provide the functionality to reduce the boiler plate checking.
Re:Next.js 9.4 – Fast Refresh, Incremental Static Regeneration by leeoniya on Monday May 11, 2020 @04:00PM (#23146316)
alright then. sounds like you're able to make an informed decision for yourself. when i was doing jquery dev i never needed so much event delegation that avoiding an occasional 1-liner for event filtering* justified using a lib that's 10x larger.

* in limited cases like tabular data or large lists

Re:Next.js 9.4 – Fast Refresh, Incremental Static Regeneration by biggestlou on Monday May 11, 2020 @02:03PM (#23145057)
Or AlpineJS