neo.mjs 9.0.1 → 9.0.2
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/apps/ServiceWorker.mjs +2 -2
- package/apps/portal/index.html +1 -1
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/examples/ServiceWorker.mjs +2 -2
- package/package.json +5 -5
- package/resources/data/deck/learnneo/pages/benefits/ConfigSystem.md +64 -0
- package/resources/data/deck/learnneo/tree.json +1 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/container/Base.mjs +1 -1
- package/src/data/RecordFactory.mjs +1 -1
package/apps/ServiceWorker.mjs
CHANGED
package/apps/portal/index.html
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "neo.mjs",
|
3
|
-
"version": "9.0.
|
3
|
+
"version": "9.0.2",
|
4
4
|
"description": "The webworkers driven UI framework",
|
5
5
|
"type": "module",
|
6
6
|
"repository": {
|
@@ -52,20 +52,20 @@
|
|
52
52
|
"chalk": "^5.4.1",
|
53
53
|
"clean-webpack-plugin": "^4.0.0",
|
54
54
|
"commander": "^13.1.0",
|
55
|
-
"cssnano": "^7.0.
|
55
|
+
"cssnano": "^7.0.7",
|
56
56
|
"envinfo": "^7.14.0",
|
57
57
|
"fs-extra": "^11.3.0",
|
58
58
|
"highlightjs-line-numbers.js": "^2.9.0",
|
59
|
-
"inquirer": "^12.6.
|
59
|
+
"inquirer": "^12.6.1",
|
60
60
|
"marked": "^15.0.11",
|
61
61
|
"monaco-editor": "0.50.0",
|
62
62
|
"neo-jsdoc": "1.0.1",
|
63
63
|
"neo-jsdoc-x": "1.0.5",
|
64
64
|
"postcss": "^8.5.3",
|
65
|
-
"sass": "^1.
|
65
|
+
"sass": "^1.88.0",
|
66
66
|
"siesta-lite": "5.5.2",
|
67
67
|
"url": "^0.11.4",
|
68
|
-
"webpack": "^5.99.
|
68
|
+
"webpack": "^5.99.8",
|
69
69
|
"webpack-cli": "^6.0.1",
|
70
70
|
"webpack-dev-server": "^5.2.1",
|
71
71
|
"webpack-hook-plugin": "^1.0.7",
|
@@ -0,0 +1,64 @@
|
|
1
|
+
## Introduction
|
2
|
+
|
3
|
+
Modern JavaScript frameworks have revolutionized front-end development by providing declarative ways to build
|
4
|
+
user interfaces, primarily centered around enhancing HTML with custom syntax like JSX or Angular directives.
|
5
|
+
However, the complexity of applications extends far beyond the Document Object Model (DOM), encompassing crucial
|
6
|
+
non-DOM entities such as data stores, state providers, routers, view controllers, selection models, and layouts.
|
7
|
+
While existing frameworks offer solutions for managing these aspects, they often lack a truly consistent, declarative,
|
8
|
+
and nested approach to their configuration, a gap that a class config system aims to fill.
|
9
|
+
|
10
|
+
## A bad example
|
11
|
+
I recently found this Angular code snippet (new public API draft) on LinkedIn:
|
12
|
+
|
13
|
+
<pre data-javascript>
|
14
|
+
// MyComponent with an attribute
|
15
|
+
<MyComponent myAttribute="someValue" />
|
16
|
+
|
17
|
+
// MyComponent with an input binding
|
18
|
+
<MyComponent [myInput]="mySignal()" />
|
19
|
+
|
20
|
+
// MyComponent is the host element
|
21
|
+
<MyComponent @MyDirective />
|
22
|
+
|
23
|
+
// Same as the selector: a[mat-button], anchor element is the host element
|
24
|
+
<MatButton:a></MatButton:a>
|
25
|
+
|
26
|
+
// Scoped inputs for MyDirective
|
27
|
+
<MyComponent @MyDirective(input1="someString" [input2]="mySignal()") />
|
28
|
+
</pre>
|
29
|
+
|
30
|
+
Now you might wonder why I think that this is not a good way to create apps.
|
31
|
+
|
32
|
+
Currently, the configuration and management of these non-DOM entities can feel somewhat disparate across different
|
33
|
+
frameworks. State management, for instance, might involve dedicated libraries (like Redux or Vuex), routing is
|
34
|
+
handled by router-specific configurations, and layouts might be defined through a mix of component composition and
|
35
|
+
potentially separate layout configurations. While these solutions are functional, they don't always present a
|
36
|
+
unified configuration tree that mirrors the nested, hierarchical structure often used for describing the UI.
|
37
|
+
The syntax and patterns for configuring a data store can be quite different from those used to define a route or
|
38
|
+
a view controller.
|
39
|
+
|
40
|
+
This is where the benefit of a class config system becomes apparent. The vision is a system that allows developers
|
41
|
+
to describe the desired state and relationships of all application components, regardless of whether they directly
|
42
|
+
interact with the DOM, using a consistent, declarative, and nested configuration structure.
|
43
|
+
|
44
|
+
Imagine defining your application's data stores, their initial states, and how they relate to each other, alongside
|
45
|
+
the routes of your application, the view controllers responsible for handling those routes, and the layouts they will
|
46
|
+
use – all within a unified configuration syntax. This nested structure would clearly illustrate the dependencies and
|
47
|
+
composition of the application's various parts, offering a holistic view that is often obscured when non-DOM elements
|
48
|
+
are configured in isolation using different mechanisms.
|
49
|
+
|
50
|
+
## Key advantages
|
51
|
+
A class config system, by treating all application entities as configurable classes within a unified hierarchy,
|
52
|
+
offers several key advantages:
|
53
|
+
|
54
|
+
* ***Consistency***: Provides a single, predictable way to configure any part of the application, reducing the cognitive load on developers who would otherwise need to learn and context-switch between different configuration paradigms for DOM and non-DOM elements.
|
55
|
+
* ***Declarative Clarity***: Enables developers to declare the desired state and relationships of their application's components in a clear and concise manner, rather than writing imperative code to set up and connect these entities. This improves readability and maintainability.
|
56
|
+
* ***Nested Structure***: Allows for the natural expression of hierarchical relationships between components, whether they are parent-child UI elements or a router managing various routes, each with associated view controllers and data requirements. This mirrors the often tree-like structure of applications.
|
57
|
+
* ***Improved Maintainability***: Changes to the application's structure or behavior can be made in a centralized and organized configuration, rather than spread across various imperative code snippets and disparate configuration files.
|
58
|
+
* ***Enhanced Tooling and Abstraction***: A unified system provides a solid foundation for building powerful development tools, such as visual editors or automatic documentation generators, that can understand and manipulate the entire application's structure. It also allows for higher levels of abstraction, potentially simplifying the definition of complex application patterns.
|
59
|
+
* ***Reactive Configuration***: Similar to how UI frameworks react to state changes and update the DOM, a reactive class config system can react to changes in the configuration itself (in a development context, for example) to facilitate hot module replacement or dynamic updates of non-DOM entities.
|
60
|
+
|
61
|
+
While existing frameworks have made significant strides in declarative UI development, the concept of extending this
|
62
|
+
declarative, nested configuration approach consistently to all aspects of an application, particularly the non-DOM realm,
|
63
|
+
represents a powerful next step. A class config system holds the promise of a more unified, maintainable, and
|
64
|
+
understandable way to build complex modern web applications.
|
@@ -3,6 +3,7 @@
|
|
3
3
|
{"name": "Benefits", "parentId": null, "isLeaf": false, "id": "Benefits"},
|
4
4
|
{"name": "Introduction ", "parentId": "Benefits", "id": "benefits.Introduction"},
|
5
5
|
{"name": "Off the Main Thread", "parentId": "Benefits", "id": "benefits.Multi-Threading"},
|
6
|
+
{"name": "Unified Config System", "parentId": "Benefits", "id": "benefits.ConfigSystem"},
|
6
7
|
{"name": "Extreme Speed", "parentId": "Benefits", "id": "benefits.Speed"},
|
7
8
|
{"name": "Multi-Window Applications", "parentId": "Benefits", "id": "benefits.Multi-Window"},
|
8
9
|
{"name": "Quick Application Development", "parentId": "Benefits", "id": "benefits.Quick"},
|
package/src/DefaultConfig.mjs
CHANGED
@@ -263,12 +263,12 @@ const DefaultConfig = {
|
|
263
263
|
useVdomWorker: true,
|
264
264
|
/**
|
265
265
|
* buildScripts/injectPackageVersion.mjs will update this value
|
266
|
-
* @default '9.0.
|
266
|
+
* @default '9.0.2'
|
267
267
|
* @memberOf! module:Neo
|
268
268
|
* @name config.version
|
269
269
|
* @type String
|
270
270
|
*/
|
271
|
-
version: '9.0.
|
271
|
+
version: '9.0.2'
|
272
272
|
};
|
273
273
|
|
274
274
|
Object.assign(DefaultConfig, {
|
package/src/container/Base.mjs
CHANGED
@@ -331,7 +331,7 @@ class Container extends Component {
|
|
331
331
|
parent = item.parent;
|
332
332
|
|
333
333
|
if (parent && parent !== me) {
|
334
|
-
parent.remove(item, false);
|
334
|
+
parent.remove?.(item, false);
|
335
335
|
delete item.vdom.removeDom;
|
336
336
|
|
337
337
|
// Convenience logic, especially for moving components into different browser windows:
|
@@ -155,7 +155,7 @@ class RecordFactory extends Base {
|
|
155
155
|
me[isModifiedSymbol] = false
|
156
156
|
}
|
157
157
|
|
158
|
-
me.setSilent(config)
|
158
|
+
me.setSilent(config) // We do not want to fire change events when constructing
|
159
159
|
}
|
160
160
|
|
161
161
|
/**
|