@spearwolf/shadow-objects 0.6.0 → 0.7.0

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.
Files changed (51) hide show
  1. package/README.md +23 -54
  2. package/bundle.js +4 -4
  3. package/package.json +7 -3
  4. package/src/create-worker.bundle.d.ts.map +1 -1
  5. package/src/create-worker.bundle.js +4 -2
  6. package/src/create-worker.bundle.js.map +1 -1
  7. package/src/elements/ShaeElement.d.ts +5 -5
  8. package/src/elements/ShaeElement.d.ts.map +1 -1
  9. package/src/elements/ShaeElement.js +22 -17
  10. package/src/elements/ShaeElement.js.map +1 -1
  11. package/src/elements/ShaeEntElement.d.ts.map +1 -1
  12. package/src/elements/ShaeEntElement.js +6 -8
  13. package/src/elements/ShaeEntElement.js.map +1 -1
  14. package/src/elements/ShaeWorkerElement.d.ts +4 -0
  15. package/src/elements/ShaeWorkerElement.d.ts.map +1 -1
  16. package/src/elements/ShaeWorkerElement.js +3 -8
  17. package/src/elements/ShaeWorkerElement.js.map +1 -1
  18. package/src/elements.d.ts +4 -0
  19. package/src/elements.d.ts.map +1 -0
  20. package/src/elements.js +4 -0
  21. package/src/elements.js.map +1 -0
  22. package/src/entities/Entity.d.ts.map +1 -1
  23. package/src/entities/Entity.js +6 -7
  24. package/src/entities/Entity.js.map +1 -1
  25. package/src/entities/ShadowObject.d.ts.map +1 -1
  26. package/src/entities/SignalsPath.d.ts +1 -1
  27. package/src/entities/SignalsPath.d.ts.map +1 -1
  28. package/src/entities/SignalsPath.js +2 -1
  29. package/src/entities/SignalsPath.js.map +1 -1
  30. package/src/index.d.ts +0 -6
  31. package/src/index.d.ts.map +1 -1
  32. package/src/index.js +0 -6
  33. package/src/index.js.map +1 -1
  34. package/src/utils/ConsoleLogger.d.ts.map +1 -1
  35. package/src/utils/attr-utils.d.ts.map +1 -1
  36. package/src/utils/props-utils.d.ts.map +1 -1
  37. package/src/utils/toNamespace.d.ts.map +1 -1
  38. package/src/utils/toUrlString.d.ts.map +1 -1
  39. package/src/utils/waitForMessageOfType.d.ts.map +1 -1
  40. package/src/view/RemoteWorkerEnv.d.ts +1 -1
  41. package/src/view/RemoteWorkerEnv.d.ts.map +1 -1
  42. package/src/view/RemoteWorkerEnv.js +8 -8
  43. package/src/view/RemoteWorkerEnv.js.map +1 -1
  44. package/src/view/ViewComponent.d.ts +1 -1
  45. package/src/view/ViewComponent.js +2 -2
  46. package/src/worker/WorkerRuntime.d.ts.map +1 -1
  47. package/tsconfig.lib.tsbuildinfo +1 -1
  48. package/src/entities/SignalsMap.d.ts +0 -12
  49. package/src/entities/SignalsMap.d.ts.map +0 -1
  50. package/src/entities/SignalsMap.js +0 -35
  51. package/src/entities/SignalsMap.js.map +0 -1
package/README.md CHANGED
@@ -1,69 +1,38 @@
1
- # Welcome to _shadow-ents_ :wave:
1
+ _hi! welcome to .._
2
+ # shadow-objects :wave:
2
3
 
3
- shadow-objects is a JavaScript library that's all about making your life easier when dealing with components and web workers. It's like having a superpower for your web development! :muscle:
4
+ ## Introduction
5
+
6
+ _Shadow-objects_ is a standalone entity component framework.
7
+ The original idea is visualized in this overview:
4
8
 
5
9
  ![architecture overview](./docs/architecture@2x.png)
6
10
 
7
11
  > _ents_ is short for latin _"entitatis"_, which translates to _"shadow entities"_
8
12
 
