Raising an atom, approach 2.0.1

Not even a year has passed, the second article is about the data reactivity . The goal of the current development cycle is to understand the concepts and fix the library API. As an author striving for polyglotism, it became violet for me to describe pens.
- Anyway, the Matrix has too much information to decode it.
You just need to get used to it.
I don’t see the code at all.
I see a blonde, a brunette, a redhead.

image

So, introducing alak 2.0.1-RC


According to my map of knowledge of the field of functional programming, the basic particle of the library is still a functor swinging to the monad (and vice versa if the view of the ancient Greek philosophers). The map will never become a territory, and in the current reincarnation it was decided to get out of this dense forest / wild jungle of functional terminology and prepare documentation in their native, human language.

To generate documentation, I tried the documenter of the api-extractor package from microsoft, packing the resulting marqdown into docusaurus from facebook.

Here's what happened: alak.now.sh

It seems optimal to generate statics for the documentation site to your taste from json received from api-extractor. Docusaurus and documenter carry with them a certain flare and monstrosity of a corporate approach to development. Everything can be much easier and more beautiful, it was necessary to add several intermediate transformations for the compactness of the site.

Brick for TypeScript


The kernel of past versions of the library was provided Proxy. After measuring performance, the __proto__difference was small compared to . Both solutions are fast enough and economical from memory. The solution of the current version starts by default on __proto__. The use of prototypes in the script ruthlessly throws towards the creation of classes, whose performance is significantly lower. Like enum, at first it seemed like a cool solution, but now I just use a constant or typed strings because of the non-obvious behavior of enum during serialization. I love generics and belong to authors who consider the C # rules (under which the official TS documentation is mowed) redundant in the JS world. I saw a lot of abuse in the direction of typescript for the type any , I believe it is the existence of this type that makes typescript js code great. (again))

noImplicitAny:false

Usually you have to put this in the config because you need to wean TS out of being like C #. Types and generics for JS, IMHO, should not pull up a new philosophy. However, the library strives to be 100% TS compliant. I promise to add type testing in all severity. Compiled js bundles are being tested now, so it seemed better.

So what the ... Alak?


Maybe someone remembers the post of September 1, 2014 Atom - the minimum brick of a reactive application . Alak is an atom of the 2020 version used on JS combat projects to create various MV * (mainly MVVM) design patterns. Since this is a fairly lightweight and fast solution, there was an application on the server for managing sockets, sessions, and users. For 4 years already I have been cherishing something like spring for simple and complex logic based on the atom, this is possible another time. And now, I propose to get acquainted with managing the state of a component outside it from anywhere in the universe of your code.

Codeandbox example

Very often, you don’t need to pull up any cool side.
We take the atom, hook, logic, and you're done.

Once I did a big project on vue2, and tried to share the code of my big and cool store for vue, even got 15 stars from the Chinese. But on the next big vue project, the stor changed conceptually, and now projects on jsx with hooks have gone. The basis has always used this reactive particle. This alternative to the generation ahead of bus events, the pattern Observer, and other libraries of the communication module A with module / remarkable combination Bed and .

Bla bla spaghetti
12 ActionScript, MVC . - MVC-, - . , , β€” mvcExpress. , , , .

-, . mobx effector. . , - redux. /, .

. -, ( ). . , . . js-.


To be or not to be?


Since the last article, it seems that all the embarrassing readers have been taken into account. Now there should be no questions about API handles, what is up and down . I tried to make the names as reflective of the essence of the action as possible, the documentation in Russian is available in all IDEs and codesandbox from auto-prompts.


The first version has not been set, the second is not yet.
How to check version availability?
What is missing?

All Articles