decred / dcrdata

Decred block explorer, with packages and apps for data collection and storage. Written in Go.
https://dcrdata.decred.org/
ISC License
129 stars 128 forks source link

Consider stimulus.js for terser, more organized client side javascript #444

Closed gozart1 closed 5 years ago

gozart1 commented 6 years ago

It's likely this explorer will continue to get fancier with client side interactions such as charts or table sorts, but at the same time will most likely continue to be based on server rendered html at its core.

So might be good to add a bit of structure to our javascript with Stimulus, a framework that's designed for the turbolinks architecture. https://stimulusjs.org/handbook/origin

What do ya'll think?

chappjc commented 6 years ago

Think of it like this: in the same way that class is a bridge connecting HTML to CSS, data-controller is a bridge from HTML to JavaScript.

Sounds like a cool way to create a little order out of our growing mess of js.

Thumbs up.

raedah commented 6 years ago

Will this create any changes visible to the user, or will it improve code readability?

chappjc commented 6 years ago

resolved by PR https://github.com/decred/dcrdata/pull/498 (for home and mempool). @gozart1 Think this is worth more refactoring? Seems like it might be.