Skip to content

Commit b16430e

Browse files
authored
feat: update docs get started page (#64)
Updates documentation "Get Started" page "Next steps" section. Fixes some code examples in the documentation. Fixes some styling in the documentation. Related to #15
1 parent 27306b0 commit b16430e

File tree

5 files changed

+107
-10
lines changed

5 files changed

+107
-10
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ export default function App() {
6464
Similarly how you would run a script with `node`, use `react-server` to start your app. Magic!
6565

6666
```sh
67-
pnpm exec react-server ./App.tsx --open
67+
pnpm exec react-server ./App.tsx
6868
```
6969

70-
> **Note:** if you don't want to install the `@lazarv/react-server` package and you just want to try out something quickly, you can use `npx` to run the `react-server` CLI. This way, it's not required to install anything else if you use JavaScript. It's enough to have a `.jsx` file with a React Server Component exported as default to run your application. Just run `npx @lazarv/react-server ./App.jsx --open` to start your application in development mode.
70+
> **Note:** if you don't want to install the `@lazarv/react-server` package and you just want to try out something quickly, you can use `npx` to run the `react-server` CLI. This way, it's not required to install anything else if you use JavaScript. It's enough to have a `.jsx` file with a React Server Component exported as default to run your application. Just run `npx @lazarv/react-server ./App.jsx` to start your application in development mode.
7171
7272
#### Build
7373

@@ -116,7 +116,7 @@ Move your entrypoint component from `./App.tsx` to `./app/layout.tsx` and `./app
116116
Just start `react-server` without specifying an entrypoint.
117117

118118
```sh
119-
pnpm exec react-server --open
119+
pnpm exec react-server
120120
```
121121

122122
Read more about file-system based routing at [react-server.dev/router](https://react-server.dev/router).

docs/src/pages/en/(pages)/guide/get-started.mdx

Lines changed: 95 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ order: 0
44
---
55

66
import Link from "../../../../components/Link.jsx";
7+
import Card from "../../../../components/Card.jsx";
8+
import Pill from "../../../../components/Pill.jsx";
79

810
# Get Started
911

@@ -49,9 +51,11 @@ export default function App() {
4951
To start your application in development mode, you can use the `react-server` CLI simply by passing the path to your application entry file. By using the `--open` flag, your application will be opened in your default browser on http://localhost:3000.
5052

5153
```sh
52-
pnpm exec react-server ./App.jsx --open
54+
pnpm exec react-server ./App.jsx
5355
```
5456

57+
> **Note:** if you want to open the application in your default browser, you can use the `--open` flag.
58+
5559
<Link name="build">
5660
## Build
5761
</Link>
@@ -72,10 +76,98 @@ To start your application in production, just use the `start` command. This will
7276
pnpm exec react-server start
7377
```
7478

75-
> **Note:** if you don't want to install the `@lazarv/react-server` package and you just want to try out something quickly, you can use `npx` to run the `react-server` CLI. This way, it's not required to install anything else if you use JavaScript. It's enough to have a `.jsx` file with a React Server Component exported as default to run your application. Just run `npx @lazarv/react-server ./App.jsx --open` to start your application in development mode.
79+
> **Note:** if you don't want to install the `@lazarv/react-server` package and you just want to try out something quickly, you can use `npx` to run the `react-server` CLI. This way, it's not required to install anything else if you use JavaScript. It's enough to have a `.jsx` file with a React Server Component exported as default to run your application. Just run `npx @lazarv/react-server ./App.jsx` to start your application in development mode.
7680
7781
<Link name="next-steps">
7882
## Next steps
7983
</Link>
8084

81-
Now that you have a basic understanding of how to get started with `@lazarv/react-server`, you can learn more about the advanced features in the following sections.
85+
Success! You have now created your first application using `@lazarv/react-server`.
86+
87+
Here are some recommended topics to learn more about. You can read these in any order you would like. You can even leave for now to start building your application and come back when you run into trouble or have a question.
88+
89+
> Don't forget that you can join a discussion on [GitHub Discussions](https://github.com/lazarv/react-server/discussions) if you have any questions or need help.
90+
91+
<div className="my-4 grid grid-cols-1 md:grid-cols-3 gap-4">
92+
<Card>
93+
94+
#### Integrations
95+
96+
##### How to integrate with other libraries
97+
98+
Learn how to integrate with other libraries and how the framework works togetherwith tools like Vite, TypeScript, Tailwind CSS and more.
99+
100+
<Pill href="/integrations">
101+
Learn more
102+
</Pill>
103+
</Card>
104+
105+
<Card>
106+
107+
#### Framework
108+
109+
##### Advanced features
110+
111+
Learn about the advanced features of the framework, like how to access the HTTP request and response objects, how to use caching, or how to build a micro-frontend application.
112+
113+
<Pill href="/framework">
114+
Learn more
115+
</Pill>
116+
</Card>
117+
118+
<Card>
119+
120+
#### Router
121+
122+
##### File-system based router
123+
124+
Learn how to use the file-system based router to create a full-fledged application with nested routes, dynamic routes, and more.
125+
126+
<Pill href="/router">
127+
Learn more
128+
</Pill>
129+
</Card>
130+
</div>
131+
132+
You can also learn more about the framework by reading the following tutorials. These are not required to get started, but they can be helpful to understand some of the concepts and features.
133+
134+
<div className="my-4 grid grid-cols-1 md:grid-cols-3 gap-4">
135+
<Card>
136+
137+
#### Hello World!
138+
139+
##### Your first application
140+
141+
Create a new React application with server-side rendering in just a few steps. Start building your app with React Server Components and enjoy faster initial page loads.
142+
143+
<Pill href="/tutorials/hello-world">
144+
Read tutorial
145+
</Pill>
146+
</Card>
147+
148+
<Card>
149+
150+
#### Todo App
151+
152+
##### Using server actions
153+
154+
Build a simple Todo application with server actions. Learn how to interact with the server from your components and manage server-side operations efficiently.
155+
156+
<Pill href="/tutorials/todo-app">
157+
Read tutorial
158+
</Pill>
159+
</Card>
160+
161+
<Card>
162+
163+
#### Photos
164+
165+
##### Using client components
166+
167+
Learn how to use client components to create interactive elements in your application. Enhance your user experience with client-side rendering and dynamic content updates.
168+
169+
<Pill href="/tutorials/photos">
170+
Read tutorial
171+
</Pill>
172+
</Card>
173+
</div>

docs/src/pages/en/(pages)/router/markdown.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ You can use any Remark or Rehype plugin with the file-system based router. Just
4040

4141
```mjs
4242
import rehypeHighlight from "rehype-highlight";
43+
import rehypeMdxCodeProps from "rehype-mdx-code-props";
4344
import remarkGfm from "remark-gfm";
4445

4546
export default {
@@ -57,14 +58,14 @@ export default {
5758
To use custom components, you have to create an `mdx-components.jsx` or `mdx-components.tsx` file in your project root. This file should export a `useMDXComponents` function that returns an object with the custom components.
5859

5960
```jsx
60-
export function useMDXComponents() {
61+
export default function useMDXComponents() {
6162
return {
6263
h1: (props) => <h1 style={{ color: "red" }} {...props} />,
6364
};
6465
}
6566
```
6667

67-
You can also specify where your file exporting the `useMDXComponents` function is located in your `react-server.config.mjs` file.
68+
You can also specify where your file default exporting the `useMDXComponents` function is located in your `react-server.config.mjs` file.
6869

6970
```mjs
7071
export default {

docs/src/pages/en/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default function App() {
3838
```
3939

4040
```sh
41-
npx @lazarv/react-server ./App.jsx --open
41+
npx @lazarv/react-server ./App.jsx
4242
```
4343

4444
</div>

docs/src/pages/global.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ article {
183183
@apply text-base mb-4 leading-7;
184184
}
185185

186+
& > pre {
187+
@apply w-full;
188+
}
189+
186190
& pre code {
187191
@apply rounded-lg my-8 text-sm leading-5 border border-gray-500 shadow-xl shadow-gray-500 dark:shadow-[rgba(255,255,255,0.1)] dark:shadow-lg;
188192
}
@@ -224,7 +228,7 @@ article {
224228
@apply border-l-8 border-blue-300 p-4 mb-4 bg-blue-100 dark:bg-yellow-500 dark:border-yellow-600 dark:text-gray-800 shadow-xl dark:shadow-[rgba(255,255,255,0.1)];
225229

226230
& code {
227-
@apply bg-gray-100 dark:bg-gray-100 dark:text-gray-800 text-sm p-1;
231+
@apply bg-gray-100 dark:bg-gray-100 dark:text-gray-800 text-sm whitespace-nowrap p-1;
228232
}
229233
}
230234

0 commit comments

Comments
 (0)