Skip to content

Commit

Permalink
fix: update example app
Browse files Browse the repository at this point in the history
  • Loading branch information
aheissenberger committed Dec 17, 2024
1 parent 647af57 commit a8af95c
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 2 deletions.
6 changes: 5 additions & 1 deletion examples/hello-world-aws/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ cdk.out
# serverless framework
.serverless
# sst
bundle/*
# this files are generated by sst and should be checked in!
.sst
sst-react-server.ts
sst-react-server.ts
sst-env.d.ts
sst.config.ts
1 change: 1 addition & 0 deletions examples/hello-world-aws/react-server.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"root": "src",
"public": "src/public",
"vite": {
"build": {
"sourcemap": true
Expand Down
19 changes: 19 additions & 0 deletions examples/hello-world-aws/src/about/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Link } from "@lazarv/react-server/navigation";

export default async function AboutPage() {
return (
<div>
<title>About 01</title>
<h1 className="text-4xl font-bold tracking-tight">About</h1>
<img
src="/static/images/image-placeholder.svg"
alt="placeholder"
className="w-24 h-24"
/>
<p>This is placeholder for a Textblock.</p>
<Link to="/" className="mt-4 inline-block underline">
Return home
</Link>
</div>
);
}
1 change: 1 addition & 0 deletions examples/hello-world-aws/src/about/page.static.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default true;
9 changes: 9 additions & 0 deletions examples/hello-world-aws/src/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import "./index.css";

import { Link } from "@lazarv/react-server/navigation";

import Counter from "./Counter";

export default function App() {
Expand All @@ -8,6 +10,13 @@ export default function App() {
<h1>Hello World</h1>
<p>This is a server-rendered React application.</p>
<Counter />
<Link to="/about" prefetch>
About
</Link>{" "}
|{" "}
<Link to="/s/page" prefetch>
Second Page
</Link>
</div>
);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions examples/hello-world-aws/src/s/page/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Link } from "@lazarv/react-server/navigation";

export default async function SecondPage() {
return (
<div>
<title>Second Page</title>
<h1 className="text-4xl font-bold tracking-tight">Second Page</h1>
<img
src="/static/images/image-placeholder.svg"
alt="placegolder"
className="w-24 h-24"
/>
<p>This is placeholder for a Textblock.</p>
<Link to="/" className="mt-4 inline-block underline">
Return home
</Link>
{Array.from({ length: 10001 }).map((_, index) => (
<div key={index} className="content-block">
<h2 className="text-2xl font-semibold">Content Block {index + 1}</h2>
<p>This is content block number {index + 1}!</p>
</div>
))}
</div>
);
}
1 change: 1 addition & 0 deletions examples/hello-world-aws/src/s/page/page.static.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default true;
23 changes: 22 additions & 1 deletion examples/hello-world-aws/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
{}
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"jsx": "preserve",
"strict": true,
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"types": ["react/experimental", "react-dom/experimental"],
"module": "ESNext",
"moduleResolution": "Bundler",
"plugins": [
{
"name": "typescript-plugin-css-modules"
}
],
"baseUrl": "./src",
"paths": {
"@/*": ["./*"]
}
},
"include": ["**/*.ts", "**/*.tsx", ".react-server/**/*.ts"],
"exclude": ["**/*.js", "**/*.mjs"]
}

0 comments on commit a8af95c

Please sign in to comment.