13
+ > [!IMPORTANT]
14
+ > _Dear adventurer, be warned: everything here is highly experimental and in active development and constant flux!_
9
15
 
10
- ## Quick Tour
11
-
12
- ### Offloading to Web Workers :construction_worker:
13
-
14
- shadow-objects takes the heavy lifting off your main thread and moves it to web workers. This means your components stay light and breezy, just like a hibiscus flower in the wind. :hibiscus:
15
-
16
- ### Entities :ghost:
17
-
18
- Yes, we've got entities too! In shadow-objects, an _entity_ belongs to a _view-component_, but it lives in a _web worker_. That's why we call them _shadow-entities_. They're like the secret agents of your app, working behind the scenes in their own separate world.
19
-
20
- ### Shadow Objects :package:
21
-
22
- The _shadow-objects_ are simple functions or classes created by the user (you!) and form logical units of code in which the real work is done behind the scenes.
23
-
24
- Shadow-objects reside within the context of an entity and have access to the entity's properties and events, which mirror the properties and events of the view-components.
25
-
26
- Any number of independent shadow-objects can be attached to an entity.
27
-
28
- Shadow-objects can also provide any _context_ to other shadow-objects:
29
- - a _context_ has a name and can consist of any JavaScript value or object.
30
- - a _context_ is inherited by subtrees through the hierarchy of entities.
31
-
32
-
33
- ### View Components :eyes:
16
+ The components are created in the view space. Hierarchical. In your browser. There is a JavaScript API for this. But to keep things simple, there are also ready-to-use web components.
34
17
 
18
+ ```html
19
+ <shae-worker-env local? src="./my-personal-shadow-objects.js" />
35
20
 
36
- A `<view-component/>` is a virtual component in the view that serves as an access point for the entities.
21
+ <shae-ent ns? token="foo">
22
+ <shae-ent ns? token="bar">
23
+ <shae-prop name="myNumbers" value="1 2 3" type="integer[]" />
24
+ </shae-ent>
25
+ </shae-ent>
26
+ ```
37
27
 
38
- The _shadow-ents_ package provides the custom element `<shadow-objects>` as view component. As a HTML element in the DOM, these might form their own hierarchy.
39
- This hierarchy is mirrored by the entities in the worker, keeping everything in sync.
28
+ > [!WARNING]
29
+ > Sorry, at this point there should be a precise and crisp introduction to the concepts of the framework, but unfortunately this is not currently available.
30
+ > Instead of that, a few insights into the implementation will follow
40
31
 
41
- In the future, implementations as _react_ or _angular_ components are also conceivable.
32
+ Here is the big class graph overview:
33
+ ![class graph overview](./src/view/ClassGraphOverview.drawio.svg)
42
34
 
43
-
44
- ### Component Context :brain:
45
-
46
- The _component-context_ is the root of a view-component hierarchy. It's like the conductor of an orchestra, creating a web worker and making sure the entities and their components are in harmony.
47
-
48
- ### Kernel :nut_and_bolt:
49
-
50
- Inside the worker, there's the _kernel_. It's the counterpart to the component-context, taking care of the lifecycle of the entities and their _shadow-objects_.
51
-
52
- ### Tokens :label:
53
-
54
- When a view-component is created, you can apply a string-based token. The kernel uses these to decide which shadow-objects to create within each entity. It's like giving your components a secret handshake!
55
-
56
- ### Event and Property Synchronization :arrows_counterclockwise:
57
-
58
- View-components can send events to their entities, which are then passed on to the shadow-objects. This also works the other way around. However, property synchronization only goes one way, from view-components to entities.
59
-
60
- - - -
61
-
62
- So, that's a quick tour of shadow-objects! It's all about making your web ui faster and more responsive, and assembling your code in a more structured and streamlined way. Give it a try and see the difference it can make in your projects! :rocket:
63
-
64
- More in-depth documentation here:
35
+ More in-depth docs here:
65
36
  - [ShadowEnv](./src/view/README.md)
66
37
  - [ComponentContext](./src/view/ComponentContext.md)
67
38
  - [ViewComponent](./src/view/ViewComponent.md)
68
-
69
- > _but dear adventurer, be warned: everything here is highly experimental and in active development and constant flux!_