freerange
freerange copied to clipboard
A couple questions about this repo
- What is the difference between
re-frameandfreerange? - Is freerange meant for Nextjournal internal usage primarily, NJ internal usage only, or, is it perhaps suitable for external use as well?
Rationale: It'd be helpful to see what was the use-case for freerange, what problems it is intended to solve, and is there a desire to develop further, etc..
As a starter for question 1, just from sampling the first two PRs:
from PR#1: A re-frame fork that eschews global state, plus a React Context based API for providing an alternative state, e.g. in devcards.
- move registry and event-queue state into re-frame.core
- make make-restore-fn use core/registry
- turn public API into protocol and singleton in re-frame.core
- refactor subs-cache; integrate into frame singleton
- allow parameteriziation of default interceptors
- late binding of the frame in subscription/cofx/fx
- Make sure subscriptions and events use the frame that is passed to `subscribe`/`dispatch`, and not the frame that they are registered on, so that it is possible to re-use registries across frames.
- This also removes re-frame.db, since it's now vestigial, and removes re-frame.registrar, since that has been reincarnated into re-frame.registry.
- Provide an API for providing/consuimg the frame from a context
- ...
- Rename the-frame to default-frame, fix reg-sub-raw
- ...
- local var app-db no longer used
- fix bug "Make lein test-once pass again"
- This did find a bug, where the frame reference given to the event-queue does not contain the event-queue reference itself, so that chained dispatching doesn't work. Fixed by adding mutability on the event-queue so we can have a circular frame<->event-queue reference. In the long run it might be better to push a reference on the queue together with each event, so the queue doesn't need access to the frame.
- Removed some deprecated and commented-out code.
- Made sure fetching a undefined fx handler only prints one warning, not two.
- Generally made the tests more frame-aware.
from PR#2: support 2-arity import-with-frame for def-like var resolution
Hi @avidrucker, you can find an ADR at https://github.com/nextjournal/freerange/blob/8cf68c30722a4c6f8f948a134c900d7a656ecad4/docs/architecture_decision_log.org that goes into why freerange exists and what we changed in the fork and why. Does that answer your questions?