@twobirds/microcomponents 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,33 +4,33 @@
|
|
|
4
4
|
|
|
5
5
|
**This code aims at improving Javascript modularity and encapsulation**.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
So importing a custom MC in your client side code like this:
|
|
7
|
+
Importing a custom MC in your client side code:
|
|
10
8
|
```javascript
|
|
11
9
|
import MyButton from '@mySampleLib/Button';
|
|
12
10
|
```
|
|
13
|
-
...
|
|
11
|
+
... is equivalent to:
|
|
14
12
|
```javascript
|
|
15
13
|
npm i @mySampleLib/Button;
|
|
16
14
|
```
|
|
17
15
|
... on the server side.
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
Imagine your micro components to be organized like a "node_modules" directory that is attached to a DOM node.
|
|
18
|
+
|
|
19
|
+
**On the client side** MCs reside inside DOM nodes in a "_mc" property, or inside each other recursively. Usually they provide a direct interface to their inner code.
|
|
20
20
|
|
|
21
21
|
**On the server side** MCs can be used to organize your code, too.
|
|
22
22
|
|
|
23
|
+
## Status
|
|
24
|
+
WIP. Micro components should be done soon, as in days.
|
|
25
|
+
|
|
23
26
|
## Disclaimer
|
|
27
|
+
I decided to extract this functionality from the [twoBirds framework](https://www.npmjs.com/package/twobirds-core), since it is framework agnostic, and relies solely on the standard DOM and native javascript or typescript, and is a useful tool in itself. Later this will be backported into twoBirds as a dependency, and twoBirds will become completely modularized on the base of MCs.
|
|
28
|
+
|
|
24
29
|
This is a massive undertaking. MCs are just the foundation of what I do. I am about to **dump** [20+ years of javascript programming](https://gitlab.com/twoBirds/microcomponents/-/blob/main/microcomponents_magic.md?ref_type=heads#things-i-already-did-with-this-in-my-own-framework-twobirds-or-in-apps-that-i-developed-with-it) **into open source libraries**, so feel free to [fund this](https://gofund.me/076c614c). The better this is funded, the faster it will be done. Given enough resources, I will start a crowdfunded company that will develop a new ecosystem for javascript/typescript programming.
|
|
25
30
|
|
|
26
31
|
By **"Open Source"** I mean **really free and open**, as **you get all my inner source code with it**. Once you understand the Micro Component principle, you are back in command of your software, no matter what MC functionality you import in your system. Since **Micro Components** are encapsuled, off-shoring and near-shoring is no problem, and reusability is guaranteed. Your external coders do not need to access your code repository or your toolchain. They only need to understand MCs.
|
|
27
32
|
|
|
28
|
-
Established frameworks provide a documented interface to a hidden layer of closed source inner functionality
|
|
29
|
-
|
|
30
|
-
I decided to extract this functionality from the [twoBirds framework](https://www.npmjs.com/package/twobirds-core), since it is framework agnostic, and relies solely on the standard DOM and native javascript or typescript, and is a useful tool in itself. Also this will be a dependency in twoBirds then.
|
|
31
|
-
|
|
32
|
-
## Status
|
|
33
|
-
WIP. Micro components should be done soon, as in days.
|
|
33
|
+
**Established frameworks**, as opposed to MCs, **provide a documented interface to a hidden layer of closed source inner functionality**. MCs can be used to **add an interface to components you developed using other frameworks**. So you can still use your existing code, and MCs in it. But you will want to migrate it ASAP, since MCs work with any FW.
|
|
34
34
|
|
|
35
35
|
## General
|
|
36
36
|
|