neo.mjs 6.9.10 → 6.9.12
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/learnneo/index.html +4 -3
- package/apps/learnneo/neo-config.json +2 -1
- package/apps/learnneo/store/Content.mjs +1 -1
- package/apps/learnneo/view/Viewport.mjs +18 -0
- package/apps/learnneo/view/ViewportController.mjs +2 -2
- package/apps/learnneo/view/home/ContentTreeList.mjs +22 -14
- package/apps/learnneo/view/home/ContentView.mjs +60 -0
- package/apps/learnneo/view/home/MainContainer.mjs +14 -6
- package/apps/learnneo/view/home/MainContainerController.mjs +57 -18
- package/apps/learnneo/view/home/MainContainerModel.mjs +3 -5
- package/apps/newwebsite/app.mjs +6 -0
- package/apps/newwebsite/index.html +13 -0
- package/apps/newwebsite/neo-config.json +7 -0
- package/apps/newwebsite/view/MainContainer.mjs +59 -0
- package/buildScripts/convertDesignTokens.mjs +173 -0
- package/buildScripts/webpack/json/myApps.template.json +1 -0
- package/examples/ConfigurationViewport.mjs +12 -9
- package/examples/ServiceWorker.mjs +2 -2
- package/package.json +3 -2
- package/resources/data/{learnneo → deck/learnneo}/p/2023-10-01T18-29-19-158Z.md +3 -6
- package/resources/data/deck/learnneo/p/2023-10-08T20-20-37-336Z.md +36 -0
- package/resources/data/deck/learnneo/p/stylesheet.md +58 -0
- package/resources/data/{learnneo → deck/learnneo}/t.json +19 -2
- package/resources/data/deck/training/p/2022-12-27T21-54-52-300Z.md +11 -0
- package/resources/data/deck/training/p/2022-12-27T21-55-23-144Z.md +43 -0
- package/resources/data/deck/training/p/2022-12-27T21-55-30-948Z.md +1 -0
- package/resources/data/deck/training/p/2022-12-27T21-55-43-542Z.md +84 -0
- package/resources/data/deck/training/p/2022-12-27T22-23-55-083Z.md +1 -0
- package/resources/data/deck/training/p/2022-12-27T22-24-07-886Z.md +8 -0
- package/resources/data/deck/training/p/2022-12-27T22-24-52-295Z.md +8 -0
- package/resources/data/deck/training/p/2022-12-27T22-25-03-853Z.md +5 -0
- package/resources/data/deck/training/p/2022-12-27T22-43-58-924Z.md +10 -0
- package/resources/data/deck/training/p/2022-12-27T22-44-28-881Z.md +3 -0
- package/resources/data/deck/training/p/2022-12-27T22-44-41-791Z.md +4 -0
- package/resources/data/deck/training/p/2022-12-27T22-45-21-032Z.md +7 -0
- package/resources/data/deck/training/p/2022-12-27T22-49-22-078Z.md +4 -0
- package/resources/data/deck/training/p/2022-12-27T22-50-20-626Z.md +4 -0
- package/resources/data/deck/training/p/2022-12-28T16-58-47-786Z.md +0 -0
- package/resources/data/deck/training/p/2022-12-28T16-58-55-192Z.md +9 -0
- package/resources/data/deck/training/p/2022-12-28T17-10-18-058Z.md +15 -0
- package/resources/data/deck/training/p/2022-12-28T17-10-42-296Z.md +40 -0
- package/resources/data/deck/training/p/2022-12-28T17-11-34-653Z.md +41 -0
- package/resources/data/deck/training/p/2022-12-28T17-13-09-994Z.md +0 -0
- package/resources/data/deck/training/p/2022-12-28T21-32-14-420Z.md +0 -0
- package/resources/data/deck/training/p/2022-12-29T01-43-32-431Z.md +7 -0
- package/resources/data/deck/training/p/2022-12-29T15-56-54-485Z.md +7 -0
- package/resources/data/deck/training/p/2022-12-29T15-57-11-499Z.md +7 -0
- package/resources/data/deck/training/p/2022-12-29T16-00-13-223Z.md +7 -0
- package/resources/data/deck/training/p/2022-12-29T18-34-25-826Z.md +4 -0
- package/resources/data/deck/training/p/2022-12-29T18-36-08-226Z.md +106 -0
- package/resources/data/deck/training/p/2022-12-29T18-36-56-893Z.md +112 -0
- package/resources/data/deck/training/p/2022-12-29T19-31-30-507Z.md +31 -0
- package/resources/data/deck/training/p/2022-12-29T19-31-55-091Z.md +14 -0
- package/resources/data/deck/training/p/2022-12-29T20-03-42-628Z.md +9 -0
- package/resources/data/deck/training/p/2022-12-29T20-21-20-669Z.md +7 -0
- package/resources/data/deck/training/p/2022-12-29T20-37-08-919Z.md +46 -0
- package/resources/data/deck/training/p/2022-12-29T20-37-20-344Z.md +43 -0
- package/resources/data/deck/training/p/2022-12-30T19-04-30-990Z.md +8 -0
- package/resources/data/deck/training/p/2022-12-31T18-43-56-338Z.md +7 -0
- package/resources/data/deck/training/p/2022-12-31T18-51-50-682Z.md +1 -0
- package/resources/data/deck/training/p/2022-12-31T18-54-04-176Z.md +4 -0
- package/resources/data/deck/training/p/2022-12-31T22-11-55-555Z.md +112 -0
- package/resources/data/deck/training/p/2022-12-31T23-00-41-222Z.md +6 -0
- package/resources/data/deck/training/p/2022-12-31T23-18-55-655Z.md +69 -0
- package/resources/data/deck/training/p/2022-12-31T23-25-40-735Z.md +21 -0
- package/resources/data/deck/training/p/2022-12-31T23-25-51-014Z.md +7 -0
- package/resources/data/deck/training/p/2023-01-01T17-49-18-429Z.md +3 -0
- package/resources/data/deck/training/p/2023-01-01T18-44-07-034Z.md +34 -0
- package/resources/data/deck/training/p/2023-01-01T18-47-39-766Z.md +15 -0
- package/resources/data/deck/training/p/2023-01-01T19-04-22-830Z.md +4 -0
- package/resources/data/deck/training/p/2023-01-01T21-11-58-025Z.md +25 -0
- package/resources/data/deck/training/p/2023-01-01T21-12-37-340Z.md +23 -0
- package/resources/data/deck/training/p/2023-01-01T21-13-13-880Z.md +8 -0
- package/resources/data/deck/training/p/2023-01-01T21-14-45-740Z.md +98 -0
- package/resources/data/deck/training/p/2023-01-01T21-18-23-886Z.md +26 -0
- package/resources/data/deck/training/p/2023-01-01T21-18-31-316Z.md +19 -0
- package/resources/data/deck/training/p/2023-01-01T21-18-42-290Z.md +23 -0
- package/resources/data/deck/training/p/2023-01-01T21-19-57-020Z.md +24 -0
- package/resources/data/deck/training/p/2023-01-01T21-22-31-184Z.md +13 -0
- package/resources/data/deck/training/p/2023-01-01T21-22-38-317Z.md +17 -0
- package/resources/data/deck/training/p/2023-01-01T21-22-47-693Z.md +20 -0
- package/resources/data/deck/training/p/2023-01-01T21-23-17-716Z.md +39 -0
- package/resources/data/deck/training/p/2023-01-01T21-23-28-532Z.md +22 -0
- package/resources/data/deck/training/p/2023-01-01T21-25-23-899Z.md +3 -0
- package/resources/data/deck/training/p/2023-01-01T21-25-59-742Z.md +1 -0
- package/resources/data/deck/training/p/2023-01-01T21-26-53-748Z.md +12 -0
- package/resources/data/deck/training/p/2023-01-01T23-38-42-863Z.md +2 -0
- package/resources/data/deck/training/p/2023-01-03T02-07-19-014Z.md +143 -0
- package/resources/data/deck/training/p/2023-01-04T01-52-23-454Z.md +76 -0
- package/resources/data/deck/training/p/2023-01-06T23-21-12-009Z.md +127 -0
- package/resources/data/deck/training/p/2023-01-06T23-21-31-685Z.md +81 -0
- package/resources/data/deck/training/p/2023-01-06T23-21-59-596Z.md +36 -0
- package/resources/data/deck/training/p/2023-01-06T23-34-13-897Z.md +87 -0
- package/resources/data/deck/training/p/2023-01-06T23-44-02-340Z.md +0 -0
- package/resources/data/deck/training/p/2023-01-06T23-46-36-687Z.md +1 -0
- package/resources/data/deck/training/p/2023-01-06T23-46-45-783Z.md +33 -0
- package/resources/data/deck/training/p/2023-01-08T00-45-11-144Z.md +50 -0
- package/resources/data/deck/training/p/2023-01-08T01-06-31-267Z.md +41 -0
- package/resources/data/deck/training/p/2023-01-08T01-24-21-088Z.md +95 -0
- package/resources/data/deck/training/p/2023-01-08T01-25-12-557Z.md +11 -0
- package/resources/data/deck/training/p/2023-01-08T01-46-50-723Z.md +25 -0
- package/resources/data/deck/training/p/2023-01-08T02-09-07-802Z.md +18 -0
- package/resources/data/deck/training/p/2023-01-08T02-09-19-678Z.md +66 -0
- package/resources/data/deck/training/p/2023-01-08T02-11-26-333Z.md +29 -0
- package/resources/data/deck/training/p/2023-01-08T17-22-48-841Z.md +14 -0
- package/resources/data/deck/training/p/2023-01-08T20-46-11-806Z.md +5 -0
- package/resources/data/deck/training/p/2023-01-08T20-47-23-682Z.md +5 -0
- package/resources/data/deck/training/p/2023-01-08T20-47-32-064Z.md +13 -0
- package/resources/data/deck/training/p/2023-01-08T20-47-57-045Z.md +0 -0
- package/resources/data/deck/training/p/2023-01-08T20-48-03-791Z.md +18 -0
- package/resources/data/deck/training/p/2023-01-08T20-48-32-466Z.md +9 -0
- package/resources/data/deck/training/p/2023-01-08T20-48-51-322Z.md +20 -0
- package/resources/data/deck/training/p/2023-01-08T20-49-52-741Z.md +0 -0
- package/resources/data/deck/training/p/2023-01-08T20-52-03-556Z.md +0 -0
- package/resources/data/deck/training/p/2023-01-08T20-57-36-333Z.md +2 -0
- package/resources/data/deck/training/p/2023-01-08T20-57-51-136Z.md +5 -0
- package/resources/data/deck/training/p/2023-01-09T00-07-37-951Z.md +0 -0
- package/resources/data/deck/training/p/2023-01-09T00-35-40-671Z.md +3 -0
- package/resources/data/deck/training/p/2023-01-10T01-29-38-148Z.md +10 -0
- package/resources/data/deck/training/p/2023-01-10T01-43-12-166Z.md +31 -0
- package/resources/data/deck/training/p/2023-01-10T02-21-54-303Z.md +10 -0
- package/resources/data/deck/training/p/2023-01-12T01-50-54-617Z.md +74 -0
- package/resources/data/deck/training/p/2023-01-13T19-55-24-735Z.md +14 -0
- package/resources/data/deck/training/p/2023-01-13T20-08-27-068Z.md +28 -0
- package/resources/data/deck/training/p/2023-01-13T20-23-38-411Z.md +25 -0
- package/resources/data/deck/training/p/2023-01-13T20-37-06-267Z.md +13 -0
- package/resources/data/deck/training/p/2023-01-13T21-05-57-708Z.md +8 -0
- package/resources/data/deck/training/p/2023-01-13T21-48-17-258Z.md +20 -0
- package/resources/data/deck/training/p/2023-01-13T22-05-05-799Z.md +14 -0
- package/resources/data/deck/training/p/2023-01-13T22-08-30-863Z.md +17 -0
- package/resources/data/deck/training/p/2023-01-13T23-01-50-449Z.md +4 -0
- package/resources/data/deck/training/p/2023-01-14T00-33-05-958Z.md +62 -0
- package/resources/data/deck/training/p/2023-01-14T00-40-27-784Z.md +229 -0
- package/resources/data/deck/training/p/2023-01-14T00-41-59-081Z.md +153 -0
- package/resources/data/deck/training/p/2023-01-14T13-50-28-199Z.md +19 -0
- package/resources/data/deck/training/p/2023-01-14T13-59-20-275Z.md +6 -0
- package/resources/data/deck/training/p/2023-01-14T14-03-29-456Z.md +3 -0
- package/resources/data/deck/training/p/2023-01-14T14-27-57-678Z.md +7 -0
- package/resources/data/deck/training/p/2023-01-14T17-30-18-228Z.md +33 -0
- package/resources/data/deck/training/p/2023-01-14T18-28-39-316Z.md +1 -0
- package/resources/data/deck/training/p/2023-01-14T18-28-44-115Z.md +4 -0
- package/resources/data/deck/training/p/2023-01-14T18-28-49-548Z.md +18 -0
- package/resources/data/deck/training/p/2023-01-14T18-40-13-758Z.md +10 -0
- package/resources/data/deck/training/p/2023-01-14T19-29-15-291Z.md +12 -0
- package/resources/data/deck/training/p/2023-01-15T18-51-52-134Z.md +83 -0
- package/resources/data/deck/training/p/2023-01-15T20-03-30-073Z.md +11 -0
- package/resources/data/deck/training/p/2023-01-15T22-07-52-073Z.md +16 -0
- package/resources/data/deck/training/p/2023-01-15T22-22-13-517Z.md +12 -0
- package/resources/data/deck/training/p/2023-01-15T22-28-57-508Z.md +131 -0
- package/resources/data/deck/training/p/2023-01-15T22-36-30-913Z.md +115 -0
- package/resources/data/deck/training/p/2023-01-16T16-03-40-770Z.md +12 -0
- package/resources/data/deck/training/p/2023-01-16T20-21-56-859Z.md +5 -0
- package/resources/data/deck/training/p/2023-01-16T20-24-09-690Z.md +24 -0
- package/resources/data/deck/training/p/2023-01-20T12-51-22-646Z.md +21 -0
- package/resources/data/deck/training/p/2023-01-20T13-06-46-614Z.md +9 -0
- package/resources/data/deck/training/p/2023-01-20T13-08-51-600Z.md +7 -0
- package/resources/data/deck/training/p/2023-01-20T15-20-13-363Z.md +26 -0
- package/resources/data/deck/training/p/2023-01-20T15-34-58-813Z.md +75 -0
- package/resources/data/deck/training/p/2023-01-21T16-33-20-458Z.md +33 -0
- package/resources/data/deck/training/p/2023-01-21T16-45-28-263Z.md +28 -0
- package/resources/data/deck/training/p/2023-01-21T16-56-25-452Z.md +3 -0
- package/resources/data/deck/training/p/2023-01-21T17-28-31-493Z.md +6 -0
- package/resources/data/deck/training/p/2023-01-21T19-49-51-918Z.md +13 -0
- package/resources/data/deck/training/p/2023-01-21T20-08-24-452Z.md +15 -0
- package/resources/data/deck/training/p/2023-01-21T20-35-54-947Z.md +20 -0
- package/resources/data/deck/training/p/2023-01-21T20-54-47-603Z.md +39 -0
- package/resources/data/deck/training/p/2023-01-21T20-56-28-184Z.md +25 -0
- package/resources/data/deck/training/p/2023-01-21T20-57-32-927Z.md +4 -0
- package/resources/data/deck/training/p/2023-01-21T23-13-33-394Z.md +6 -0
- package/resources/data/deck/training/p/2023-01-28T19-11-37-464Z.md +24 -0
- package/resources/data/deck/training/p/2023-01-28T20-43-41-188Z.md +9 -0
- package/resources/data/deck/training/p/2023-01-28T20-53-56-476Z.md +8 -0
- package/resources/data/deck/training/p/2023-01-28T20-58-43-776Z.md +10 -0
- package/resources/data/deck/training/p/2023-01-28T22-18-41-259Z.md +33 -0
- package/resources/data/deck/training/p/2023-01-28T22-24-34-808Z.md +24 -0
- package/resources/data/deck/training/p/2023-01-29T16-25-24-528Z.md +44 -0
- package/resources/data/deck/training/p/2023-01-29T21-14-32-588Z.md +12 -0
- package/resources/data/deck/training/p/2023-01-31T19-24-53-504Z.md +8 -0
- package/resources/data/deck/training/p/2023-01-31T20-33-55-855Z.md +11 -0
- package/resources/data/deck/training/p/2023-01-31T20-34-30-261Z.md +7 -0
- package/resources/data/deck/training/p/2023-01-31T20-52-53-367Z.md +43 -0
- package/resources/data/deck/training/p/2023-02-04T15-18-35-682Z.md +20 -0
- package/resources/data/deck/training/p/2023-02-04T15-49-47-597Z.md +14 -0
- package/resources/data/deck/training/p/2023-02-04T18-58-57-808Z.md +1 -0
- package/resources/data/deck/training/p/2023-02-04T20-07-11-288Z.md +1 -0
- package/resources/data/deck/training/p/2023-02-04T20-09-50-169Z.md +1 -0
- package/resources/data/deck/training/p/2023-02-04T20-19-42-740Z.md +8 -0
- package/resources/data/deck/training/p/2023-02-04T20-23-56-013Z.md +12 -0
- package/resources/data/deck/training/p/2023-02-04T20-28-12-391Z.md +20 -0
- package/resources/data/deck/training/p/2023-02-05T00-20-32-554Z.md +16 -0
- package/resources/data/deck/training/p/2023-02-05T00-35-56-282Z.md +13 -0
- package/resources/data/deck/training/p/2023-02-05T15-36-57-182Z.md +24 -0
- package/resources/data/deck/training/p/2023-02-05T17-39-51-712Z.md +70 -0
- package/resources/data/deck/training/p/2023-02-05T17-44-53-815Z.md +195 -0
- package/resources/data/deck/training/p/2023-02-05T17-45-40-114Z.md +92 -0
- package/resources/data/deck/training/p/2023-02-05T18-12-14-489Z.md +60 -0
- package/resources/data/deck/training/p/2023-02-06T00-14-54-457Z.md +9 -0
- package/resources/data/deck/training/p/2023-06-28T18-03-14-313Z.md +8 -0
- package/resources/data/deck/training/p/2023-06-28T18-26-17-290Z.md +7 -0
- package/resources/data/deck/training/p/2023-06-28T21-16-24-034Z.md +40 -0
- package/resources/data/deck/training/p/2023-06-28T21-16-34-972Z.md +16 -0
- package/resources/data/deck/training/p/2023-06-28T21-28-28-379Z.md +4 -0
- package/resources/data/deck/training/p/2023-06-29T23-15-10-411Z.md +5 -0
- package/resources/data/deck/training/p/2023-07-01T15-42-45-193Z.md +433 -0
- package/resources/data/deck/training/p/2023-07-01T21-54-31-329Z.md +6 -0
- package/resources/data/deck/training/p/2023-07-02T16-14-06-970Z.md +14 -0
- package/resources/data/deck/training/p/2023-07-31T00-26-03-842Z.md +4 -0
- package/resources/data/deck/training/p/2023-07-31T00-31-51-933Z.md +10 -0
- package/resources/data/deck/training/p/2023-07-31T00-37-21-927Z.md +205 -0
- package/resources/data/deck/training/p/2023-10-01T18-29-19-158Z.md +76 -0
- package/resources/data/deck/training/p/2023-10-07T19-18-28-517Z.md +102 -0
- package/resources/data/deck/training/p/2023-10-08T20-20-07-934Z.md +75 -0
- package/resources/data/deck/training/p/2023-10-08T20-37-30-658Z.md +0 -0
- package/resources/data/deck/training/p/2023-10-08T21-58-25-809Z.md +68 -0
- package/resources/data/deck/training/p/2023-10-08T22-22-11-013Z.md +0 -0
- package/resources/data/deck/training/p/2023-10-14T19-25-08-153Z.md +119 -0
- package/resources/data/deck/training/t.json +1276 -0
- package/resources/design-tokens/json/component.json +288 -0
- package/resources/design-tokens/json/core.json +352 -0
- package/resources/design-tokens/json/semantic.json +231 -0
- package/resources/scss/src/apps/learnneo/Viewport.scss +3 -0
- package/resources/scss/src/apps/learnneo/home/ContentTreeList.scss +60 -13
- package/resources/scss/src/apps/learnneo/home/ContentView.scss +58 -0
- package/resources/scss/src/apps/newwebsite/MainContainer.scss +32 -0
- package/resources/scss/src/list/Base.scss +1 -1
- package/resources/scss/theme-neo-light/Global.scss +65 -1
- package/resources/scss/theme-neo-light/design-tokens/Component.scss +64 -0
- package/resources/scss/theme-neo-light/design-tokens/Core.scss +67 -0
- package/resources/scss/theme-neo-light/design-tokens/Semantic.scss +61 -0
- package/resources/scss/theme-neo-light/design-tokens/_all.scss +4 -0
- package/resources/scss/theme-neo-light/list/Base.scss +29 -6
- package/src/DefaultConfig.mjs +4 -4
- package/src/controller/Base.mjs +31 -23
- package/src/data/connection/Xhr.mjs +1 -1
- /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-07T19-18-28-517Z.md +0 -0
- /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-08T20-20-07-934Z.md +0 -0
- /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-08T20-37-30-658Z.md +0 -0
- /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-08T21-58-25-809Z.md +0 -0
- /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-08T22-22-11-013Z.md +0 -0
- /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-14T19-25-08-153Z.md +0 -0
- /package/resources/data/{learnneo → deck/learnneo}/pages/whyneo.md +0 -0
- /package/resources/data/{learnneo → deck/learnneo}/tree.json +0 -0
- /package/resources/data/{learnneo → deck/training}/p/2023-10-08T20-20-37-336Z.md +0 -0
- /package/resources/{deck → data/deck}/whyneo.md +0 -0
@@ -0,0 +1,76 @@
|
|
1
|
+
Neo.mjs is a framework used to create browser-based applications.
|
2
|
+
|
3
|
+
Some key features and benefits of Neo.mjs are:
|
4
|
+
|
5
|
+
<div type="expander" caption="Multi-Threaded">
|
6
|
+
<p>
|
7
|
+
When a Neo.mjs application starts, the framework spawns three web-workers.
|
8
|
+
Web-workers are each run in their own thread. As a result, a typical Neo.mjs application
|
9
|
+
has four threads:
|
10
|
+
<ol>
|
11
|
+
<li>The _main_ thread, where DOM updates are applied
|
12
|
+
<li>An _application_ web-worker where normal application locic is run
|
13
|
+
<li>A _data_ web-worker were HTTP and socket calls are run
|
14
|
+
<li>A _view_ web-worker that manages delta updates
|
15
|
+
</ol>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div type="expander" caption="Extreme Speed">
|
19
|
+
<p>
|
20
|
+
The Neo.mjs web-worker proccesses are automatically run in parallel, on separate CPU cores.
|
21
|
+
</p>
|
22
|
+
<p>
|
23
|
+
By contrast, other JavaScript frameworks run in a single thread. That means
|
24
|
+
in a typical framework all business logic, data handling, and DOM rendering compete for
|
25
|
+
CPU reasources.
|
26
|
+
</p>
|
27
|
+
<p>
|
28
|
+
This means Neo.mjs applications run and render faster. This is
|
29
|
+
particularly beneficial for processor- and data-intensive applications,
|
30
|
+
and applications that need to rapidly update what's viewed. In testing, Neo.mjs applications
|
31
|
+
easily apply over 20,000 DOM updates per second.
|
32
|
+
</p>
|
33
|
+
<p>
|
34
|
+
If the default four threads aren't enough, you're free to launch additional web-worker threads
|
35
|
+
to run other specialized logic.
|
36
|
+
</p>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div type="expander" caption="Quick Application Development">
|
40
|
+
<p>
|
41
|
+
Neo.js classes let you specify properties in a way that allows code to detect "before" and "after"
|
42
|
+
changes. This makes it easy to handle value validation and transformation, and react to changes.
|
43
|
+
</p>
|
44
|
+
<p>
|
45
|
+
Neo.mjs also has elegant yet powerful state management features that make it easy to create shared,
|
46
|
+
bindable data. For example, if two components are bound to the same propery, a change to the
|
47
|
+
property will automatically be applied to both components.
|
48
|
+
</p>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<div type="expander" caption="Multi-Window Applications">
|
52
|
+
<p>
|
53
|
+
Neo.mjs applications can also launch as _shared web workers_, which allows you to have a single
|
54
|
+
application run in multiple browser windows; those windows could be moved to multiple monitors.
|
55
|
+
</p>
|
56
|
+
<p>
|
57
|
+
For example, you can have a data analysis application with a control panel on one monitor,
|
58
|
+
tabular data in another, and charts on another — all sharing the same data, handling events
|
59
|
+
across windows, running seamlessly as a single application.
|
60
|
+
</p>
|
61
|
+
</div>
|
62
|
+
|
63
|
+
<div type="expander" caption="Open-Source and Standards-Based">
|
64
|
+
<p>
|
65
|
+
Neo.mjs is an open-source library. Features needed for the community can be added to the
|
66
|
+
library via pull-requests. And since Neo.mjs uses the standard JavaScript class system,
|
67
|
+
all Neo.mjs classes can be extended.
|
68
|
+
</p>
|
69
|
+
<p>
|
70
|
+
Neo.mjs uses standard modular JavaScript, so developers don't need to learn non-standard language
|
71
|
+
syntax, and there's no need for special pre-compilers or WebPack modules.
|
72
|
+
That means fewer dependencies and easier configuration. Furthermore, the use of
|
73
|
+
standard JavaScript makes debugging easier: any statement you write while developing your
|
74
|
+
applcation can also be run in the debugging console.
|
75
|
+
</p>
|
76
|
+
</div>
|
@@ -0,0 +1,102 @@
|
|
1
|
+
Neo.mjs classes are standard JavaSript classes. Every source file
|
2
|
+
you write will be a class definition, extending some Neo.mjs
|
3
|
+
class.
|
4
|
+
|
5
|
+
<pre class="neo">
|
6
|
+
import Base from '../../../node_modules/neo.mjs/src/core/Base.mjs';
|
7
|
+
|
8
|
+
class Mammal extends Base {
|
9
|
+
static config = {
|
10
|
+
className: 'Simple.example.Mammal'
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
const myMammal = Neo.create(Mammal);
|
15
|
+
|
16
|
+
Neo.applyClassConfig(Mammal); // Where Neo.mjs initialializes the class config.
|
17
|
+
export default Mammal; // Makes the class available elsewhere.
|
18
|
+
</pre>
|
19
|
+
|
20
|
+
In the example above, we're extending the Neo.mjs base class. The static
|
21
|
+
config block describes the class we're defining.
|
22
|
+
|
23
|
+
All classes specify the `className`; you'll add other config properties to describe the class.
|
24
|
+
|
25
|
+
The `const myMammal = Neo.create(Mammal);` statement creates an instance of
|
26
|
+
our class. For the sake of our discussion we're putting that statement in the same source
|
27
|
+
file where the class is defined, but normally your code would import the class elsewhere,
|
28
|
+
and create instances as needed.
|
29
|
+
|
30
|
+
Let's add a `name` propery to the class.
|
31
|
+
|
32
|
+
<pre class="neo" style="color:gray">
|
33
|
+
import Base from '../../../node_modules/neo.mjs/src/core/Base.mjs';
|
34
|
+
|
35
|
+
class Mammal extends Base {
|
36
|
+
static config = {
|
37
|
+
className: 'Simple.example.Mammal',
|
38
|
+
|
39
|
+
<span style="color:#b91010">name: 'Anonymous'</span>
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
const myMammal = Neo.create(Mammal);
|
44
|
+
console.log(<span style="color:#b91010">myMammal.name</span>); // Logs "Anonymous"
|
45
|
+
<span style="color:#b91010">myMammal.name</span> = 'Herbert';
|
46
|
+
console.log(<span style="color:#b91010">myMammal.name</span>); // Logs "Herbert"
|
47
|
+
|
48
|
+
Neo.applyClassConfig(Mammal);
|
49
|
+
|
50
|
+
export default Mammal;
|
51
|
+
</pre>
|
52
|
+
|
53
|
+
In Neo.mjs, instance properties are usually added in the `static config` block.
|
54
|
+
The `static config` block does two things:
|
55
|
+
- It formally describes the properties API for your class.
|
56
|
+
- It lets Neo.mjs manage the initialization and lifecycle of those properties.
|
57
|
+
|
58
|
+
Think of the `static config` block as "these are the properties
|
59
|
+
that can be set as instances are created." Config properties can be introduced
|
60
|
+
anywhere in the class hierarchy.
|
61
|
+
|
62
|
+
Since our class defines a `name` property, we can specify that when creating
|
63
|
+
the instance, using the second argument to the `create` method.
|
64
|
+
|
65
|
+
<pre class="neo" style="color:gray">
|
66
|
+
const myMammal = Neo.create(Mammal, <span style="color:#b91010">{
|
67
|
+
name: 'Creature'
|
68
|
+
}</span>);
|
69
|
+
console.log(myMammal.name); // Logs "Creature"
|
70
|
+
</pre>
|
71
|
+
|
72
|
+
|
73
|
+
Since _you_ define those properties, you can
|
74
|
+
look for them in class methods and use them as needed.
|
75
|
+
Let's add a `speak()` method that uses the `name` property.
|
76
|
+
|
77
|
+
<pre class="neo" style="color:gray">
|
78
|
+
import Base from '../../../node_modules/neo.mjs/src/core/Base.mjs';
|
79
|
+
|
80
|
+
class Mammal extends Base {
|
81
|
+
static config = {
|
82
|
+
className: 'Simple.example.Mammal',
|
83
|
+
|
84
|
+
name: 'Anonymous'
|
85
|
+
}
|
86
|
+
<span style="color:#b91010">speak(){
|
87
|
+
console.log(`${this.name} is grunting`);
|
88
|
+
}</span>
|
89
|
+
}
|
90
|
+
|
91
|
+
const myMammal = Neo.create(Mammal, {
|
92
|
+
name: 'Creature'
|
93
|
+
});
|
94
|
+
<span style="color:#b91010">myMammal.speak();</span> // Logs "Creature is grunting."
|
95
|
+
|
96
|
+
Neo.applyClassConfig(Mammal);
|
97
|
+
|
98
|
+
export default Mammal;
|
99
|
+
</pre>
|
100
|
+
|
101
|
+
|
102
|
+
|
@@ -0,0 +1,75 @@
|
|
1
|
+
In Neo.mjs you sub-class and override methods in the usual way.
|
2
|
+
|
3
|
+
Here, we'll extend `Mammal` and override the `speak()` method.
|
4
|
+
(For brevity, we'll exclude `export` and `import` statements.)
|
5
|
+
|
6
|
+
<pre class="neo">
|
7
|
+
class Mammal extends Base {
|
8
|
+
static config = {
|
9
|
+
className: 'Simple.example.Mammal',
|
10
|
+
|
11
|
+
name: 'Anonymous'
|
12
|
+
}
|
13
|
+
speak(){
|
14
|
+
console.log(`(${this.name} is grunting)`);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
Neo.applyClassConfig(Mammal);
|
18
|
+
</pre>
|
19
|
+
<pre class="neo">
|
20
|
+
class Human extends Mammal {
|
21
|
+
static config = {
|
22
|
+
className: 'Simple.example.Human',
|
23
|
+
}
|
24
|
+
speak(){
|
25
|
+
console.log(`Hello! My name is ${this.name}. I am ${this.married?'':'not'} married.`);
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
const myMammal = Neo.create(Human, {
|
30
|
+
name: 'Herbert'
|
31
|
+
});
|
32
|
+
myMammal.speak(); // Logs "Hello! My name is Herbert. I am not married."
|
33
|
+
|
34
|
+
Neo.applyClassConfig(Mammal);
|
35
|
+
</pre>
|
36
|
+
|
37
|
+
Any class in the hierarchy is free to add new properties and methods. Let's add
|
38
|
+
a property and behavior (method) to the Human class.
|
39
|
+
|
40
|
+
<pre class="neo">
|
41
|
+
import Base from '../../../node_modules/neo.mjs/src/core/Base.mjs';
|
42
|
+
|
43
|
+
class Mammal extends Base {
|
44
|
+
static config = {
|
45
|
+
className: 'Simple.example.Mammal',
|
46
|
+
|
47
|
+
name: 'Anonymous'
|
48
|
+
}
|
49
|
+
speak(){
|
50
|
+
console.log(`(${this.name} is grunting)`);
|
51
|
+
}
|
52
|
+
}
|
53
|
+
</pre>
|
54
|
+
<pre class="neo">
|
55
|
+
class Human extends Mammal {
|
56
|
+
static config = {
|
57
|
+
className: 'Simple.example.Human',
|
58
|
+
name: 'J. Doe',
|
59
|
+
married: false
|
60
|
+
}
|
61
|
+
speak(){
|
62
|
+
console.log(`Hello! My name is ${this.name}. I am ${this.married?'':'not'} married.`);
|
63
|
+
},
|
64
|
+
yodel(){
|
65
|
+
console.log('Yodelay hee hoo!');
|
66
|
+
}}
|
67
|
+
|
68
|
+
const myPerson = Neo.create(Human, {
|
69
|
+
name: 'Herbert'
|
70
|
+
});
|
71
|
+
myPerson.speak(); // Logs "Hello! My name is Herbert. I am not married."
|
72
|
+
myPerson.yodel(); // Logs "Yedelay hee hoo!"
|
73
|
+
|
74
|
+
Neo.applyClassConfig(Human);
|
75
|
+
</pre>
|
File without changes
|
@@ -0,0 +1,68 @@
|
|
1
|
+
To call a super-class method use the `super` keyword.
|
2
|
+
|
3
|
+
<pre class="neo" style="color:gray">
|
4
|
+
class Mammal extends Base {
|
5
|
+
static config = {
|
6
|
+
className: 'Simple.example.Mammal',
|
7
|
+
|
8
|
+
name: 'Anonymous'
|
9
|
+
}
|
10
|
+
doSomething(){
|
11
|
+
console.log(`${this.name} is doing something mammals do`)
|
12
|
+
}
|
13
|
+
}
|
14
|
+
Neo.applyClassConfig(Mammal);
|
15
|
+
</pre>
|
16
|
+
<pre class="neo" style="color:gray">
|
17
|
+
class Human extends Mammal {
|
18
|
+
static config = {
|
19
|
+
className: 'Simple.example.Human',
|
20
|
+
}
|
21
|
+
doSomething(){
|
22
|
+
<span style="color:#b91010">super.doSomething();</span>
|
23
|
+
console.log(`${this.name} is doing something humans do`)
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
const myPerson = Neo.create(Human, {
|
28
|
+
name: 'Herbert'
|
29
|
+
});
|
30
|
+
myPerson.doSomething();
|
31
|
+
|
32
|
+
Neo.applyClassConfig(Mammal);
|
33
|
+
</pre>
|
34
|
+
|
35
|
+
Sometimes you aren't sure if a super class has a method. In that case use the
|
36
|
+
conditional chaining operator — `?.`
|
37
|
+
|
38
|
+
<pre class="neo" style="color:gray">
|
39
|
+
class Mammal extends Base {
|
40
|
+
static config = {
|
41
|
+
className: 'Simple.example.Mammal',
|
42
|
+
|
43
|
+
name: 'Anonymous'
|
44
|
+
}
|
45
|
+
doSomething(){
|
46
|
+
console.log(`${this.name} is doing something mammals do`)
|
47
|
+
}
|
48
|
+
}
|
49
|
+
Neo.applyClassConfig(Mammal);
|
50
|
+
</pre>
|
51
|
+
<pre class="neo" style="color:gray">
|
52
|
+
class Human extends Mammal {
|
53
|
+
static config = {
|
54
|
+
className: 'Simple.example.Human',
|
55
|
+
}
|
56
|
+
doSomething(){
|
57
|
+
<span style="color:#b91010">super?.doSomething();</span>
|
58
|
+
console.log(`${this.name} is doing something humans do`)
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
const myPerson = Neo.create(Human, {
|
63
|
+
name: 'Herbert'
|
64
|
+
});
|
65
|
+
myPerson.doSomething();
|
66
|
+
|
67
|
+
Neo.applyClassConfig(Mammal);
|
68
|
+
</pre>
|
File without changes
|
@@ -0,0 +1,119 @@
|
|
1
|
+
If you haven't already done it, run `npx neo-app` to create a Neo.mjs workspace.
|
2
|
+
|
3
|
+
<img src="resources/images/learn/NeoWorkspace.png" style="height: 400px;">
|
4
|
+
|
5
|
+
As you can see, a Neo.mjs workspace is a conventional npm workspace. If you run
|
6
|
+
the script `npm run server-start` from the workspace, Neo.mjs launches a web
|
7
|
+
serve whose doc root is the workspace.
|
8
|
+
|
9
|
+
<img src="resources/images/learn/ServerRoot.png" style="height: 400px;">
|
10
|
+
|
11
|
+
If you drill down into the `src` directory you'll see your applications.
|
12
|
+
The `docs` directory holds the Neo.mjs API docs. Examples are in the `examples` directory.
|
13
|
+
|
14
|
+
In order to discuss the structure of an app, we'll create a simple starter
|
15
|
+
app. To do that, run this command from the workspace.
|
16
|
+
|
17
|
+
`npm run create-app-empty`
|
18
|
+
|
19
|
+
At the first prompt, name the app `Foo`, and accept the default for everything else.
|
20
|
+
The script creates an application structured as follows.
|
21
|
+
|
22
|
+
<img src="resources/images/learn/FooFolder.png" style="height: 400px;">
|
23
|
+
|
24
|
+
These files are part of the typical structure of a Neo.mjs application. The files `index.html`, `app.mjs`, `neo-config.json`, `view/Viewport.mjs` are rarely modified.
|
25
|
+
You will, however, edit the main container, and its associated "controller" and "model",
|
26
|
+
as well as create new views, new controllers, etc.
|
27
|
+
|
28
|
+
Now let's look at a source file. This is the contents of `MainView.mjs`.
|
29
|
+
|
30
|
+
<pre class="neo">
|
31
|
+
import Base from '../../../node_modules/neo.mjs/src/container/Base.mjs';
|
32
|
+
import Controller from './MainViewController.mjs';
|
33
|
+
import ViewModel from './MainViewModel.mjs';
|
34
|
+
|
35
|
+
class MainView extends Base {
|
36
|
+
static config = {
|
37
|
+
className: 'Foo.view.MainView',
|
38
|
+
|
39
|
+
controller: {module: Controller},
|
40
|
+
model: {module: ViewModel},
|
41
|
+
|
42
|
+
layout: {ntype: 'fit'},
|
43
|
+
items: [],
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
Neo.applyClassConfig(MainView);
|
48
|
+
|
49
|
+
export default MainView;
|
50
|
+
</pre>
|
51
|
+
|
52
|
+
Neo.mjs views are composed of components. A component can be a "container", which means it
|
53
|
+
visually holds or groups other components, or a regular component, like a button.
|
54
|
+
|
55
|
+
The main view is a container because it extends `Base`, which is a reference to the
|
56
|
+
container base class imported in the first statement. The items in a container are configured
|
57
|
+
in `items:[]`, which is empty in this starter code.
|
58
|
+
|
59
|
+
This view also has a _controller_ and _model_. We'll talk about those later, but in a nutshell,
|
60
|
+
a controller is where event handling and app logic goes, and a model is where you set up shared
|
61
|
+
bindable data.
|
62
|
+
|
63
|
+
We'll go into a lot more depth about view, controllers, and models in other topics, but to let
|
64
|
+
you see how a component is configured let's put a button in the container.
|
65
|
+
|
66
|
+
First, we need to import the class that defines buttons. Then we'll describe the new button in the
|
67
|
+
`items:[].`
|
68
|
+
|
69
|
+
<pre class="neo">
|
70
|
+
|
71
|
+
import Base from '../../../node_modules/neo.mjs/src/container/Base.mjs';
|
72
|
+
import Controller from './MainViewController.mjs';
|
73
|
+
import ViewModel from './MainViewModel.mjs';
|
74
|
+
import Button from '../../../node_modules/neo.mjs/src/button/Base.mjs';
|
75
|
+
|
76
|
+
class MainView extends Base {
|
77
|
+
static config = {
|
78
|
+
className: 'Foo.view.MainView',
|
79
|
+
|
80
|
+
controller: {module: Controller},
|
81
|
+
model: {module: ViewModel},
|
82
|
+
|
83
|
+
layout: {ntype: 'fit'},
|
84
|
+
items: [{
|
85
|
+
module: Button,
|
86
|
+
text: 'Button'
|
87
|
+
}],
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
Neo.applyClassConfig(MainView);
|
92
|
+
|
93
|
+
export default MainView;
|
94
|
+
</pre>
|
95
|
+
|
96
|
+
Note the entry in +items:[]+. That's a description of the button that'll be created as the single
|
97
|
+
item in our container. In Neo.mjs terms we're _configuring_ the button. Neo.mjs is _declarative_,
|
98
|
+
which components and objects are _described_. It's an abstraction. In other words we're saying
|
99
|
+
what we want, but not how it's done. We want a button with some text — how that's done
|
100
|
+
isn't important here in the container. A non-declarative approach would be more focused on _how_,
|
101
|
+
where you might way "I want a <button> HTML element with its innerHTML set to some value."
|
102
|
+
|
103
|
+
In another topic you'll learn about the Neo.mjs config system and declaratively describing
|
104
|
+
views, controllers, and other things.
|
105
|
+
|
106
|
+
If you run the +foo+ app you'll see one huge button. That's because the container is configured to
|
107
|
+
use the "fit" layout, which means the container is designed to hold one and only one component,
|
108
|
+
and that component will take up all available space. We could get a more normal looking button
|
109
|
+
by changing the layout.
|
110
|
+
|
111
|
+
`layout: {type:'vbox', align:'start},`
|
112
|
+
|
113
|
+
Change that line and look at the running application.
|
114
|
+
|
115
|
+
Neo.mjs has scores of component classes.
|
116
|
+
You can extend them to create your own reusable components and sets of components.
|
117
|
+
|
118
|
+
Other topics discuss coding applications, how the config system works, controllers,
|
119
|
+
and bindable data. However, as long as we're here
|