Related to #5. Naming is very hard. Naming is also an important part of the library for many debugging reasons (see #5). I want the names of exports to make sense since they're two sides to the same coin and don't do much alone. I had previously chosen WireSignal & WireReactor to show that they're related by a prefix. This was really long for inline JSX so wS/wR was used too. This wasn't great for readability (also commented in #2) and therefore also wasn't very explicit/meaningful. I also learned that people hear "reactor" and think of nuclear reactors, which is surprising and not what I meant.
The names need to fit together, but they also need to be short. A replacement for "reactor" needs to fit nicely for inlined JSX. In #5 I proposed "sub". Other attempts were: (repeat) rep(), (subscribe) sub(), link(), (connect) con(), anew(), (socket) sock(), sync(), ...
TypeScript will still show the functions created by signal()/signalsFrom() and core() as WireSignal and WireCore respectively, which is good since I want them to be related by a prefix. There's a new export, signal, which creates an unnamed signal. The original form of signal creation using an object (which encourages/simplifies naming to help debugging) is now signalsFrom. I also changed "adopt" to show that it's to be used for cores. Internally, some FSM names were changed and the function properties on signals and cores now have nice closer-to-full-length names such as "signalRS" rather than "sS"; JSDoc describes these.
This hurts bundle size (see commits) but I'm trying to care about that less.
Related to #5. Naming is very hard. Naming is also an important part of the library for many debugging reasons (see #5). I want the names of exports to make sense since they're two sides to the same coin and don't do much alone. I had previously chosen WireSignal & WireReactor to show that they're related by a prefix. This was really long for inline JSX so wS/wR was used too. This wasn't great for readability (also commented in #2) and therefore also wasn't very explicit/meaningful. I also learned that people hear "reactor" and think of nuclear reactors, which is surprising and not what I meant.
The names need to fit together, but they also need to be short. A replacement for "reactor" needs to fit nicely for inlined JSX. In #5 I proposed "sub". Other attempts were: (repeat)
rep()
, (subscribe)sub()
,link()
, (connect)con()
,anew()
, (socket)sock()
,sync()
, ...I've picked WireSignal and WireCore right now.
Here are the new exports of Haptic Wire:
TypeScript will still show the functions created by
signal()
/signalsFrom()
andcore()
as WireSignal and WireCore respectively, which is good since I want them to be related by a prefix. There's a new export,signal
, which creates an unnamed signal. The original form of signal creation using an object (which encourages/simplifies naming to help debugging) is nowsignalsFrom
. I also changed "adopt" to show that it's to be used for cores. Internally, some FSM names were changed and the function properties on signals and cores now have nice closer-to-full-length names such as "signalRS" rather than "sS"; JSDoc describes these.This hurts bundle size (see commits) but I'm trying to care about that less.