@bleedingdev/modern-js-renderer-octane 0.0.0-stage → 3.9.3-ultramodern.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/LICENSE +21 -0
- package/bin/octane-tsc.mjs +4 -0
- package/dist/cjs/bootstrap.js +68 -0
- package/dist/cjs/client.js +371 -0
- package/dist/cjs/entry-application.js +83 -0
- package/dist/cjs/entry-client.js +92 -0
- package/dist/cjs/entry-server.js +127 -0
- package/dist/cjs/federation-context.js +72 -0
- package/dist/cjs/federation.js +103 -0
- package/dist/cjs/i18n/I18nProvider.js +67 -0
- package/dist/cjs/i18n/LocalizedLink.js +89 -0
- package/dist/cjs/i18n/context.js +41 -0
- package/dist/cjs/i18n/index.js +86 -0
- package/dist/cjs/i18n/languageSync.js +99 -0
- package/dist/cjs/i18n/types.js +18 -0
- package/dist/cjs/i18n/useI18n.js +110 -0
- package/dist/cjs/index.js +46 -0
- package/dist/cjs/manifest.js +167 -0
- package/dist/cjs/plugin/compiler.js +125 -0
- package/dist/cjs/plugin/create.js +265 -0
- package/dist/cjs/plugin/index.js +151 -0
- package/dist/cjs/plugin/profile.js +89 -0
- package/dist/cjs/plugin/source.js +56 -0
- package/dist/cjs/router-client.js +139 -0
- package/dist/cjs/router-handler.js +168 -0
- package/dist/cjs/router-injection.js +139 -0
- package/dist/cjs/router-server-cleanup.js +46 -0
- package/dist/cjs/router-server-snapshot.js +405 -0
- package/dist/cjs/router-server.js +108 -0
- package/dist/cjs/router-snapshot.js +270 -0
- package/dist/cjs/router.js +218 -0
- package/dist/cjs/routes.js +187 -0
- package/dist/cjs/server.js +224 -0
- package/dist/cjs/typecheck.js +615 -0
- package/dist/esm/bootstrap.mjs +24 -0
- package/dist/esm/client.mjs +327 -0
- package/dist/esm/entry-application.mjs +39 -0
- package/dist/esm/entry-client.mjs +54 -0
- package/dist/esm/entry-server.mjs +86 -0
- package/dist/esm/federation-context.mjs +25 -0
- package/dist/esm/federation.mjs +65 -0
- package/dist/esm/i18n/I18nProvider.mjs +29 -0
- package/dist/esm/i18n/LocalizedLink.mjs +48 -0
- package/dist/esm/i18n/context.mjs +3 -0
- package/dist/esm/i18n/index.mjs +8 -0
- package/dist/esm/i18n/languageSync.mjs +61 -0
- package/dist/esm/i18n/types.mjs +0 -0
- package/dist/esm/i18n/useI18n.mjs +72 -0
- package/dist/esm/index.mjs +8 -0
- package/dist/esm/manifest.mjs +117 -0
- package/dist/esm/router-client.mjs +98 -0
- package/dist/esm/router-handler.mjs +130 -0
- package/dist/esm/router-injection.mjs +101 -0
- package/dist/esm/router-server-cleanup.mjs +8 -0
- package/dist/esm/router-server-snapshot.mjs +367 -0
- package/dist/esm/router-server.mjs +12 -0
- package/dist/esm/router-snapshot.mjs +199 -0
- package/dist/esm/router.mjs +94 -0
- package/dist/esm/routes.mjs +134 -0
- package/dist/esm/server.mjs +183 -0
- package/dist/esm-node/bootstrap.mjs +24 -0
- package/dist/esm-node/manifest.mjs +117 -0
- package/dist/esm-node/plugin/compiler.mjs +70 -0
- package/dist/esm-node/plugin/create.mjs +227 -0
- package/dist/esm-node/plugin/index.mjs +103 -0
- package/dist/esm-node/plugin/profile.mjs +51 -0
- package/dist/esm-node/plugin/source.mjs +7 -0
- package/dist/esm-node/typecheck.mjs +560 -0
- package/dist/types/bootstrap.d.ts +10 -0
- package/dist/types/client.d.ts +36 -0
- package/dist/types/entry-application.d.ts +19 -0
- package/dist/types/entry-client.d.ts +8 -0
- package/dist/types/entry-server.d.ts +11 -0
- package/dist/types/federation-context.d.ts +28 -0
- package/dist/types/federation.d.ts +18 -0
- package/dist/types/i18n/I18nProvider.d.ts +8 -0
- package/dist/types/i18n/LocalizedLink.d.ts +41 -0
- package/dist/types/i18n/context.d.ts +9 -0
- package/dist/types/i18n/index.d.ts +9 -0
- package/dist/types/i18n/languageSync.d.ts +26 -0
- package/dist/types/i18n/types.d.ts +34 -0
- package/dist/types/i18n/useI18n.d.ts +21 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/manifest.d.ts +34 -0
- package/dist/types/plugin/compiler-manifest.d.cts +10 -0
- package/dist/types/plugin/compiler.d.ts +5 -0
- package/dist/types/plugin/create.d.ts +23 -0
- package/dist/types/plugin/index.d.ts +3 -0
- package/dist/types/plugin/profile.d.ts +2 -0
- package/dist/types/plugin/source.d.ts +1 -0
- package/dist/types/plugin/svg-component-template.d.cts +6 -0
- package/dist/types/router-client.d.ts +12 -0
- package/dist/types/router-handler.d.ts +13 -0
- package/dist/types/router-injection.d.ts +8 -0
- package/dist/types/router-server-cleanup.d.ts +3 -0
- package/dist/types/router-server-snapshot.d.ts +15 -0
- package/dist/types/router-server.d.ts +13 -0
- package/dist/types/router-snapshot.d.ts +14 -0
- package/dist/types/router.d.ts +30 -0
- package/dist/types/routes.d.ts +18 -0
- package/dist/types/server.d.ts +41 -0
- package/dist/types/typecheck.d.ts +31 -0
- package/package.json +216 -4
- package/src/bootstrap.ts +60 -0
- package/src/client.ts +485 -0
- package/src/entry-application.ts +72 -0
- package/src/entry-client.ts +80 -0
- package/src/entry-server.ts +142 -0
- package/src/federation-context.ts +53 -0
- package/src/federation.ts +158 -0
- package/src/i18n/I18nProvider.ts +56 -0
- package/src/i18n/LocalizedLink.ts +112 -0
- package/src/i18n/context.ts +12 -0
- package/src/i18n/index.ts +35 -0
- package/src/i18n/languageSync.ts +132 -0
- package/src/i18n/types.ts +36 -0
- package/src/i18n/useI18n.ts +119 -0
- package/src/index.ts +10 -0
- package/src/manifest.ts +253 -0
- package/src/plugin/compiler-manifest.cjs +178 -0
- package/src/plugin/compiler.ts +112 -0
- package/src/plugin/create.ts +272 -0
- package/src/plugin/index.ts +105 -0
- package/src/plugin/profile.ts +46 -0
- package/src/plugin/source.ts +16 -0
- package/src/plugin/svg-component-template.cjs +17 -0
- package/src/router-client.ts +144 -0
- package/src/router-handler.ts +182 -0
- package/src/router-injection.ts +145 -0
- package/src/router-server-cleanup.ts +11 -0
- package/src/router-server-snapshot.ts +564 -0
- package/src/router-server.ts +23 -0
- package/src/router-snapshot.ts +251 -0
- package/src/router.ts +192 -0
- package/src/routes.ts +263 -0
- package/src/server.ts +300 -0
- package/src/typecheck.ts +723 -0
- package/README.md +0 -3
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
function generateOctaneAppSources(options) {
|
|
31
|
+
if ((options.entryName ?? 'main') !== 'main') throw new Error('The Octane app template supports the main entry only. The create-time workspace writer places src/modern-app-env.d.ts, src/routes/index.css and the package manifest at the app root regardless of entryName, so it cannot yet route a second entry into src/<entryName>/. Add that entry by hand after generation (mirror src/routes under src/<entryName>/routes) until an admitted native multi-entry create template exists; the native entry generator itself already supports arbitrary entry names.');
|
|
32
|
+
if (!options.appId.trim() || !options.title.trim()) throw new Error('The Octane app template requires an appId and title.');
|
|
33
|
+
if ('.tsx' !== options.sourceExtension) throw new Error('The Octane app template requires the admitted .tsx source profile. .tsrx generation requires an admitted native template profile.');
|
|
34
|
+
if ('octane' !== options.jsxImportSource) throw new Error('The Octane app template requires jsxImportSource: "octane" from the admitted profile.');
|
|
35
|
+
if ('boolean' != typeof options.capabilities.ssr || 'boolean' != typeof options.capabilities.federation) throw new Error('The Octane app template requires admitted capabilities.');
|
|
36
|
+
const title = JSON.stringify(options.title);
|
|
37
|
+
const aboutTitle = JSON.stringify(`${options.title} - About`);
|
|
38
|
+
const appId = JSON.stringify(options.appId);
|
|
39
|
+
return {
|
|
40
|
+
sourceExtension: '.tsx',
|
|
41
|
+
jsxImportSource: 'octane',
|
|
42
|
+
artifacts: [
|
|
43
|
+
{
|
|
44
|
+
path: 'src/routes/layout.tsx',
|
|
45
|
+
content: `import { Link, Outlet } from '@modern-js/renderer-octane/router';
|
|
46
|
+
import Stable from '../components/Stable';
|
|
47
|
+
import './index.css';
|
|
48
|
+
|
|
49
|
+
const appTitle = ${title};
|
|
50
|
+
|
|
51
|
+
export default function Layout() {
|
|
52
|
+
return (
|
|
53
|
+
<main data-testid="native-layout">
|
|
54
|
+
<header>
|
|
55
|
+
<p>{appTitle}</p>
|
|
56
|
+
<nav aria-label="Application">
|
|
57
|
+
<Link to="/">Home</Link>
|
|
58
|
+
<Link to="/about">About</Link>
|
|
59
|
+
${options.capabilities.federation ? ' <Link to="/remotes">Federated applications</Link>\n' : ''}
|
|
60
|
+
</nav>
|
|
61
|
+
</header>
|
|
62
|
+
<Stable />
|
|
63
|
+
<Outlet />
|
|
64
|
+
</main>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
`
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
path: 'src/routes/page.tsx',
|
|
71
|
+
content: `import {
|
|
72
|
+
Link,
|
|
73
|
+
useLoaderData,
|
|
74
|
+
useOctaneRouteAction,
|
|
75
|
+
} from '@modern-js/renderer-octane/router';
|
|
76
|
+
import { useActionState } from 'octane';
|
|
77
|
+
import Counter from '../components/Counter';
|
|
78
|
+
|
|
79
|
+
const appId = ${appId};
|
|
80
|
+
const appTitle = ${title};
|
|
81
|
+
|
|
82
|
+
export default function HomePage() {
|
|
83
|
+
const data = useLoaderData({ strict: false });
|
|
84
|
+
const submit = useOctaneRouteAction();
|
|
85
|
+
const [result, action, pending] = useActionState(submit, undefined);
|
|
86
|
+
return (
|
|
87
|
+
<section data-app-id={appId} data-testid="native-route" data-renderer="octane">
|
|
88
|
+
<h1>{appTitle}</h1>
|
|
89
|
+
<Counter />
|
|
90
|
+
<pre data-testid="native-loader-value">{JSON.stringify(data)}</pre>
|
|
91
|
+
<form action={action}>
|
|
92
|
+
<label>
|
|
93
|
+
Name <input name="name" />
|
|
94
|
+
</label>
|
|
95
|
+
<button type="submit" disabled={pending}>
|
|
96
|
+
Save
|
|
97
|
+
</button>
|
|
98
|
+
<button type="submit" name="intent" value="redirect">
|
|
99
|
+
Save and redirect
|
|
100
|
+
</button>
|
|
101
|
+
</form>
|
|
102
|
+
<pre data-testid="native-action-value">{JSON.stringify(result)}</pre>
|
|
103
|
+
<Link to="/about">Open native about route</Link>
|
|
104
|
+
</section>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
`
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
path: 'src/routes/page.head.ts',
|
|
111
|
+
content: `import type { FileSystemRouteModule } from '@modern-js/renderer-octane/router';
|
|
112
|
+
|
|
113
|
+
export const head: NonNullable<FileSystemRouteModule['head']> = () => ({
|
|
114
|
+
meta: [
|
|
115
|
+
{ title: ${title} },
|
|
116
|
+
{ name: 'description', content: 'Built with the native Octane renderer' },
|
|
117
|
+
],
|
|
118
|
+
});
|
|
119
|
+
`
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
path: 'src/routes/about/page.tsx',
|
|
123
|
+
content: `import { Link } from '@modern-js/renderer-octane/router';
|
|
124
|
+
|
|
125
|
+
export default function AboutPage() {
|
|
126
|
+
return (
|
|
127
|
+
<section data-testid="native-about">
|
|
128
|
+
<h1>Native Octane navigation</h1>
|
|
129
|
+
<Link to="/">Home</Link>
|
|
130
|
+
</section>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
`
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
path: 'src/routes/about/page.head.ts',
|
|
137
|
+
content: `import type { FileSystemRouteModule } from '@modern-js/renderer-octane/router';
|
|
138
|
+
|
|
139
|
+
export const head: NonNullable<FileSystemRouteModule['head']> = () => ({
|
|
140
|
+
meta: [
|
|
141
|
+
{ title: ${aboutTitle} },
|
|
142
|
+
{ name: 'description', content: 'Built with the native Octane renderer' },
|
|
143
|
+
],
|
|
144
|
+
});
|
|
145
|
+
`
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
path: 'src/components/Counter.tsx',
|
|
149
|
+
content: `import { useState } from 'octane';
|
|
150
|
+
|
|
151
|
+
export default function Counter() {
|
|
152
|
+
const [count, setCount] = useState(0);
|
|
153
|
+
return (
|
|
154
|
+
<section data-testid="native-edited-component">
|
|
155
|
+
<span data-testid="native-hmr-marker">Counter before native edit</span>
|
|
156
|
+
<button type="button" onClick={() => setCount(value => value + 1)}>
|
|
157
|
+
Increment
|
|
158
|
+
</button>
|
|
159
|
+
<output data-testid="native-count">{count}</output>
|
|
160
|
+
</section>
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
`
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
path: 'src/components/Stable.tsx',
|
|
167
|
+
content: `import { useState } from 'octane';
|
|
168
|
+
|
|
169
|
+
export default function Stable() {
|
|
170
|
+
const [count, setCount] = useState(0);
|
|
171
|
+
return (
|
|
172
|
+
<section data-testid="native-unaffected-component">
|
|
173
|
+
<button type="button" onClick={() => setCount(value => value + 1)}>
|
|
174
|
+
Increment stable state
|
|
175
|
+
</button>
|
|
176
|
+
<output data-testid="native-unaffected-count">{count}</output>
|
|
177
|
+
</section>
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
`
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
path: 'src/routes/page.data.ts',
|
|
184
|
+
content: `import type { DataHandlerInput } from '@modern-js/renderer-core/data';
|
|
185
|
+
|
|
186
|
+
export function loader({ request }: DataHandlerInput) {
|
|
187
|
+
const url = new URL(request.url);
|
|
188
|
+
if (url.searchParams.get('case') === 'not-found')
|
|
189
|
+
throw new Response('Native route not found', { status: 404 });
|
|
190
|
+
if (url.searchParams.get('case') === 'error')
|
|
191
|
+
throw new Error('Native loader failure');
|
|
192
|
+
if (url.searchParams.get('case') === 'redirect')
|
|
193
|
+
return new Response(null, { status: 302, headers: { location: '/about' } });
|
|
194
|
+
return {
|
|
195
|
+
message: 'Native loader value',
|
|
196
|
+
privateValue: request.headers.get('x-conformance-private'),
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export async function action({ request }: DataHandlerInput) {
|
|
201
|
+
const form = await request.formData();
|
|
202
|
+
const name = form.get('name');
|
|
203
|
+
if (typeof name !== 'string' || !name.trim())
|
|
204
|
+
return Response.json(
|
|
205
|
+
{ fieldErrors: { name: 'Name required' } },
|
|
206
|
+
{ status: 422 },
|
|
207
|
+
);
|
|
208
|
+
if (form.get('intent') === 'redirect')
|
|
209
|
+
return new Response(null, {
|
|
210
|
+
status: 303,
|
|
211
|
+
headers: {
|
|
212
|
+
location: '/about',
|
|
213
|
+
'set-cookie': 'conformance-saved=1; Path=/; SameSite=Lax',
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
if (form.get('intent') === 'throw') throw new Error('Native action failure');
|
|
217
|
+
return {
|
|
218
|
+
saved: name,
|
|
219
|
+
privateValue: request.headers.get('x-conformance-private'),
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
`
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
path: 'src/routes/error.tsx',
|
|
226
|
+
content: `import type { ErrorRouteComponent } from '@modern-js/renderer-octane/router';
|
|
227
|
+
|
|
228
|
+
const ErrorBoundary: ErrorRouteComponent = props => (
|
|
229
|
+
<section data-testid="native-error">
|
|
230
|
+
<h1>Something went wrong</h1>
|
|
231
|
+
<output>
|
|
232
|
+
{props.error instanceof Error ? props.error.message : String(props.error)}
|
|
233
|
+
</output>
|
|
234
|
+
</section>
|
|
235
|
+
);
|
|
236
|
+
|
|
237
|
+
export default ErrorBoundary;
|
|
238
|
+
`
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
path: 'src/routes/not-found.tsx',
|
|
242
|
+
content: `import type { NotFoundRouteComponent } from '@modern-js/renderer-octane/router';
|
|
243
|
+
|
|
244
|
+
const NotFound: NotFoundRouteComponent = () => (
|
|
245
|
+
<section data-testid="native-not-found">
|
|
246
|
+
<h1>Page not found</h1>
|
|
247
|
+
</section>
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
export default NotFound;
|
|
251
|
+
`
|
|
252
|
+
}
|
|
253
|
+
]
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
257
|
+
generateOctaneAppSources: ()=>generateOctaneAppSources
|
|
258
|
+
});
|
|
259
|
+
exports.generateOctaneAppSources = __webpack_exports__.generateOctaneAppSources;
|
|
260
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
261
|
+
"generateOctaneAppSources"
|
|
262
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
263
|
+
Object.defineProperty(exports, '__esModule', {
|
|
264
|
+
value: true
|
|
265
|
+
});
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
(()=>{
|
|
25
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
26
|
+
})();
|
|
27
|
+
(()=>{
|
|
28
|
+
__webpack_require__.r = (exports1)=>{
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
30
|
+
value: 'Module'
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
33
|
+
value: true
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
var __webpack_exports__ = {};
|
|
38
|
+
__webpack_require__.r(__webpack_exports__);
|
|
39
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
+
rendererAdapter: ()=>rendererAdapter
|
|
41
|
+
});
|
|
42
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
43
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
44
|
+
const adapter_namespaceObject = require("@modern-js/renderer-core/adapter");
|
|
45
|
+
const external_manifest_js_namespaceObject = require("../manifest.js");
|
|
46
|
+
const external_compiler_js_namespaceObject = require("./compiler.js");
|
|
47
|
+
const external_create_js_namespaceObject = require("./create.js");
|
|
48
|
+
const external_profile_js_namespaceObject = require("./profile.js");
|
|
49
|
+
const external_source_js_namespaceObject = require("./source.js");
|
|
50
|
+
const rendererAdapter = (0, adapter_namespaceObject.defineRendererAdapter)({
|
|
51
|
+
name: 'octane',
|
|
52
|
+
kind: 'native',
|
|
53
|
+
profile: external_profile_js_namespaceObject.octaneProfile,
|
|
54
|
+
routerFrameworks: [
|
|
55
|
+
'octane'
|
|
56
|
+
],
|
|
57
|
+
runtime: {
|
|
58
|
+
package: 'octane',
|
|
59
|
+
bootstrap: '@modern-js/renderer-octane',
|
|
60
|
+
entryClient: '@modern-js/renderer-octane/entry-client',
|
|
61
|
+
entryServer: '@modern-js/renderer-octane/entry-server',
|
|
62
|
+
router: '@modern-js/renderer-octane/router',
|
|
63
|
+
i18n: '@modern-js/renderer-octane/i18n',
|
|
64
|
+
manifest: '@modern-js/renderer-octane/manifest'
|
|
65
|
+
},
|
|
66
|
+
federation: {
|
|
67
|
+
library: 'module',
|
|
68
|
+
ssr: true,
|
|
69
|
+
shared: [
|
|
70
|
+
'octane',
|
|
71
|
+
'octane/',
|
|
72
|
+
'octane/internal/context',
|
|
73
|
+
'octane/internal/signal-read',
|
|
74
|
+
'octane/signals',
|
|
75
|
+
'@octanejs/tanstack-router',
|
|
76
|
+
'@octanejs/tanstack-router/',
|
|
77
|
+
'@modern-js/renderer-octane',
|
|
78
|
+
'@modern-js/renderer-octane/',
|
|
79
|
+
'@modern-js/renderer-octane/router',
|
|
80
|
+
'@modern-js/renderer-octane/federation',
|
|
81
|
+
'@modern-js/renderer-core',
|
|
82
|
+
'@modern-js/renderer-core/',
|
|
83
|
+
'@tanstack/router-core',
|
|
84
|
+
'@tanstack/history',
|
|
85
|
+
'seroval',
|
|
86
|
+
'seroval-plugins'
|
|
87
|
+
],
|
|
88
|
+
sharedByEnvironment: {
|
|
89
|
+
client: {
|
|
90
|
+
'octane/internal/client': 'octane/internal/client',
|
|
91
|
+
'octane/signals/client': 'octane/signals/client',
|
|
92
|
+
'octane/profiling': 'octane/profiling',
|
|
93
|
+
'octane/hydration/streamed-signals': 'octane/hydration/streamed-signals',
|
|
94
|
+
'@modern-js/renderer-octane/client': '@modern-js/renderer-octane/client'
|
|
95
|
+
},
|
|
96
|
+
server: {
|
|
97
|
+
octane: 'octane/server',
|
|
98
|
+
'octane/server': 'octane/server',
|
|
99
|
+
'octane/internal/server': 'octane/internal/server',
|
|
100
|
+
'octane/signals/server': 'octane/signals/server'
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
worker: {
|
|
105
|
+
nativeDocuments: true,
|
|
106
|
+
rsc: false
|
|
107
|
+
},
|
|
108
|
+
lazyStyles: 'document',
|
|
109
|
+
entryClient: {
|
|
110
|
+
declarations: 'declare const __webpack_hash__: string;\n',
|
|
111
|
+
fields: {
|
|
112
|
+
nativeHydrationBuildId: '__webpack_hash__'
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
svgComponentTemplate: ()=>external_node_path_default().join((0, external_compiler_js_namespaceObject.pluginSourceDirectory)(), 'svg-component-template.cjs'),
|
|
116
|
+
compiler: external_compiler_js_namespaceObject.createOctaneCompilerPlugin,
|
|
117
|
+
artifacts: external_manifest_js_namespaceObject.compilerArtifacts,
|
|
118
|
+
assertSupportedSource: external_source_js_namespaceObject.assertOctaneEntrySource,
|
|
119
|
+
create: {
|
|
120
|
+
templates: {
|
|
121
|
+
federation: true,
|
|
122
|
+
workers: false
|
|
123
|
+
},
|
|
124
|
+
dependencies: (profile, { typescriptVersion })=>({
|
|
125
|
+
frameworkDependencies: [
|
|
126
|
+
'@modern-js/renderer-core',
|
|
127
|
+
'@modern-js/renderer-octane'
|
|
128
|
+
],
|
|
129
|
+
dependencies: (0, adapter_namespaceObject.nativeRendererDependencies)(profile),
|
|
130
|
+
devDependencies: {
|
|
131
|
+
[profile.compiler.name]: profile.compiler.version,
|
|
132
|
+
typescript: typescriptVersion
|
|
133
|
+
},
|
|
134
|
+
typecheckCommand: 'octane-tsc --noEmit --project tsconfig.json',
|
|
135
|
+
tsconfig: {
|
|
136
|
+
tsrx: {
|
|
137
|
+
compiler: 'octane/compiler/volar',
|
|
138
|
+
platform: 'web'
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}),
|
|
142
|
+
generateAppSources: external_create_js_namespaceObject.generateOctaneAppSources
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
exports.rendererAdapter = __webpack_exports__.rendererAdapter;
|
|
146
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
147
|
+
"rendererAdapter"
|
|
148
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
149
|
+
Object.defineProperty(exports, '__esModule', {
|
|
150
|
+
value: true
|
|
151
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
const octaneProfile = {
|
|
31
|
+
renderer: 'octane',
|
|
32
|
+
status: 'preview',
|
|
33
|
+
protocolVersion: 1,
|
|
34
|
+
minimumNode: '26.10.0',
|
|
35
|
+
hmr: {
|
|
36
|
+
editedBoundary: 'may-reset',
|
|
37
|
+
unaffectedComponents: 'preserved',
|
|
38
|
+
document: 'preserved',
|
|
39
|
+
roots: 'single',
|
|
40
|
+
cleanup: 'exactly-once'
|
|
41
|
+
},
|
|
42
|
+
compiler: {
|
|
43
|
+
name: '@octanejs/rspack-plugin',
|
|
44
|
+
version: '0.1.55'
|
|
45
|
+
},
|
|
46
|
+
hydration: {
|
|
47
|
+
name: 'octane',
|
|
48
|
+
version: '0.7.1+ultramodern.1331985ea3b0'
|
|
49
|
+
},
|
|
50
|
+
router: {
|
|
51
|
+
name: '@octanejs/tanstack-router',
|
|
52
|
+
version: '0.1.60+ultramodern.0b9f76ee3003',
|
|
53
|
+
coreName: '@tanstack/router-core',
|
|
54
|
+
coreVersion: '1.171.15'
|
|
55
|
+
},
|
|
56
|
+
sourceExtensions: [
|
|
57
|
+
'.tsx',
|
|
58
|
+
'.tsrx',
|
|
59
|
+
'.ts',
|
|
60
|
+
'.js'
|
|
61
|
+
],
|
|
62
|
+
jsxImportSource: 'octane',
|
|
63
|
+
dependencies: {
|
|
64
|
+
octane: 'https://github.com/bleedingdev/octane/releases/download/octane%400.7.1%2Bultramodern.1331985ea3b0/octane-0.7.1%2Bultramodern.1331985ea3b0.tgz',
|
|
65
|
+
'@octanejs/tanstack-router': 'https://github.com/bleedingdev/octane/releases/download/%40octanejs%2Ftanstack-router%400.1.60%2Bultramodern.0b9f76ee3003/octanejs-tanstack-router-0.1.60%2Bultramodern.0b9f76ee3003.tgz',
|
|
66
|
+
'@octanejs/rspack-plugin': '0.1.55',
|
|
67
|
+
'@modern-js/renderer-octane': '3.8.3',
|
|
68
|
+
seroval: '1.6.8',
|
|
69
|
+
'seroval-plugins': '1.6.8'
|
|
70
|
+
},
|
|
71
|
+
capabilities: {
|
|
72
|
+
worker: true,
|
|
73
|
+
moduleFederation: true,
|
|
74
|
+
rsc: false,
|
|
75
|
+
ssg: true,
|
|
76
|
+
i18n: true,
|
|
77
|
+
svgComponent: true
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
81
|
+
octaneProfile: octaneProfile
|
|
82
|
+
});
|
|
83
|
+
exports.octaneProfile = __webpack_exports__.octaneProfile;
|
|
84
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
85
|
+
"octaneProfile"
|
|
86
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
87
|
+
Object.defineProperty(exports, '__esModule', {
|
|
88
|
+
value: true
|
|
89
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
(()=>{
|
|
25
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
26
|
+
})();
|
|
27
|
+
(()=>{
|
|
28
|
+
__webpack_require__.r = (exports1)=>{
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
30
|
+
value: 'Module'
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
33
|
+
value: true
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
var __webpack_exports__ = {};
|
|
38
|
+
__webpack_require__.r(__webpack_exports__);
|
|
39
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
+
assertOctaneEntrySource: ()=>assertOctaneEntrySource
|
|
41
|
+
});
|
|
42
|
+
const promises_namespaceObject = require("node:fs/promises");
|
|
43
|
+
var promises_default = /*#__PURE__*/ __webpack_require__.n(promises_namespaceObject);
|
|
44
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
45
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
46
|
+
const external_profile_js_namespaceObject = require("./profile.js");
|
|
47
|
+
async function assertOctaneEntrySource(source) {
|
|
48
|
+
if (source && '.jsx' === external_node_path_default().extname(source).toLowerCase() && (await promises_default().stat(source)).isFile()) throw new Error(`unsupported-renderer-capability: Octane does not support .jsx source: ${source}. Supported source extensions: ${external_profile_js_namespaceObject.octaneProfile.sourceExtensions.join(', ')}.`);
|
|
49
|
+
}
|
|
50
|
+
exports.assertOctaneEntrySource = __webpack_exports__.assertOctaneEntrySource;
|
|
51
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
52
|
+
"assertOctaneEntrySource"
|
|
53
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
54
|
+
Object.defineProperty(exports, '__esModule', {
|
|
55
|
+
value: true
|
|
56
|
+
});
|