Stacks icon indicating copy to clipboard operation
Stacks copied to clipboard

Explore replacing jQuery with Cash

Open dancormier opened this issue 2 years ago • 4 comments

jQuery works but I figured Stacks would be a good, isolated environment to explore replacing it with Cash and saving a few KBs (see the comparison chart and [email protected]/[email protected]) sizes.

Worth noting

  • This PR ditches much of the navigation functionality (see https://github.com/StackExchange/Stacks/pull/905/commits/fc04f40c64881d3fc0d918e922986528e86816cb). It didn't seem necessary, but there's totally a chance I'm completely overlooking the need. We can add it back but we'll need to extend Cash or add some more vanilla JS.
  • Cash doesn't include queue/dequeue methods, so we'll need to find a replacement for toast docs functionality.
  • We could import Cash on a per-file basis instead of adding it globally, but I opted for a light-touch in this PR.

dancormier avatar Apr 04 '22 20:04 dancormier

Deploy Preview for stacks ready!

Name Link
Latest commit 8621f990a8642dd4342a3eb7f5e939088e25e5e3
Latest deploy log https://app.netlify.com/sites/stacks/deploys/628bc929edb2620008299caa
Deploy Preview https://deploy-preview-905--stacks.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Apr 04 '22 20:04 netlify[bot]

Hear me out on this one - what if we just dropped jquery entirely? We don't have that much JS using it.

b-kelly avatar Apr 07 '22 19:04 b-kelly

what if we just dropped jquery entirely

Better get crackin' 🥰😇

aaronshekey avatar Apr 07 '22 19:04 aaronshekey

Hear me out on this one - what if we just dropped jquery entirely? We don't have that much JS using it.

The thought crossed my mind. I figured this was a less risky stopgap for now that would help ~~kick the can down the road~~ save a few KBs. That said, if we dropped jQuery, I wouldn't shed a tear.

dancormier avatar Apr 07 '22 19:04 dancormier