@symbiotejs/symbiote 1.1.1
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/LICENSE +21 -0
- package/README.md +115 -0
- package/build/symbiote.base.jsdoc.js +697 -0
- package/build/symbiote.base.min.js +1 -0
- package/build/symbiote.jsdoc.js +1394 -0
- package/build/symbiote.min.js +1 -0
- package/package.json +108 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Uploadcare (hello@uploadcare.com). All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Symbi<span style="color:#f0f">ΰ° </span>te.js
|
|
2
|
+
|
|
3
|
+
## Ultralight and ultrapowerful library to create widgets, organize micro-frontends, build reusable embeddable components and libraries. Everything you need for your modern web application!
|
|
4
|
+
|
|
5
|
+
### π₯ Core benefits
|
|
6
|
+
* Minimalistic but reach
|
|
7
|
+
* No additional dependencies
|
|
8
|
+
* Ultralight (2.7kb br/gzip for featurefull CDN version)
|
|
9
|
+
* Blazing fast (faster than most of the other mainstream solutions. All of them.)
|
|
10
|
+
* Memory friendly (no any redux-like immutables)
|
|
11
|
+
* CSP friendly - good for enterprise usage
|
|
12
|
+
* Highly extensible
|
|
13
|
+
* Easy to learn - nothing completely new for experienced developers, nothing complicated for newbies
|
|
14
|
+
* Works in all modern browsers. As is.
|
|
15
|
+
* Easy to test
|
|
16
|
+
* TypeScript friendly - use it in TS or JS projects from the common source code
|
|
17
|
+
* Integration friendly: works with any modern development stack
|
|
18
|
+
* Lifecycle control: no need to initiate something from outside
|
|
19
|
+
* ESM friendly - native JavaScript modules are best!
|
|
20
|
+
* Developer Experience on the mind: compact & convenient APIs, habitual syntax
|
|
21
|
+
* Open source (MIT license)
|
|
22
|
+
|
|
23
|
+
### π Tech concept keypoints
|
|
24
|
+
* Native `DocumentFragment` instead of expensive Virtual DOM sync
|
|
25
|
+
* Shadow DOM is optional. Use it when you need it only
|
|
26
|
+
* Styling approach: total freedom, from the old classics to the cutting age platforn abilities
|
|
27
|
+
* Native HTML and DOM API instead of expensive custom template syntax processing
|
|
28
|
+
* Templates are out of the component or render function context. Itβs just a simple JavaScript template literals. So you can keep or process them wherever you want
|
|
29
|
+
* No logical operators in templates. Logic and presentation is strictly separated.
|
|
30
|
+
* Fast synchronous UI updates
|
|
31
|
+
* Full data context access from the document structure
|
|
32
|
+
* Full data context availability for template bindings
|
|
33
|
+
* DOM API friendly approach for the most perfomant solutions
|
|
34
|
+
* Convenient object model access instead of opaque abstractions
|
|
35
|
+
* Custom Elements work strange sometimes. Donβt worry about that, we do (construction flow)
|
|
36
|
+
|
|
37
|
+
### π Quick start
|
|
38
|
+
Easiest way to try Symbiote.js is to create simple `html` file in your text editor and connect the Symbiote base class from web:
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<script type="module">
|
|
42
|
+
import { BaseComponent } from 'https://symbiotejs.github.io/symbiote.js/core/BaseComponent.js';
|
|
43
|
+
|
|
44
|
+
class MyComponent extends BaseComponent {
|
|
45
|
+
init$ = {
|
|
46
|
+
count: 0,
|
|
47
|
+
increment: () => {
|
|
48
|
+
this.$.count++;
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
MyComponent.template = /*html*/ `
|
|
54
|
+
<h2 set="textContent: count"></h2>
|
|
55
|
+
<button set="onclick: increment">Click me!</button>
|
|
56
|
+
`;
|
|
57
|
+
|
|
58
|
+
MyComponent.reg('my-component');
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<my-component></my-component>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**This code can work directly in any modern browser, so you don't need to install anything to try it!**
|
|
65
|
+
|
|
66
|
+
## π§ββοΈ Dive deeper
|
|
67
|
+
* [Installation](https://github.com/symbiotejs/docsite/blob/main/md/Installation.md)
|
|
68
|
+
* [Templates](https://github.com/symbiotejs/docsite/blob/main/md/Templates.md)
|
|
69
|
+
* [Lifecycle](https://github.com/symbiotejs/docsite/blob/main/md/Lifecycle.md)
|
|
70
|
+
* [Component data context](https://github.com/symbiotejs/docsite/blob/main/md/Component_data_context.md)
|
|
71
|
+
* [Attribute binding](https://github.com/symbiotejs/docsite/blob/main/md/Attribute_binding.md)
|
|
72
|
+
* [Extending](https://github.com/symbiotejs/docsite/blob/main/md/Extending.md)
|
|
73
|
+
* [Naming collisions](https://github.com/symbiotejs/docsite/blob/main/md/Naming_collisions.md)
|
|
74
|
+
* Data (pub/sub)
|
|
75
|
+
* Routing
|
|
76
|
+
* Domain specific data
|
|
77
|
+
* DOM helpers
|
|
78
|
+
* Indexed DB
|
|
79
|
+
* [TypeScript](https://github.com/symbiotejs/docsite/blob/main/md/TypeScript.md)
|
|
80
|
+
* Solution history
|
|
81
|
+
* Playground
|
|
82
|
+
|
|
83
|
+
## π€ Live examples
|
|
84
|
+
Browser: https://symbiotejs.github.io/examples/
|
|
85
|
+
> Use devtools to discover details
|
|
86
|
+
|
|
87
|
+
GitHub: https://github.com/symbiotejs/examples
|
|
88
|
+
|
|
89
|
+
## β
Browser support
|
|
90
|
+
Symbiote.js is supported and tested in all major modern desktop and mobile browsers:
|
|
91
|
+
* Chrome
|
|
92
|
+
* Firefox
|
|
93
|
+
* Safari
|
|
94
|
+
* Edge
|
|
95
|
+
* Opera
|
|
96
|
+
* etc...
|
|
97
|
+
|
|
98
|
+
**Internet Explorer** - is outdated and not supported anymore:
|
|
99
|
+
|
|
100
|
+
https://uploadcare.com/blog/uploadcare-stops-internet-explorer-support/
|
|
101
|
+
|
|
102
|
+
(But it's possible with polyfills: https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs)
|
|
103
|
+
|
|
104
|
+
## π° General sponsor
|
|
105
|
+
Big thanks to π‘ **Uploadcare** for supporting this project!
|
|
106
|
+
|
|
107
|
+
> https://uploadcare.com/
|
|
108
|
+
|
|
109
|
+
### π Useful external links:
|
|
110
|
+
* https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements
|
|
111
|
+
* https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM
|
|
112
|
+
* https://custom-elements-everywhere.com
|
|
113
|
+
* https://open-wc.org/
|
|
114
|
+
|
|
115
|
+
## If you have questions or proposals - welcome to [Symbiote Discussions](https://github.com/symbiotejs/symbiote.js/discussions)! β€οΈ
|