neo.mjs 8.14.0 → 8.14.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/apps/ServiceWorker.mjs +2 -2
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/examples/ServiceWorker.mjs +2 -2
- package/package.json +1 -1
- package/resources/data/deck/learnneo/pages/gettingstarted/ComponentModels.md +8 -7
- package/src/DefaultConfig.mjs +2 -2
- package/src/component/Base.mjs +1 -1
package/apps/ServiceWorker.mjs
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Neo has a feature that allows shared, bindable, data.
|
2
2
|
|
3
|
-
A
|
3
|
+
A _state provider_ — `Neo.state.Provider` — instance holds properties that
|
4
4
|
can be bound to component properties.
|
5
5
|
|
6
6
|
<pre data-neo>
|
@@ -12,7 +12,7 @@ class MainView extends Container {
|
|
12
12
|
static config = {
|
13
13
|
className: 'GS.data1.MainView',
|
14
14
|
|
15
|
-
|
15
|
+
stateProvider: {
|
16
16
|
data: {
|
17
17
|
foo: 'Hi there!'
|
18
18
|
}
|
@@ -83,7 +83,7 @@ class MainView extends Container {
|
|
83
83
|
static config = {
|
84
84
|
className: 'GS.data2.MainView',
|
85
85
|
|
86
|
-
|
86
|
+
stateProvider: {
|
87
87
|
data: {
|
88
88
|
foo: 'parent'
|
89
89
|
}
|
@@ -95,8 +95,9 @@ class MainView extends Container {
|
|
95
95
|
module: MyPanel
|
96
96
|
}, {
|
97
97
|
module: MyPanel,
|
98
|
-
// You wouldn't normally configure a
|
99
|
-
|
98
|
+
// You wouldn't normally configure a state provider.
|
99
|
+
// We're doing it here to illustrate state provider scope.
|
100
|
+
stateProvider: {
|
100
101
|
data: {
|
101
102
|
foo: 'child'
|
102
103
|
}
|
@@ -109,7 +110,7 @@ MainView = Neo.setupClass(MainView);
|
|
109
110
|
</pre>
|
110
111
|
|
111
112
|
In this case, the main view has three child items of type `MyPanel`, each containing a label.
|
112
|
-
The main view has a
|
113
|
+
The main view has a state provider with a `foo` property, and the third child has its own state provider with a `foo` property.
|
113
114
|
|
114
115
|
<img width="75%" src="https://s3.amazonaws.com/mjs.neo.learning.images/gettingStarted/vm/VisualHierarchyFooShadowed.png"></img>
|
115
116
|
|
@@ -124,5 +125,5 @@ because the third copy of `MyPanel` has its own view model with the `foo` proper
|
|
124
125
|
|
125
126
|
## Conclusion
|
126
127
|
|
127
|
-
The Neo.mjs
|
128
|
+
The Neo.mjs state provider and binding approach is simple and powerful. It gives you easy control
|
128
129
|
over the scope of a value, which means you can share properties as globally or narrowly as needed.
|
package/src/DefaultConfig.mjs
CHANGED
@@ -262,12 +262,12 @@ const DefaultConfig = {
|
|
262
262
|
useVdomWorker: true,
|
263
263
|
/**
|
264
264
|
* buildScripts/injectPackageVersion.mjs will update this value
|
265
|
-
* @default '8.14.
|
265
|
+
* @default '8.14.1'
|
266
266
|
* @memberOf! module:Neo
|
267
267
|
* @name config.version
|
268
268
|
* @type String
|
269
269
|
*/
|
270
|
-
version: '8.14.
|
270
|
+
version: '8.14.1'
|
271
271
|
};
|
272
272
|
|
273
273
|
Object.assign(DefaultConfig, {
|
package/src/component/Base.mjs
CHANGED
@@ -2300,7 +2300,7 @@ class Component extends Base {
|
|
2300
2300
|
// Verify that the critical rendering path => CSS files for the new tree is in place
|
2301
2301
|
if (currentWorker.countLoadingThemeFiles !== 0) {
|
2302
2302
|
currentWorker.on('themeFilesLoaded', function() {
|
2303
|
-
me.render(mount)
|
2303
|
+
!me.mounted && me.render(mount)
|
2304
2304
|
}, me, {once: true});
|
2305
2305
|
|
2306
2306
|
return
|