neo.mjs 10.0.0-alpha.5 → 10.0.0-beta.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/ServiceWorker.mjs +2 -2
- package/apps/colors/view/GridContainer.mjs +1 -1
- package/apps/covid/view/AttributionComponent.mjs +1 -1
- package/apps/covid/view/HeaderContainer.mjs +6 -6
- package/apps/covid/view/MainContainerController.mjs +5 -5
- package/apps/covid/view/TableContainerController.mjs +1 -1
- package/apps/covid/view/country/Gallery.mjs +13 -13
- package/apps/covid/view/country/Helix.mjs +13 -13
- package/apps/covid/view/country/HistoricalDataTable.mjs +1 -1
- package/apps/email/view/Viewport.mjs +2 -2
- package/apps/form/view/SideNavList.mjs +1 -1
- package/apps/portal/index.html +1 -1
- package/apps/portal/resources/data/examples_devmode.json +26 -27
- package/apps/portal/resources/data/examples_dist_dev.json +26 -27
- package/apps/portal/resources/data/examples_dist_esm.json +25 -26
- package/apps/portal/resources/data/examples_dist_prod.json +26 -27
- package/apps/portal/view/HeaderToolbar.mjs +3 -3
- package/apps/portal/view/about/Container.mjs +2 -2
- package/apps/portal/view/about/MemberContainer.mjs +3 -3
- package/apps/portal/view/blog/List.mjs +7 -7
- package/apps/portal/view/examples/List.mjs +4 -4
- package/apps/portal/view/home/ContentBox.mjs +2 -2
- package/apps/portal/view/home/FeatureSection.mjs +3 -3
- package/apps/portal/view/home/FooterContainer.mjs +7 -7
- package/apps/portal/view/home/parts/AfterMath.mjs +3 -3
- package/apps/portal/view/home/parts/MainNeo.mjs +3 -3
- package/apps/portal/view/home/parts/References.mjs +6 -6
- package/apps/portal/view/learn/ContentComponent.mjs +102 -111
- package/apps/portal/view/learn/PageSectionsContainer.mjs +1 -1
- package/apps/portal/view/learn/PageSectionsList.mjs +2 -2
- package/apps/portal/view/services/Component.mjs +16 -16
- package/apps/realworld/view/FooterComponent.mjs +1 -1
- package/apps/realworld/view/HeaderComponent.mjs +8 -8
- package/apps/realworld/view/HomeComponent.mjs +6 -6
- package/apps/realworld/view/article/CommentComponent.mjs +4 -4
- package/apps/realworld/view/article/Component.mjs +14 -14
- package/apps/realworld/view/article/CreateCommentComponent.mjs +3 -3
- package/apps/realworld/view/article/CreateComponent.mjs +3 -3
- package/apps/realworld/view/article/PreviewComponent.mjs +1 -1
- package/apps/realworld/view/article/TagListComponent.mjs +2 -2
- package/apps/realworld/view/user/ProfileComponent.mjs +8 -8
- package/apps/realworld/view/user/SettingsComponent.mjs +4 -4
- package/apps/realworld/view/user/SignUpComponent.mjs +4 -4
- package/apps/realworld2/view/FooterComponent.mjs +1 -1
- package/apps/realworld2/view/HomeContainer.mjs +3 -3
- package/apps/realworld2/view/article/DetailsContainer.mjs +1 -1
- package/apps/realworld2/view/article/PreviewComponent.mjs +7 -7
- package/apps/realworld2/view/article/TagListComponent.mjs +2 -2
- package/apps/realworld2/view/user/ProfileContainer.mjs +1 -1
- package/apps/route/view/center/CardAdministration.mjs +2 -2
- package/apps/route/view/center/CardAdministrationDenied.mjs +1 -1
- package/apps/route/view/center/CardContact.mjs +2 -2
- package/apps/route/view/center/CardHome.mjs +1 -1
- package/apps/route/view/center/CardSection1.mjs +1 -1
- package/apps/route/view/center/CardSection2.mjs +1 -1
- package/apps/sharedcovid/view/AttributionComponent.mjs +1 -1
- package/apps/sharedcovid/view/HeaderContainer.mjs +6 -6
- package/apps/sharedcovid/view/MainContainerController.mjs +5 -5
- package/apps/sharedcovid/view/TableContainerController.mjs +1 -1
- package/apps/sharedcovid/view/country/Gallery.mjs +13 -13
- package/apps/sharedcovid/view/country/Helix.mjs +13 -13
- package/apps/sharedcovid/view/country/HistoricalDataTable.mjs +1 -1
- package/apps/shareddialog/childapps/shareddialog2/view/MainContainer.mjs +1 -1
- package/apps/shareddialog/view/MainContainer.mjs +1 -1
- package/buildScripts/createApp.mjs +2 -2
- package/examples/table/cellEditing/MainContainer.mjs +1 -1
- package/examples/table/container/MainContainer.mjs +3 -3
- package/examples/table/nestedRecordFields/Viewport.mjs +6 -6
- package/examples/tableFiltering/MainContainer.mjs +1 -1
- package/examples/tablePerformance/MainContainer.mjs +1 -1
- package/examples/tablePerformance/MainContainer2.mjs +1 -1
- package/examples/tablePerformance/MainContainer3.mjs +2 -2
- package/examples/tableStore/MainContainer.mjs +2 -2
- package/learn/Glossary.md +261 -0
- package/learn/UsingTheseTopics.md +2 -2
- package/learn/benefits/ConfigSystem.md +538 -28
- package/learn/benefits/Effort.md +47 -2
- package/learn/benefits/Features.md +50 -32
- package/learn/benefits/FormsEngine.md +68 -38
- package/learn/benefits/MultiWindow.md +33 -7
- package/learn/benefits/OffTheMainThread.md +2 -2
- package/learn/benefits/Quick.md +45 -12
- package/learn/benefits/RPCLayer.md +75 -0
- package/learn/benefits/Speed.md +16 -11
- package/learn/gettingstarted/ComponentModels.md +4 -4
- package/learn/gettingstarted/Config.md +6 -6
- package/learn/gettingstarted/DescribingTheUI.md +4 -4
- package/learn/gettingstarted/Events.md +6 -6
- package/learn/gettingstarted/Extending.md +4 -4
- package/learn/gettingstarted/References.md +6 -6
- package/learn/gettingstarted/Workspaces.md +6 -6
- package/learn/guides/ApplicationBootstrap.md +26 -26
- package/learn/guides/ComponentsAndContainers.md +12 -12
- package/learn/guides/ConfigSystemDeepDive.md +280 -0
- package/learn/guides/CustomComponents.md +2 -2
- package/learn/guides/DeclarativeComponentTreesVsImperativeVdom.md +17 -17
- package/learn/guides/InstanceLifecycle.md +295 -1
- package/learn/guides/MainThreadAddons.md +475 -0
- package/learn/guides/PortalApp.md +2 -2
- package/learn/guides/StateProviders.md +12 -12
- package/learn/guides/WorkingWithVDom.md +14 -14
- package/learn/guides/events/CustomEvents.md +16 -16
- package/learn/guides/events/DomEvents.md +12 -12
- package/learn/javascript/ClassFeatures.md +3 -2
- package/learn/javascript/Classes.md +8 -8
- package/learn/javascript/NewNode.md +4 -4
- package/learn/javascript/Overrides.md +8 -8
- package/learn/javascript/Super.md +10 -8
- package/learn/tree.json +52 -51
- package/learn/tutorials/Earthquakes.md +54 -57
- package/learn/tutorials/TodoList.md +4 -4
- package/package.json +2 -2
- package/resources/scss/src/apps/portal/learn/ContentComponent.scss +12 -0
- package/resources/scss/src/table/{View.scss → Body.scss} +1 -1
- package/resources/scss/src/table/plugin/CellEditing.scss +1 -1
- package/resources/scss/theme-dark/table/{View.scss → Body.scss} +1 -1
- package/resources/scss/theme-light/table/{View.scss → Body.scss} +1 -1
- package/resources/scss/theme-neo-light/Global.scss +1 -2
- package/resources/scss/theme-neo-light/table/{View.scss → Body.scss} +1 -1
- package/src/DefaultConfig.mjs +2 -2
- package/src/Main.mjs +8 -7
- package/src/Neo.mjs +16 -2
- package/src/button/Base.mjs +2 -2
- package/src/calendar/view/SettingsContainer.mjs +2 -2
- package/src/calendar/view/YearComponent.mjs +9 -9
- package/src/calendar/view/calendars/ColorsList.mjs +1 -1
- package/src/calendar/view/calendars/List.mjs +1 -1
- package/src/calendar/view/month/Component.mjs +15 -15
- package/src/calendar/view/week/Component.mjs +12 -12
- package/src/calendar/view/week/EventDragZone.mjs +4 -4
- package/src/calendar/view/week/TimeAxisComponent.mjs +3 -3
- package/src/component/Base.mjs +17 -2
- package/src/component/Carousel.mjs +2 -2
- package/src/component/Chip.mjs +3 -3
- package/src/component/Circle.mjs +2 -2
- package/src/component/DateSelector.mjs +8 -8
- package/src/component/Helix.mjs +1 -1
- package/src/component/Label.mjs +3 -18
- package/src/component/Legend.mjs +3 -3
- package/src/component/MagicMoveText.mjs +6 -14
- package/src/component/Process.mjs +3 -3
- package/src/component/Progress.mjs +1 -1
- package/src/component/StatusBadge.mjs +2 -2
- package/src/component/Timer.mjs +2 -2
- package/src/component/Toast.mjs +5 -3
- package/src/container/AccordionItem.mjs +2 -2
- package/src/container/Base.mjs +1 -1
- package/src/core/Base.mjs +77 -14
- package/src/core/Util.mjs +14 -2
- package/src/date/DayViewComponent.mjs +2 -2
- package/src/date/SelectorContainer.mjs +1 -1
- package/src/draggable/grid/header/toolbar/SortZone.mjs +21 -21
- package/src/draggable/table/header/toolbar/SortZone.mjs +1 -1
- package/src/form/field/CheckBox.mjs +4 -4
- package/src/form/field/FileUpload.mjs +25 -39
- package/src/form/field/Range.mjs +1 -1
- package/src/form/field/Text.mjs +3 -3
- package/src/form/field/TextArea.mjs +2 -3
- package/src/grid/Body.mjs +8 -5
- package/src/grid/_export.mjs +1 -1
- package/src/list/Color.mjs +2 -2
- package/src/main/DeltaUpdates.mjs +157 -98
- package/src/main/addon/AmCharts.mjs +61 -84
- package/src/main/addon/Base.mjs +161 -42
- package/src/main/addon/GoogleMaps.mjs +9 -16
- package/src/main/addon/HighlightJS.mjs +2 -13
- package/src/main/addon/IntersectionObserver.mjs +21 -21
- package/src/main/addon/MonacoEditor.mjs +32 -64
- package/src/manager/ClassHierarchy.mjs +114 -0
- package/src/menu/List.mjs +1 -1
- package/src/plugin/Popover.mjs +2 -2
- package/src/sitemap/Component.mjs +1 -1
- package/src/table/{View.mjs → Body.mjs} +25 -22
- package/src/table/Container.mjs +43 -43
- package/src/table/_export.mjs +2 -2
- package/src/table/plugin/CellEditing.mjs +19 -19
- package/src/tooltip/Base.mjs +1 -6
- package/src/tree/Accordion.mjs +3 -3
- package/src/vdom/Helper.mjs +19 -22
- package/src/worker/App.mjs +1 -2
- package/src/worker/Base.mjs +7 -5
- package/src/worker/Canvas.mjs +2 -3
- package/src/worker/Data.mjs +5 -7
- package/src/worker/Task.mjs +2 -3
- package/src/worker/VDom.mjs +3 -4
- package/src/worker/mixin/RemoteMethodAccess.mjs +5 -2
- package/learn/guides/MainThreadAddonExample.md +0 -15
- package/learn/guides/MainThreadAddonIntro.md +0 -44
@@ -10,7 +10,7 @@ use to describe the component you're creating> You can also access or set the pr
|
|
10
10
|
|
11
11
|
## A view with one component
|
12
12
|
|
13
|
-
|
13
|
+
```javascript live-preview
|
14
14
|
import Button from '../button/Base.mjs';
|
15
15
|
import Container from '../container/Base.mjs';
|
16
16
|
|
@@ -27,7 +27,7 @@ class MainView extends Container {
|
|
27
27
|
}
|
28
28
|
|
29
29
|
MainView = Neo.setupClass(MainView);
|
30
|
-
|
30
|
+
```
|
31
31
|
|
32
32
|
|
33
33
|
The button config is just an object describing the button being created. In the example, it has three
|
@@ -46,7 +46,7 @@ Let's put a second button in the container.
|
|
46
46
|
|
47
47
|
## A view with two components
|
48
48
|
|
49
|
-
|
49
|
+
```javascript live-preview
|
50
50
|
import Button from '../button/Base.mjs';
|
51
51
|
import Container from '../container/Base.mjs';
|
52
52
|
|
@@ -67,7 +67,7 @@ class MainView extends Container {
|
|
67
67
|
}
|
68
68
|
|
69
69
|
MainView = Neo.setupClass(MainView);
|
70
|
-
|
70
|
+
```
|
71
71
|
|
72
72
|
If you run the example you'll see two buttons, arranged according to the `layout`. If you'd like,
|
73
73
|
modify the code to specify `ntype:'hbox'` and run it again.
|
@@ -13,7 +13,7 @@ pairs as you need.
|
|
13
13
|
The code below shows two text fields, with `listeners` for `change` and `focusEnter`.
|
14
14
|
(The events for any component are documented in the API docs.)
|
15
15
|
|
16
|
-
|
16
|
+
```javascript live-preview
|
17
17
|
import Container from '../container/Base.mjs';
|
18
18
|
import TextField from '../form/field/Text.mjs';
|
19
19
|
|
@@ -38,7 +38,7 @@ class MainView extends Container {
|
|
38
38
|
}
|
39
39
|
}
|
40
40
|
MainView = Neo.setupClass(MainView);
|
41
|
-
|
41
|
+
```
|
42
42
|
|
43
43
|
If you run the example, and open the browser's debugger, you'll see the console being logged as you type or give
|
44
44
|
focus to either field.
|
@@ -52,7 +52,7 @@ that with a _component controller_.
|
|
52
52
|
A `Neo.controller.Component` is a simple class associated with a component class. As a view is created, an
|
53
53
|
instance of its associated controller is automatically created.
|
54
54
|
|
55
|
-
|
55
|
+
```javascript live-preview
|
56
56
|
import Base from '../controller/Component.mjs';
|
57
57
|
|
58
58
|
class MainViewController extends Base {
|
@@ -86,7 +86,7 @@ class MainView extends Container {
|
|
86
86
|
}
|
87
87
|
}
|
88
88
|
MainView = Neo.setupClass(MainView);
|
89
|
-
|
89
|
+
```
|
90
90
|
|
91
91
|
|
92
92
|
|
@@ -116,7 +116,7 @@ automatically get lifecycle methods run before the value is assigned, after the
|
|
116
116
|
before the value is accessed. We're using the _after_ method to fire a `change` event.
|
117
117
|
|
118
118
|
|
119
|
-
|
119
|
+
```javascript live-preview
|
120
120
|
import Button from '../button/Base.mjs';
|
121
121
|
import Container from '../container/Base.mjs';
|
122
122
|
|
@@ -154,4 +154,4 @@ class MainView extends Container {
|
|
154
154
|
}
|
155
155
|
}
|
156
156
|
MainView = Neo.setupClass(MainView);
|
157
|
-
|
157
|
+
```
|
@@ -5,7 +5,7 @@ to test.
|
|
5
5
|
|
6
6
|
Consider this code. It's a panel with a header and a table. The table has a store.
|
7
7
|
|
8
|
-
|
8
|
+
```javascript live-preview
|
9
9
|
import Button from '../button/Base.mjs';
|
10
10
|
import Panel from '../container/Panel.mjs';
|
11
11
|
import Table from '../table/Container.mjs';
|
@@ -42,13 +42,13 @@ class MainView extends Panel {
|
|
42
42
|
}
|
43
43
|
|
44
44
|
MainView = Neo.setupClass(MainView);
|
45
|
-
|
45
|
+
```
|
46
46
|
|
47
47
|
If you wanted, any of the configs can be refactored into their own class. Here, the button, store, and table
|
48
48
|
have been refactored into their own classes, and the main view is using them. The main view is simpler and
|
49
49
|
more abstract, and each class can be reused, tested, and maintained independently.
|
50
50
|
|
51
|
-
|
51
|
+
```javascript live-preview
|
52
52
|
import Button from '../button/Base.mjs';
|
53
53
|
import Panel from '../container/Panel.mjs';
|
54
54
|
import Store from '../data/Store.mjs';
|
@@ -103,7 +103,7 @@ class MainView extends Panel {
|
|
103
103
|
}
|
104
104
|
}
|
105
105
|
MainView = Neo.setupClass(MainView);
|
106
|
-
|
106
|
+
```
|
107
107
|
|
108
108
|
There are several use-cases for creating your own classes:
|
109
109
|
|
@@ -10,7 +10,7 @@ There are two common ways of doing that:
|
|
10
10
|
Here's an example with one button. Clicking on the button will disable it.
|
11
11
|
As you can see, the handler uses the component reference pass in via `data.component`.
|
12
12
|
|
13
|
-
|
13
|
+
```javascript live-preview
|
14
14
|
import Button from '../button/Base.mjs';
|
15
15
|
import Container from '../container/Base.mjs';
|
16
16
|
import Controller from '../controller/Component.mjs';
|
@@ -39,7 +39,7 @@ class MainView extends Container {
|
|
39
39
|
}
|
40
40
|
}
|
41
41
|
MainView = Neo.setupClass(MainView);
|
42
|
-
|
42
|
+
```
|
43
43
|
|
44
44
|
## Using getReference()
|
45
45
|
|
@@ -47,7 +47,7 @@ But what if we need to get a reference to another component in the view? In that
|
|
47
47
|
you tag the component you need with a `reference` config, then use `getReference()` in
|
48
48
|
the controller.
|
49
49
|
|
50
|
-
|
50
|
+
```javascript live-preview
|
51
51
|
import Button from '../button/Base.mjs';
|
52
52
|
import Container from '../container/Base.mjs';
|
53
53
|
import Controller from '../controller/Component.mjs';
|
@@ -84,7 +84,7 @@ class MainView extends Container {
|
|
84
84
|
}
|
85
85
|
}
|
86
86
|
MainView = Neo.setupClass(MainView);
|
87
|
-
|
87
|
+
```
|
88
88
|
|
89
89
|
## Getting a reference when debugging
|
90
90
|
|
@@ -102,7 +102,7 @@ But app logic should never use `Neo.findFirst()` and very rarely use `up()` or `
|
|
102
102
|
The following example gets a reference to the _Learn_ button at the top of this site, and changes its `text`.
|
103
103
|
Again — that use of `Neo.findFirst()` might be handy when debugging, but it should never be used in app logic.
|
104
104
|
|
105
|
-
|
105
|
+
```javascript live-preview
|
106
106
|
import Button from '../button/Base.mjs';
|
107
107
|
import Container from '../container/Base.mjs';
|
108
108
|
|
@@ -128,4 +128,4 @@ class MainView extends Container {
|
|
128
128
|
}
|
129
129
|
}
|
130
130
|
MainView = Neo.setupClass(MainView);
|
131
|
-
|
131
|
+
```
|
@@ -40,7 +40,7 @@ as well as create new views classes, their controllers, and other application lo
|
|
40
40
|
|
41
41
|
Now let's look at a source file. This is the contents of `MainView.mjs`.
|
42
42
|
|
43
|
-
|
43
|
+
```javascript readonly
|
44
44
|
import Container from '../../../node_modules/neo.mjs/src/container/Base.mjs';
|
45
45
|
import Controller from './MainViewController.mjs';
|
46
46
|
import ViewModel from './MainViewModel.mjs';
|
@@ -58,7 +58,7 @@ class MainView extends Container {
|
|
58
58
|
Neo.setupClass(MainView);
|
59
59
|
|
60
60
|
export default MainView;
|
61
|
-
|
61
|
+
```
|
62
62
|
|
63
63
|
Neo.mjs views are composed of components. A component can be a "container", which means it
|
64
64
|
visually holds or groups other components, or a regular component, like a button. The main
|
@@ -78,7 +78,7 @@ you see how a component is configured let's put a button in the container.
|
|
78
78
|
First, we need to import the class that defines buttons. Then we'll describe the new button in the
|
79
79
|
`items:[].`
|
80
80
|
|
81
|
-
|
81
|
+
```javascript readonly
|
82
82
|
import Button from '../../../node_modules/neo.mjs/src/button/Base.mjs';
|
83
83
|
import Container from '../../../node_modules/neo.mjs/src/container/Base.mjs';
|
84
84
|
import Controller from './MainViewController.mjs';
|
@@ -100,7 +100,7 @@ class MainView extends Container {
|
|
100
100
|
Neo.setupClass(MainView);
|
101
101
|
|
102
102
|
export default MainView;
|
103
|
-
|
103
|
+
```
|
104
104
|
|
105
105
|
|
106
106
|
Note the entry in `items:[]`. That's a description of the button that will be the single item in our
|
@@ -120,7 +120,7 @@ Here's a simplified running example. The `model` and `controller` are omitted, b
|
|
120
120
|
actually used in the example, and the import root path is different to reflect the location of the
|
121
121
|
Neo.mjs library relative to the examples.
|
122
122
|
|
123
|
-
|
123
|
+
```javascript live-preview
|
124
124
|
import Button from '../button/Base.mjs';
|
125
125
|
import Container from '../container/Base.mjs';
|
126
126
|
|
@@ -136,5 +136,5 @@ class MainView extends Container {
|
|
136
136
|
}
|
137
137
|
|
138
138
|
MainView = Neo.setupClass(MainView);
|
139
|
-
|
139
|
+
```
|
140
140
|
|
@@ -14,20 +14,20 @@ using Web Workers.
|
|
14
14
|
|
15
15
|
## Bootstrap Sequence
|
16
16
|
|
17
|
-
```
|
17
|
+
```text
|
18
18
|
myapp/
|
19
19
|
├── view/
|
20
20
|
│ └── Viewport.mjs // The app main view
|
21
|
-
├── app.mjs
|
22
|
-
├── index.html
|
23
|
-
└── neo-config.json
|
21
|
+
├── app.mjs // The entry-point for your code inside the app worker
|
22
|
+
├── index.html // The entry-point for a main-thread
|
23
|
+
└── neo-config.json // Framework global configs for your app
|
24
24
|
```
|
25
25
|
|
26
26
|
### 1. Entry Point: index.html
|
27
27
|
|
28
28
|
The bootstrap process begins with a minimal HTML file:
|
29
29
|
|
30
|
-
```html
|
30
|
+
```html readonly
|
31
31
|
<!DOCTYPE HTML>
|
32
32
|
<html>
|
33
33
|
<head>
|
@@ -51,7 +51,7 @@ The only JavaScript file imported is the `MicroLoader.mjs`, which is loaded as a
|
|
51
51
|
|
52
52
|
The `MicroLoader.mjs` is a small script that fetches the application configuration and bootstraps the main thread:
|
53
53
|
|
54
|
-
```javascript
|
54
|
+
```javascript readonly
|
55
55
|
fetch('./neo-config.json').then(r => r.json()).then(d => {
|
56
56
|
globalThis.Neo = {config: {...d}};
|
57
57
|
import(d.mainPath)
|
@@ -69,7 +69,7 @@ It performs these steps:
|
|
69
69
|
The `neo-config.json` file contains essential configuration for the application bootstrap. For a complete overview
|
70
70
|
of all available configuration options, you can refer to the `src/DefaultConfig.mjs` file in the Neo.mjs framework:
|
71
71
|
|
72
|
-
```json
|
72
|
+
```json readonly
|
73
73
|
{
|
74
74
|
"appPath" : "apps/myapp/app.mjs",
|
75
75
|
"basePath" : "../../",
|
@@ -88,23 +88,23 @@ of all available configuration options, you can refer to the `src/DefaultConfig.
|
|
88
88
|
```
|
89
89
|
|
90
90
|
**Key Configuration Properties:**
|
91
|
-
-
|
92
|
-
-
|
93
|
-
-
|
94
|
-
-
|
95
|
-
-
|
96
|
-
-
|
97
|
-
-
|
98
|
-
-
|
99
|
-
-
|
100
|
-
-
|
91
|
+
- `appPath` - Points to your application's entry point (app.mjs)
|
92
|
+
- `basePath` - Root path for resolving other paths
|
93
|
+
- `environment` - Controls optimization and debugging features
|
94
|
+
- `mainPath` - Framework's main thread bootstrap file
|
95
|
+
- `mainThreadAddons` - Additional features to load in the main thread
|
96
|
+
- `themes` - CSS themes to load
|
97
|
+
- `useCanvasWorker` - Controls whether to use a separate worker for canvas operations
|
98
|
+
- `useDataWorker` - Controls whether to use a separate worker for data operations
|
99
|
+
- `useServiceWorker` - Controls whether to use a service worker for caching
|
100
|
+
- `useSharedWorkers` - When set to true, ALL workers (App, VDom, Data, etc.) will be created as SharedWorkers,
|
101
101
|
enabling multi-window applications. When false, all workers will be dedicated workers (better for single-page applications).
|
102
|
-
The
|
102
|
+
The worker.Base class provides an abstraction layer that supports both types with a consistent API, allowing developers
|
103
103
|
to create an app with dedicated workers first (which are easier to debug) and then switch to shared workers with just
|
104
104
|
a one-line configuration change.
|
105
|
-
-
|
106
|
-
-
|
107
|
-
-
|
105
|
+
- `useTaskWorker` - Controls whether to use a separate worker for background tasks
|
106
|
+
- `useVdomWorker` - Controls whether to use a separate worker for virtual DOM operations
|
107
|
+
- `workerBasePath` - Location of worker initialization files
|
108
108
|
|
109
109
|
**Configuration Categories:**
|
110
110
|
- **Path Resolution** - Where to find files and modules (auto-generated by default)
|
@@ -116,7 +116,7 @@ of all available configuration options, you can refer to the `src/DefaultConfig.
|
|
116
116
|
|
117
117
|
The MicroLoader imports `Main.mjs`, which initializes the main thread:
|
118
118
|
|
119
|
-
```javascript
|
119
|
+
```javascript readonly
|
120
120
|
import Neo from './Neo.mjs';
|
121
121
|
import * as core from './core/_export.mjs';
|
122
122
|
import DomAccess from './main/DomAccess.mjs';
|
@@ -160,7 +160,7 @@ The Main class:
|
|
160
160
|
|
161
161
|
### 5. Neo.worker.Manager: Creating Workers
|
162
162
|
|
163
|
-
```javascript
|
163
|
+
```javascript readonly
|
164
164
|
class Manager extends core.Base {
|
165
165
|
// ...
|
166
166
|
|
@@ -230,7 +230,7 @@ The App worker receives the 'loadApplication' message and loads the application.
|
|
230
230
|
in Neo.mjs is an instance of Neo.controller.Application, which is not common in other frameworks like React, Angular,
|
231
231
|
or Vue (which typically just use a tag):
|
232
232
|
|
233
|
-
```javascript
|
233
|
+
```javascript readonly
|
234
234
|
class App extends Base {
|
235
235
|
// ...
|
236
236
|
|
@@ -282,7 +282,7 @@ The App worker:
|
|
282
282
|
|
283
283
|
Finally, the application's `app.mjs` file is loaded and executed:
|
284
284
|
|
285
|
-
```javascript
|
285
|
+
```javascript readonly
|
286
286
|
import Overwrites from './Overwrites.mjs'; // Optional class config default value changes for framework classes
|
287
287
|
import Viewport from './view/Viewport.mjs'; // Your main UI component
|
288
288
|
|
@@ -301,7 +301,7 @@ The app.mjs file:
|
|
301
301
|
|
302
302
|
When Neo.app() is called, it creates an Application controller and instantiates your mainView component:
|
303
303
|
|
304
|
-
```javascript
|
304
|
+
```javascript readonly
|
305
305
|
// Your Viewport component
|
306
306
|
class Viewport extends Container {
|
307
307
|
static config = {
|
@@ -25,7 +25,7 @@ primitive. Components introduce various properties, such as `width`, `height`, `
|
|
25
25
|
|
26
26
|
Here's a container, with one child item.
|
27
27
|
|
28
|
-
|
28
|
+
```javascript live-preview
|
29
29
|
import Container from '../container/Base.mjs';
|
30
30
|
|
31
31
|
class MainView extends Container {
|
@@ -42,12 +42,12 @@ class MainView extends Container {
|
|
42
42
|
}
|
43
43
|
|
44
44
|
MainView = Neo.setupClass(MainView);
|
45
|
-
|
45
|
+
```
|
46
46
|
|
47
47
|
Components also have an `html`. The `html` property is rarely used, and goes against the abstract philosophy of Neo.mjs, but
|
48
48
|
sometimes it's handy as a placeholder as you stub out views.
|
49
49
|
|
50
|
-
|
50
|
+
```javascript live-preview
|
51
51
|
import Container from '../container/Base.mjs';
|
52
52
|
|
53
53
|
class MainView extends Container {
|
@@ -65,7 +65,7 @@ class MainView extends Container {
|
|
65
65
|
}
|
66
66
|
|
67
67
|
MainView = Neo.setupClass(MainView);
|
68
|
-
|
68
|
+
```
|
69
69
|
|
70
70
|
|
71
71
|
## Layout
|
@@ -77,7 +77,7 @@ some commonly-used layouts.
|
|
77
77
|
|
78
78
|
Fix is used when there's a single child. The component is sized to fit the container.
|
79
79
|
|
80
|
-
|
80
|
+
```javascript live-preview
|
81
81
|
import Container from '../container/Base.mjs';
|
82
82
|
|
83
83
|
class MainView extends Container {
|
@@ -92,13 +92,13 @@ class MainView extends Container {
|
|
92
92
|
}
|
93
93
|
|
94
94
|
MainView = Neo.setupClass(MainView);
|
95
|
-
|
95
|
+
```
|
96
96
|
|
97
97
|
### Vbox and hbox
|
98
98
|
|
99
99
|
With `vbox` and `hbox`, items are arranged vertically or horizontally.
|
100
100
|
|
101
|
-
|
101
|
+
```javascript live-preview
|
102
102
|
import Button from '../button/Base.mjs';
|
103
103
|
import Container from '../container/Base.mjs';
|
104
104
|
|
@@ -119,13 +119,13 @@ class MainView extends Container {
|
|
119
119
|
}
|
120
120
|
|
121
121
|
MainView = Neo.setupClass(MainView);
|
122
|
-
|
122
|
+
```
|
123
123
|
|
124
124
|
### Card
|
125
125
|
|
126
126
|
A card container has multiple child items, one of which is visible.
|
127
127
|
|
128
|
-
|
128
|
+
```javascript live-preview
|
129
129
|
import Button from '../button/Base.mjs';
|
130
130
|
import Container from '../container/Base.mjs';
|
131
131
|
|
@@ -167,7 +167,7 @@ class MainView extends Container {
|
|
167
167
|
}
|
168
168
|
|
169
169
|
MainView = Neo.setupClass(MainView);
|
170
|
-
|
170
|
+
```
|
171
171
|
|
172
172
|
|
173
173
|
|
@@ -177,7 +177,7 @@ MainView = Neo.setupClass(MainView);
|
|
177
177
|
Neo.mjs is class-based, and thus, any component or container can be defined as its own class, and reused like any
|
178
178
|
other component in the framework.
|
179
179
|
|
180
|
-
|
180
|
+
```javascript live-preview
|
181
181
|
import Button from '../button/Base.mjs';
|
182
182
|
// In practice this would be some handy reusable component
|
183
183
|
class MySpecialButton extends Button {
|
@@ -209,5 +209,5 @@ class MainView extends Container {
|
|
209
209
|
}
|
210
210
|
|
211
211
|
MainView = Neo.setupClass(MainView);
|
212
|
-
|
212
|
+
```
|
213
213
|
|