Wykres commitów

6 Commity (main)

Autor SHA1 Wiadomość Data
Atul Varma d13c892f3d
Use esbuild instead of Parcel. (#131)
This replaces Parcel with [esbuild][].

esbuild has a number of advantages over Parcel:

* It is much, much, *much* faster. A Parcel build takes several seconds on my system, while esbuild takes 60-70 _milliseconds_.
* Parcel hard-crashes when I switch branches on Windows, esbuild doesn't.

The one disadvantage is that, as far as I can tell, esbuild doesn't support any kind of auto-reloading in the browser when you change things. IMO this isn't that big a deal and the benefits outweigh this minor inconvenience (and anyways, auto-reload has historically backfired so many times that I usually have been manually reloading the page whenever I make changes).

[esbuild]: https://esbuild.github.io/
2021-05-28 07:34:17 -04:00
Atul Varma d1c2ae4b02
Always permalink to Mandalas. (#99)
This addresses #61 by making mandalas permalinked.

The URL to a mandala will change whenever the user stops fiddling with it for 250 ms.  This means that the user can always reload the page to get a reasonably recent version of what they were creating, and they can use the browser's "back" and "next" buttons to effectively undo/redo recent changes.  They can also copy the URL to share it with others.

## About the serialization format

Originally, I stored the state of the user's mandala in the URL using JSON.  This had a number of drawbacks, though:

* **It was really long.**  A mandala serialization was almost 1k characters, which was a very big URL, and one that some sharing platforms might even reject.

* **It wasn't type-checked in any way.** Unless I added some kind of JSON schema validation (which I didn't), the serialization was simply deserialized and assumed to be in the proper format.  This could result in confusing exceptions during render time, rather than decisively exploding at deserialization time.

To resolve these limitations, and because I thought it would be fun, I decided to store the mandala state using a serialization format called [Apache Avro][].  I first read about this in Kleppmann's [Designing Data-Intensive Applications][kleppmann] and was intrigued by both its compactness (a serialized mandala is around 80-120 characters) and schema evolution properties.

It might be going a bit overboard, but again, I thought it would be fun and I wanted to play around with Avro.  Also, I tried architecting things in such a way that all the Avro code is in its own file, and can easily be removed (or swapped out for another serialization format) if we decide it's dumb.

[Apache Avro]: http://avro.apache.org/
[kleppmann]: https://dataintensive.net/

## Other changes

This PR also makes a few other changes:

* Tests can now import files with JSX in them (I don't think this was required for the final state of this PR, but I figured I'd leave it in there for its almost inevitable use in the future).

* The value labels for number sliders now have a fixed width, which eliminates a weird "jitter" effect that sometimes occurred when using them.
2021-04-24 08:46:32 -04:00
Atul Varma 4334a3eb3c Enable stricter typescript checks, remove unused import. 2021-02-15 07:44:22 -05:00
Atul Varma 7019199bd4 Show all symbols. 2021-02-03 19:36:29 -05:00
Atul Varma f0960d4280 use react. 2021-02-03 19:11:34 -05:00
Atul Varma 1a4c8adc41 Origination. 2021-02-02 19:26:40 -05:00