Anyone else here tried using Vite to create an SDK for other apps to use ?? Struggle bussing getting it to render anywhere externally :hmm_cat: #developer#vite#javascript#help
One time I found some #JavaScript in an app that was constructing a full blown SELECT statement in SQL, sending it to the server, and then blindly executed on that server.
It is still the most glorious, beautiful code I've ever seen.
@cspray I did that once for a project as a joke (against a read-only SQL API) and found it was actually a really neat way to rapidly iterate on my project!
You can view source on https://sf-trees.com to see a demo of the pattern I built
TIL that range modifications on the window selection object are asynchronous, eg. removeAllRanges().
This can lead to race conditions, but the methods don't return a Promise, so if the timing matters you have to use selectionchange as a callback trigger.
@baumannzone This has to do with how floating point numbers are stored (essentially, they’re fractions, not decimals). This occurs in most programming languages, not just JS. Look up “floating point rounding error”