@absolutejs/absolute 0.19.0-beta.847 → 0.19.0-beta.849
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/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +83 -42
- package/dist/angular/index.js.map +6 -5
- package/dist/angular/server.js +83 -42
- package/dist/angular/server.js.map +6 -5
- package/dist/build.js +250 -201
- package/dist/build.js.map +12 -11
- package/dist/index.js +266 -217
- package/dist/index.js.map +12 -11
- package/dist/islands/index.js +35 -5
- package/dist/islands/index.js.map +3 -3
- package/dist/react/browser.js +11 -1
- package/dist/react/browser.js.map +4 -3
- package/dist/react/index.js +45 -5
- package/dist/react/index.js.map +5 -4
- package/dist/src/build/compileEmber.d.ts +1 -1
- package/dist/src/react/UniversalRouter.d.ts +39 -0
- package/dist/src/react/browser.d.ts +2 -0
- package/dist/src/react/index.d.ts +2 -0
- package/dist/src/utils/generatedDir.d.ts +3 -0
- package/dist/src/vue/browser.d.ts +2 -2
- package/dist/src/vue/defineVuePage.d.ts +12 -1
- package/dist/src/vue/index.d.ts +2 -2
- package/dist/svelte/index.js +35 -5
- package/dist/svelte/index.js.map +3 -3
- package/dist/svelte/server.js +35 -5
- package/dist/svelte/server.js.map +3 -3
- package/dist/types/vue.d.ts +15 -0
- package/dist/vue/browser.js +3 -1
- package/dist/vue/browser.js.map +3 -3
- package/dist/vue/index.js +37 -5
- package/dist/vue/index.js.map +4 -4
- package/package.json +1 -1
|
@@ -37,7 +37,7 @@ export declare const compileEmberFileSource: (entry: string) => Promise<string>;
|
|
|
37
37
|
* lives in `compileEmber` itself, not in a separate cache layer.
|
|
38
38
|
*/
|
|
39
39
|
export declare const clearEmberCompilerCache: () => void;
|
|
40
|
-
export declare const getEmberCompiledRoot: (
|
|
40
|
+
export declare const getEmberCompiledRoot: (_emberDir?: string) => string;
|
|
41
41
|
export declare const getEmberServerCompiledDir: (emberDir: string) => string;
|
|
42
42
|
export declare const getEmberClientCompiledDir: (emberDir: string) => string;
|
|
43
43
|
export { dirname, basename };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type UniversalRouterProps = {
|
|
3
|
+
/** The request URL to seed `<StaticRouter>` with on the server. Pages
|
|
4
|
+
* typically forward `props.url` (auto-injected by handleReactPageRequest
|
|
5
|
+
* from `request.url`). Ignored in the browser, where `<BrowserRouter>`
|
|
6
|
+
* reads `window.location` directly. Defaults to '/'. */
|
|
7
|
+
url?: string;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/** SSR-safe wrapper around react-router that picks `<StaticRouter>` on the
|
|
11
|
+
* server and `<BrowserRouter>` in the browser. Without it, every SPA page
|
|
12
|
+
* has to write its own `typeof window === 'undefined'` branch and import
|
|
13
|
+
* both routers — boilerplate that's the same in every page.
|
|
14
|
+
*
|
|
15
|
+
* Usage:
|
|
16
|
+
*
|
|
17
|
+
* export const MySpa = ({ url }: { url?: string }) => (
|
|
18
|
+
* <html>
|
|
19
|
+
* <Head />
|
|
20
|
+
* <body>
|
|
21
|
+
* <UniversalRouter url={url}>
|
|
22
|
+
* <Routes>
|
|
23
|
+
* <Route path="/foo" element={<Foo />} />
|
|
24
|
+
* </Routes>
|
|
25
|
+
* </UniversalRouter>
|
|
26
|
+
* </body>
|
|
27
|
+
* </html>
|
|
28
|
+
* );
|
|
29
|
+
*
|
|
30
|
+
* Implementation note: `<BrowserRouter>` reads `window.history` at
|
|
31
|
+
* construction, so it throws if instantiated on the server. The
|
|
32
|
+
* `typeof window` check has to live at render time (not import time)
|
|
33
|
+
* because the module is loaded in both environments — only the
|
|
34
|
+
* unselected branch's JSX is what the check skips. */
|
|
35
|
+
export declare const UniversalRouter: ({ url, children }: UniversalRouterProps) => import("react").CElement<{}, import("react").Component<{}, any, any>> | import("react").CElement<{
|
|
36
|
+
location: string;
|
|
37
|
+
}, import("react").Component<{
|
|
38
|
+
location: string;
|
|
39
|
+
}, any, any>>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { Island } from './Island.browser';
|
|
2
2
|
export { createTypedIsland } from './createIsland.browser';
|
|
3
|
+
export { UniversalRouter } from './UniversalRouter';
|
|
4
|
+
export type { UniversalRouterProps } from './UniversalRouter';
|
|
3
5
|
export { useIslandStore } from './hooks/useIslandStore';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { handleReactPageRequest } from './pageHandler';
|
|
2
2
|
export { Island } from './Island';
|
|
3
3
|
export { createTypedIsland } from './createIsland';
|
|
4
|
+
export { UniversalRouter } from './UniversalRouter';
|
|
5
|
+
export type { UniversalRouterProps } from './UniversalRouter';
|
|
4
6
|
export { useIslandStore } from './hooks/useIslandStore';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Island } from './Island.browser';
|
|
2
2
|
export { createTypedIsland } from './createIsland.browser';
|
|
3
3
|
export { useIslandStore } from './useIslandStore';
|
|
4
|
-
export { defineVueSetupApp } from './defineVuePage';
|
|
5
|
-
export type { VueAutoRouter, VueSetupApp, VueSetupAppContext } from '../../types/vue';
|
|
4
|
+
export { defineRoutes, defineVueSetupApp } from './defineVuePage';
|
|
5
|
+
export type { VueAutoRouter, VueRouteRecord, VueRoutes, VueSetupApp, VueSetupAppContext } from '../../types/vue';
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
import type { VueSetupApp } from '../../types/vue';
|
|
1
|
+
import type { VueRoutes, VueSetupApp } from '../../types/vue';
|
|
2
2
|
/** Identity helper that types a Vue page's `setupApp` export without
|
|
3
3
|
* forcing the user to `import type { VueSetupApp }` every time. Use as
|
|
4
4
|
* `export const setupApp = defineVueSetupApp(async (app, ctx) => { ... });` */
|
|
5
5
|
export declare const defineVueSetupApp: (hook: VueSetupApp) => VueSetupApp;
|
|
6
|
+
/** Identity helper that signals — to humans and to TypeScript — that a
|
|
7
|
+
* Vue page's `routes` export is the input to AbsoluteJS's auto-generated
|
|
8
|
+
* vue-router. Without this, `export const routes = [...]` reads as an
|
|
9
|
+
* ordinary const that nobody references locally; the import + call make
|
|
10
|
+
* the contract explicit (mirroring Vue's `defineProps` convention).
|
|
11
|
+
*
|
|
12
|
+
* At runtime this is identity (`(routes) => routes`); the actual
|
|
13
|
+
* router-creation code lives in the compile-time transform applied to
|
|
14
|
+
* the page's `<script>` block. Use as
|
|
15
|
+
* `export const routes = defineRoutes([{ path: '/foo', component: Foo }]);` */
|
|
16
|
+
export declare const defineRoutes: <T extends VueRoutes>(routes: T) => T;
|
package/dist/src/vue/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { handleVuePageRequest } from './pageHandler';
|
|
2
2
|
export { applyVueRouterRedirect } from './routerRedirectProviders';
|
|
3
|
-
export { defineVueSetupApp } from './defineVuePage';
|
|
4
|
-
export type { VueAutoRouter, VueSetupApp, VueSetupAppContext } from '../../types/vue';
|
|
3
|
+
export { defineRoutes, defineVueSetupApp } from './defineVuePage';
|
|
4
|
+
export type { VueAutoRouter, VueRouteRecord, VueRoutes, VueSetupApp, VueSetupAppContext } from '../../types/vue';
|
|
5
5
|
export { Island } from './Island';
|
|
6
6
|
export { createTypedIsland } from './createIsland';
|
|
7
7
|
export { useIslandStore } from './useIslandStore';
|
package/dist/svelte/index.js
CHANGED
|
@@ -749,12 +749,42 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
749
749
|
code: await compileStyleSource(path, content, language, config)
|
|
750
750
|
};
|
|
751
751
|
}
|
|
752
|
-
}),
|
|
752
|
+
}), CSS_IMPORT_PATTERN, resolveCssImportsAsync = async (content, baseDir, visited) => {
|
|
753
|
+
const matches = Array.from(content.matchAll(CSS_IMPORT_PATTERN));
|
|
754
|
+
if (matches.length === 0)
|
|
755
|
+
return content;
|
|
756
|
+
let cursor = 0;
|
|
757
|
+
const parts = [];
|
|
758
|
+
for (const match of matches) {
|
|
759
|
+
const importPath = match[1];
|
|
760
|
+
if (importPath === undefined)
|
|
761
|
+
continue;
|
|
762
|
+
const start = match.index ?? 0;
|
|
763
|
+
const end = start + match[0].length;
|
|
764
|
+
parts.push(content.slice(cursor, start));
|
|
765
|
+
const fullPath = isAbsolute(importPath) ? importPath : resolve2(baseDir, importPath);
|
|
766
|
+
if (visited.has(fullPath) || !existsSync2(fullPath)) {
|
|
767
|
+
parts.push(visited.has(fullPath) ? "" : match[0]);
|
|
768
|
+
cursor = end;
|
|
769
|
+
continue;
|
|
770
|
+
}
|
|
771
|
+
const nextVisited = new Set(visited);
|
|
772
|
+
nextVisited.add(fullPath);
|
|
773
|
+
const imported = await readFile(fullPath, "utf-8");
|
|
774
|
+
parts.push(await resolveCssImportsAsync(imported, dirname(fullPath), nextVisited));
|
|
775
|
+
cursor = end;
|
|
776
|
+
}
|
|
777
|
+
parts.push(content.slice(cursor));
|
|
778
|
+
return parts.join("");
|
|
779
|
+
}, compileStyleFileIfNeeded = async (filePath, config) => {
|
|
753
780
|
if (!isPreprocessableStylePath(filePath)) {
|
|
754
|
-
|
|
781
|
+
const raw = await readFile(filePath, "utf-8");
|
|
782
|
+
const processed = await runPostcss(raw, filePath, config);
|
|
783
|
+
return resolveCssImportsAsync(processed, dirname(filePath), new Set([filePath]));
|
|
755
784
|
}
|
|
756
|
-
|
|
757
|
-
|
|
785
|
+
const compiled = await compileStyleSource(filePath, undefined, undefined, config);
|
|
786
|
+
return resolveCssImportsAsync(compiled, dirname(filePath), new Set([filePath]));
|
|
787
|
+
}, resolveCssImportsSync = (content, baseDir, visited) => {
|
|
758
788
|
return content.replace(CSS_IMPORT_PATTERN, (match, importPath) => {
|
|
759
789
|
const fullPath = isAbsolute(importPath) ? importPath : resolve2(baseDir, importPath);
|
|
760
790
|
if (visited.has(fullPath))
|
|
@@ -3786,5 +3816,5 @@ export {
|
|
|
3786
3816
|
createTypedIsland
|
|
3787
3817
|
};
|
|
3788
3818
|
|
|
3789
|
-
//# debugId=
|
|
3819
|
+
//# debugId=56694EE8B35B170664756E2164756E21
|
|
3790
3820
|
//# sourceMappingURL=index.js.map
|