-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathApplication.njs
More file actions
166 lines (159 loc) · 7.53 KB
/
Application.njs
File metadata and controls
166 lines (159 loc) · 7.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
import Nullstack from 'nullstack'
import AnchorModifiers from './AnchorModifiers'
import ArrayAttributes from './ArrayAttributes'
import BodyFragment from './BodyFragment'
import HtmlFragment from './HtmlFragment'
import WindowFragment from './WindowFragment'
import CatchError from './CatchError'
import ChildComponent from './ChildComponent'
import ComponentTernary from './ComponentTernary'
import Context from './Context'
import ContextData from './ContextData'
import ContextEnvironment from './ContextEnvironment'
import ContextPage from './ContextPage'
import ContextProject from './ContextProject'
import ContextSecrets from './ContextSecrets'
import ContextSettings from './ContextSettings'
import ContextWorker from './ContextWorker'
import DateParser from './DateParser'
import DynamicHead from './DynamicHead'
import Element from './Element'
import ErrorOnChildNode from './ErrorOnChildNode'
import ErrorPage from './ErrorPage'
import ExposedServerFunctions from './ExposedServerFunctions'
import ExternalServerFunctions from './ExternalServerFunctions'
import FalsyNodes from './FalsyNodes'
import FullStackLifecycle from './FullStackLifecycle'
import Instanceable from './Instanceable'
import InstanceKey from './InstanceKey'
import InstanceSelf from './InstanceSelf'
import IsomorphicImport from './IsomorphicImport'
import IsomorphicStartup from './IsomorphicStartup'
import JavaScriptExtension from './JavaScriptExtension'
import Logo from './Logo'
import MetatagState from './MetatagState'
import NestedProxy from './NestedProxy'
import OptimizedEvents from './OptimizedEvents'
import ParentComponent from './ParentComponent'
import PersistentComponent from './PersistentComponent'
import PluginAttributes from './PluginAttributes'
import PublicServerFunctions from './PublicServerFunctions'
import PureComponents from './PureComponents'
import Refs from './Refs'
import RenderableComponent from './RenderableComponent'
import ReqRes from './ReqRes'
import RoutesAndParams from './RoutesAndParams'
import RouteScroll from './RouteScroll'
import ServerFunctions from './ServerFunctions'
import ServerRequestAndResponse from './ServerRequestAndResponse'
import StatefulComponent from './StatefulComponent'
import StaticThis from './StaticThis'
import TextObserver from './TextObserver'
import TwoWayBindings from './TwoWayBindings'
import TypeScript from './TypeScript'
import TypeScriptExtension from './TypeScriptExtension'
import UndefinedNodes from './UndefinedNodes'
import UnderscoredAttributes from './UnderscoredAttributes'
import Vunerability from './Vunerability'
import WebpackCustomPlugin from './WebpackCustomPlugin'
import WorkerVerbs from './WorkerVerbs'
import LazyComponent from './LazyComponent'
import LazyComponentLoader from './LazyComponentLoader'
import NestedFolder from './nested/NestedFolder'
import ChildComponentWithoutServerFunctions from './ChildComponentWithoutServerFunctions'
import ObjectEventScope from './ObjectEventScope'
import './Application.css'
class Application extends Nullstack {
async changeInstanceable({ instances }) {
await instances.instanceable.customMethod()
}
prepare(context) {
context.string = 'nullstack'
context.refInstanceCount = 0
}
render({ project, page, environment, refInstanceCount }) {
return (
<body data-application-hydrated={this.hydrated}>
<h1> {project.name} </h1>
{page.status !== 200 && <div route="*" data-page-status={page.status} />}
<div route="/">
<a href="/lazy-component"> go lazy go home </a>
<a href="/lazy-importer"> import </a>
<a href={`/nullstack/${environment.key}/offline`}> offline </a>
<a href="/static-this"> static this </a>
<a href="/routes-and-params/a"> router with params </a>
<a href="/undefined-nodes"> undefined nodes </a>
<a href="/full-stack-lifecycle"> lifecycle </a>
<a href="/refs"> refs </a>
<a href="/error-on-child-node?dom=true"> error-on-child-node?dom=true </a>
<a href="/error-on-child-node?serialization=true"> error-on-child-node?serialization=true </a>
<a href="/route-scroll/class?changed=1#bottom">#bottom</a>
</div>
<RenderableComponent route="/renderable-component" />
<StatefulComponent route="/stateful-component" />
<FullStackLifecycle route="/full-stack-lifecycle" />
<InstanceSelf route="/instance-self" />
<ContextProject route="/context-project" />
<ServerFunctions route="/server-functions" />
<Context route="/context" />
<ContextSecrets route="/context-secrets" />
<ContextSettings route="/context-settings" />
<ContextEnvironment route="/context-environment" />
<ContextWorker route="/context-worker" />
<InstanceKey route="/instance-key" />
<RoutesAndParams route="/routes-and-params/*" />
<ContextPage route="/context-page" />
<TwoWayBindings route="/two-way-bindings" />
<ServerRequestAndResponse route="/server-request-and-response" />
<ContextData route="/context-data" />
<DateParser route="/date-parser" />
<StaticThis route="/static-this" />
<ChildComponent route="/child-component" />
<ParentComponent route="/parent-component" />
<Element route="/element" />
<PluginAttributes route="/plugin-attributes" />
<PureComponents route="/pure-components" />
<Instanceable route="/instanceable" key="instanceable" />
<NestedProxy route="/nested-proxy" />
<FalsyNodes route="/falsy-nodes" />
<ErrorOnChildNode route="/error-on-child-node" />
<Vunerability route="/vunerability" />
<UnderscoredAttributes route="/underscored-attributes" />
<PersistentComponent route="/persistent-component/:id" persistent />
<IsomorphicStartup route="/isomorphic-startup" />
<WorkerVerbs route="/worker-verbs" />
<TypeScript route="/typescript" />
<LazyComponentLoader route="/lazy-component" />
<PublicServerFunctions key="publicServerFunctions" />
<ExternalServerFunctions route="/external-server-functions" />
<UndefinedNodes route="/undefined-nodes" />
<WebpackCustomPlugin route="/webpack-custom-plugin" />
<ComponentTernary route="/component-ternary" />
<AnchorModifiers route="/anchor-modifiers" key="anchorModifiers" />
<MetatagState route="/metatag-state" />
<JavaScriptExtension route="/javascript-extension" />
<TypeScriptExtension route="/typescript-extension" generic />
<Refs route="/refs" key={`refs${refInstanceCount}`} />
<OptimizedEvents route="/optimized-events" />
<DynamicHead route="/dynamic-head" />
<TextObserver route="/text-observer" />
<BodyFragment route="/body-fragment" />
<HtmlFragment route="/html-fragment" />
<WindowFragment route="/window-fragment" />
<ArrayAttributes route="/array-attributes" />
<RouteScroll route="/route-scroll/*" key="routeScroll" />
<IsomorphicImport route="/isomorphic-import" />
<ExposedServerFunctions route="/exposed-server-functions" />
<CatchError route="/catch-error" />
<ReqRes route="/reqres" />
<Logo route="/logo" />
<NestedFolder route="/nested/folder" />
<LazyComponent route="/lazy-importer" prop="works" />
<ChildComponentWithoutServerFunctions route="/child-component-without-server-functions" />
<ObjectEventScope route="/object-event-scope" />
<ErrorPage route="*" />
</body>
)
}
}
export default Application