@lolyjs/core 0.1.0-alpha.0 → 0.1.0-alpha.1
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/README.md +13 -13
- package/dist/cli.cjs +1 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Loly Framework
|
|
1
|
+
# Loly Framework EXPERIMENTAL
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
@@ -56,8 +56,8 @@ export default function Home() {
|
|
|
56
56
|
|
|
57
57
|
```tsx
|
|
58
58
|
// bootstrap.tsx
|
|
59
|
-
import { bootstrapClient } from "@
|
|
60
|
-
import routes from "@
|
|
59
|
+
import { bootstrapClient } from "@lolyjs/core/runtime";
|
|
60
|
+
import routes from "@lolyjs/core/runtime";
|
|
61
61
|
|
|
62
62
|
bootstrapClient(routes);
|
|
63
63
|
```
|
|
@@ -117,7 +117,7 @@ export const getServerSideProps: ServerLoader = async (ctx) => {
|
|
|
117
117
|
|
|
118
118
|
```tsx
|
|
119
119
|
// app/blog/[slug]/page.tsx
|
|
120
|
-
import { usePageProps } from "@
|
|
120
|
+
import { usePageProps } from "@lolyjs/core/hooks";
|
|
121
121
|
|
|
122
122
|
export default function BlogPost() {
|
|
123
123
|
const { props } = usePageProps();
|
|
@@ -137,7 +137,7 @@ export default function BlogPost() {
|
|
|
137
137
|
Fast page transitions without full reloads:
|
|
138
138
|
|
|
139
139
|
```tsx
|
|
140
|
-
import { Link } from "@
|
|
140
|
+
import { Link } from "@lolyjs/core/components";
|
|
141
141
|
|
|
142
142
|
export default function Navigation() {
|
|
143
143
|
return (
|
|
@@ -154,7 +154,7 @@ export default function Navigation() {
|
|
|
154
154
|
Invalidate and refresh route data:
|
|
155
155
|
|
|
156
156
|
```tsx
|
|
157
|
-
import { revalidatePath, revalidate } from "@
|
|
157
|
+
import { revalidatePath, revalidate } from "@lolyjs/core/client-cache";
|
|
158
158
|
|
|
159
159
|
// Revalidate a specific route
|
|
160
160
|
revalidatePath('/posts');
|
|
@@ -298,7 +298,7 @@ export const getServerSideProps: ServerLoader = async (ctx) => {
|
|
|
298
298
|
### Cache Management
|
|
299
299
|
|
|
300
300
|
```tsx
|
|
301
|
-
import { revalidatePath, revalidate } from "@
|
|
301
|
+
import { revalidatePath, revalidate } from "@lolyjs/core/client-cache";
|
|
302
302
|
|
|
303
303
|
// Revalidate a specific route (removes from cache)
|
|
304
304
|
revalidatePath('/posts');
|
|
@@ -313,7 +313,7 @@ await revalidate();
|
|
|
313
313
|
### Client Hooks
|
|
314
314
|
|
|
315
315
|
```tsx
|
|
316
|
-
import { usePageProps } from "@
|
|
316
|
+
import { usePageProps } from "@lolyjs/core/hooks";
|
|
317
317
|
|
|
318
318
|
export default function Page() {
|
|
319
319
|
const { params, props } = usePageProps();
|
|
@@ -425,7 +425,7 @@ export default function BlogLayout({ children }) {
|
|
|
425
425
|
### Themes
|
|
426
426
|
|
|
427
427
|
```tsx
|
|
428
|
-
import { ThemeProvider } from "@
|
|
428
|
+
import { ThemeProvider } from "@lolyjs/core/themes";
|
|
429
429
|
|
|
430
430
|
export default function RootLayout({ children, theme }) {
|
|
431
431
|
return (
|
|
@@ -575,10 +575,10 @@ import { strictRateLimiter, lenientRateLimiter } from "@loly/core";
|
|
|
575
575
|
import { logger, createModuleLogger, getRequestLogger } from "@loly/core";
|
|
576
576
|
|
|
577
577
|
// Client
|
|
578
|
-
import { Link } from "@
|
|
579
|
-
import { usePageProps } from "@
|
|
580
|
-
import { ThemeProvider } from "@
|
|
581
|
-
import { revalidatePath, revalidate } from "@
|
|
578
|
+
import { Link } from "@lolyjs/core/components";
|
|
579
|
+
import { usePageProps } from "@lolyjs/core/hooks";
|
|
580
|
+
import { ThemeProvider } from "@lolyjs/core/themes";
|
|
581
|
+
import { revalidatePath, revalidate } from "@lolyjs/core/client-cache";
|
|
582
582
|
```
|
|
583
583
|
|
|
584
584
|
---
|
package/dist/cli.cjs
CHANGED
|
@@ -634,7 +634,7 @@ function writeClientBoostrapManifest(projectRoot) {
|
|
|
634
634
|
lines.push(` errorRoute,`);
|
|
635
635
|
lines.push(`} from "./routes-client";`);
|
|
636
636
|
lines.push("");
|
|
637
|
-
lines.push(`import { bootstrapClient } from "@
|
|
637
|
+
lines.push(`import { bootstrapClient } from "@lolyjs/core/runtime"`);
|
|
638
638
|
lines.push("");
|
|
639
639
|
lines.push(
|
|
640
640
|
"bootstrapClient(routes as ClientRouteLoaded[], notFoundRoute, errorRoute);"
|