Skip to content

Commit 23b24a5

Browse files
committed
Format all the old docs
1 parent 33197d0 commit 23b24a5

104 files changed

Lines changed: 972 additions & 2631 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODE_OF_CONDUCT.md

Lines changed: 25 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2,127 +2,78 @@
22

33
## Our Pledge
44

5-
We as members, contributors, and leaders pledge to make participation in our
6-
community a harassment-free experience for everyone, regardless of age, body
7-
size, visible or invisible disability, ethnicity, sex characteristics, gender
8-
identity and expression, level of experience, education, socio-economic status,
9-
nationality, personal appearance, race, religion, or sexual identity and
10-
orientation.
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
116

12-
We pledge to act and interact in ways that contribute to an open, welcoming,
13-
diverse, inclusive, and healthy community.
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
148

159
## Our Standards
1610

17-
Examples of behavior that contributes to a positive environment for our
18-
community include:
11+
Examples of behavior that contributes to a positive environment for our community include:
1912

2013
- Demonstrating empathy and kindness toward other people
2114
- Being respectful of differing opinions, viewpoints, and experiences
2215
- Giving and gracefully accepting constructive feedback
23-
- Accepting responsibility and apologizing to those affected by our mistakes,
24-
and learning from the experience
25-
- Focusing on what is best not just for us as individuals, but for the overall
26-
community
16+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17+
- Focusing on what is best not just for us as individuals, but for the overall community
2718

2819
Examples of unacceptable behavior include:
2920

30-
- The use of sexualized language or imagery, and sexual attention or advances of
31-
any kind
21+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
3222
- Trolling, insulting or derogatory comments, and personal or political attacks
3323
- Public or private harassment
34-
- Publishing others' private information, such as a physical or email address,
35-
without their explicit permission
36-
- Other conduct which could reasonably be considered inappropriate in a
37-
professional setting
24+
- Publishing others' private information, such as a physical or email address, without their explicit permission
25+
- Other conduct which could reasonably be considered inappropriate in a professional setting
3826

3927
## Enforcement Responsibilities
4028

41-
Community leaders are responsible for clarifying and enforcing our standards of
42-
acceptable behavior and will take appropriate and fair corrective action in
43-
response to any behavior that they deem inappropriate, threatening, offensive,
44-
or harmful.
29+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
4530

46-
Community leaders have the right and responsibility to remove, edit, or reject
47-
comments, commits, code, wiki edits, issues, and other contributions that are
48-
not aligned to this Code of Conduct, and will communicate reasons for moderation
49-
decisions when appropriate.
31+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
5032

5133
## Scope
5234

53-
This Code of Conduct applies within all community spaces, and also applies when
54-
an individual is officially representing the community in public spaces.
55-
Examples of representing our community include using an official e-mail address,
56-
posting via an official social media account, or acting as an appointed
57-
representative at an online or offline event.
35+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
5836

5937
## Enforcement
6038

61-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62-
reported to the community leaders responsible for enforcement at hello@lcas.dev.
63-
All complaints will be reviewed and investigated promptly and fairly.
39+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at hello@lcas.dev. All complaints will be reviewed and investigated promptly and fairly.
6440

65-
All community leaders are obligated to respect the privacy and security of the
66-
reporter of any incident.
41+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
6742

6843
## Enforcement Guidelines
6944

70-
Community leaders will follow these Community Impact Guidelines in determining
71-
the consequences for any action they deem in violation of this Code of Conduct:
45+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
7246

7347
### 1. Correction
7448

75-
**Community Impact**: Use of inappropriate language or other behavior deemed
76-
unprofessional or unwelcome in the community.
49+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
7750

78-
**Consequence**: A private, written warning from community leaders, providing
79-
clarity around the nature of the violation and an explanation of why the
80-
behavior was inappropriate. A public apology may be requested.
51+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
8152

8253
### 2. Warning
8354

84-
**Community Impact**: A violation through a single incident or series of
85-
actions.
55+
**Community Impact**: A violation through a single incident or series of actions.
8656

87-
**Consequence**: A warning with consequences for continued behavior. No
88-
interaction with the people involved, including unsolicited interaction with
89-
those enforcing the Code of Conduct, for a specified period of time. This
90-
includes avoiding interactions in community spaces as well as external channels
91-
like social media. Violating these terms may lead to a temporary or permanent
92-
ban.
57+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
9358

9459
### 3. Temporary Ban
9560

96-
**Community Impact**: A serious violation of community standards, including
97-
sustained inappropriate behavior.
61+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
9862

99-
**Consequence**: A temporary ban from any sort of interaction or public
100-
communication with the community for a specified period of time. No public or
101-
private interaction with the people involved, including unsolicited interaction
102-
with those enforcing the Code of Conduct, is allowed during this period.
103-
Violating these terms may lead to a permanent ban.
63+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
10464

10565
### 4. Permanent Ban
10666

107-
**Community Impact**: Demonstrating a pattern of violation of community
108-
standards, including sustained inappropriate behavior, harassment of an
109-
individual, or aggression toward or disparagement of classes of individuals.
67+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
11068

111-
**Consequence**: A permanent ban from any sort of public interaction within the
112-
community.
69+
**Consequence**: A permanent ban from any sort of public interaction within the community.
11370

11471
## Attribution
11572

116-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
117-
version 2.0, available at
118-
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
73+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
11974

120-
Community Impact Guidelines were inspired by
121-
[Mozilla's code of conduct
122-
enforcement ladder](https://github.com/mozilla/diversity).
75+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
12376

12477
[homepage]: https://www.contributor-covenant.org
12578

126-
For answers to common questions about this code of conduct, see the FAQ at
127-
https://www.contributor-covenant.org/faq. Translations are available at
128-
https://www.contributor-covenant.org/translations.
79+
For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

www/docs/1.x/concepts/ahead-of-time-builds.md

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,11 @@ description: |
33
Fresh optimize assets ahead of time, which makes pages load way quicker.
44
---
55

6-
Fresh enables you to pre-optimize frontend assets before the code is deployed.
7-
During that process the code for Islands will be compressed and optimized, so
8-
that Fresh can send as little code as possible to the browser. Depending on the
9-
amount of code an island needs, this process can take several seconds if done on
10-
the fly server-side.
6+
Fresh enables you to pre-optimize frontend assets before the code is deployed. During that process the code for Islands will be compressed and optimized, so that Fresh can send as little code as possible to the browser. Depending on the amount of code an island needs, this process can take several seconds if done on the fly server-side.
117

12-
Doing those optimizations ahead-of-time and deploying the already optimized
13-
assets alongside with your code, allows Fresh to treat them as like any other
14-
static file and can serve it immediately without any further processing. On
15-
pages with islands, having to do no processing greatly speeds up page load
16-
times.
8+
Doing those optimizations ahead-of-time and deploying the already optimized assets alongside with your code, allows Fresh to treat them as like any other static file and can serve it immediately without any further processing. On pages with islands, having to do no processing greatly speeds up page load times.
179

18-
Plugins can build static assets during ahead-of-time builds. This can be used to
19-
pre-process or generate CSS files, for example.
10+
Plugins can build static assets during ahead-of-time builds. This can be used to pre-process or generate CSS files, for example.
2011

2112
## Creating an optimized build
2213

@@ -29,17 +20,11 @@ deno task build
2920
deno run -A dev.ts build
3021
```
3122

32-
This will create a `_fresh` folder in the project directory. That folder
33-
contains the optimized assets and a `snapshot.json` file which includes some
34-
metadata for Fresh.
23+
This will create a `_fresh` folder in the project directory. That folder contains the optimized assets and a `snapshot.json` file which includes some metadata for Fresh.
3524

36-
Any other static files generated by plugins will be stored in the
37-
`_fresh/static` subfolder. They will be served the same as other
38-
[static files](/docs/1.x/concepts/static-files.md).
25+
Any other static files generated by plugins will be stored in the `_fresh/static` subfolder. They will be served the same as other [static files](/docs/1.x/concepts/static-files.md).
3926

40-
> [info]: The `_fresh` folder should not be committed to the repository. Add an
41-
> entry in the `.gitignore` file to ensure that it is not committed. Create that
42-
> file at the root of your git repository if not present.
27+
> [info]: The `_fresh` folder should not be committed to the repository. Add an entry in the `.gitignore` file to ensure that it is not committed. Create that file at the root of your git repository if not present.
4328
>
4429
> ```gitignore .gitignore
4530
> # Ignore fresh build directory
@@ -48,29 +33,21 @@ Any other static files generated by plugins will be stored in the
4833
4934
## Running Fresh with optimized assets
5035
51-
When Fresh is started in non-development mode (usually via `main.ts`), Fresh
52-
will automatically pick up optimized assets when a `_fresh` folder exists. If
53-
found, Fresh will print the following message to the terminal:
36+
When Fresh is started in non-development mode (usually via `main.ts`), Fresh will automatically pick up optimized assets when a `_fresh` folder exists. If found, Fresh will print the following message to the terminal:
5437
5538
```sh Terminal output
5639
Using snapshot found at /path/to/project/_fresh
5740
```
5841
5942
## Deploying an optimized Fresh project
6043

61-
If you are deploying a Fresh project to Deno Deploy, you can use ahead-of-time
62-
builds to optimize the assets before deploying them. This will make your
63-
application load quicker.
44+
If you are deploying a Fresh project to Deno Deploy, you can use ahead-of-time builds to optimize the assets before deploying them. This will make your application load quicker.
6445

65-
Open the Deno Deploy dashboard for your project and head to the "Git
66-
Integration" section in the project settings. Enter `deno task build` in the
67-
"Build command" field and save. This will switch your Deno Deploy project to use
68-
ahead-of-time builds.
46+
Open the Deno Deploy dashboard for your project and head to the "Git Integration" section in the project settings. Enter `deno task build` in the "Build command" field and save. This will switch your Deno Deploy project to use ahead-of-time builds.
6947

7048
## Migrating existing projects with Plugins
7149

72-
If you're using Fresh plugins, extract them into a `fresh.config.ts` file, so
73-
that both the `dev.ts` and `main.ts` script have access to them.
50+
If you're using Fresh plugins, extract them into a `fresh.config.ts` file, so that both the `dev.ts` and `main.ts` script have access to them.
7451

7552
```ts fresh.config.ts
7653
import { defineConfig } from "$fresh/server.ts";

www/docs/1.x/concepts/app-wrapper.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,9 @@ description: |
33
Add a global app wrapper to provide common meta tags or context for application routes.
44
---
55

6-
An app wrapper is defined in an `_app.tsx` file in `routes/` folder and is
7-
typically used to create the outer structure of an HTML document. It must
8-
contain a default export that is a regular Preact component. Only one such
9-
wrapper is allowed per application.
6+
An app wrapper is defined in an `_app.tsx` file in `routes/` folder and is typically used to create the outer structure of an HTML document. It must contain a default export that is a regular Preact component. Only one such wrapper is allowed per application.
107

11-
The component to be wrapped is received via props, in addition to a few other
12-
things. This allows for the introduction of a global container functioning as a
13-
template which can be conditioned based on state and params. Note that any state
14-
set by middleware is available via `props.state`.
8+
The component to be wrapped is received via props, in addition to a few other things. This allows for the introduction of a global container functioning as a template which can be conditioned based on state and params. Note that any state set by middleware is available via `props.state`.
159

1610
```tsx routes/_app.tsx
1711
import { PageProps } from "$fresh/server.ts";
@@ -35,9 +29,7 @@ export default function App({ Component, state }: PageProps) {
3529

3630
## Async app wrapper
3731

38-
Similar to routes and layouts, the app wrapper can be made asynchronous. This
39-
changes the function signature so that the first argument is the `Request`
40-
instance and the second one is the `FreshContext`.
32+
Similar to routes and layouts, the app wrapper can be made asynchronous. This changes the function signature so that the first argument is the `Request` instance and the second one is the `FreshContext`.
4133

4234
```tsx routes/_app.tsx
4335
import { FreshContext } from "$fresh/server.ts";
@@ -63,8 +55,7 @@ export default async function App(req: Request, ctx: FreshContext) {
6355

6456
### Define helper
6557

66-
To make it quicker to type the async app wrapper, Fresh includes a `defineApp`
67-
helper which already infers the correct types for you.
58+
To make it quicker to type the async app wrapper, Fresh includes a `defineApp` helper which already infers the correct types for you.
6859

6960
```tsx routes/_app.tsx
7061
import { defineApp } from "$fresh/server.ts";
@@ -90,8 +81,7 @@ export default defineApp(async (req, ctx) => {
9081

9182
## Disabling the app wrapper
9283

93-
Rendering the app wrapper can be skipped on a route or layout basis. To do that,
94-
set `skipAppWrapper: true` to the layout or route config.
84+
Rendering the app wrapper can be skipped on a route or layout basis. To do that, set `skipAppWrapper: true` to the layout or route config.
9585

9686
```tsx routes/my-special-route.tsx
9787
import { RouteConfig } from "$fresh/server.ts";

www/docs/1.x/concepts/architecture.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,13 @@ description: |
33
Fresh's architecture is designed to make it easy to build fast, scalable, and reliable applications.
44
---
55

6-
Fresh is designed to make it easy to build fast, scalable, and reliable
7-
applications. To do this, it makes opinionated decisions about how one should
8-
build web applications. These decisions are backed by strong empirical data
9-
gathered from experts in the field. Some examples of these principles are:
6+
Fresh is designed to make it easy to build fast, scalable, and reliable applications. To do this, it makes opinionated decisions about how one should build web applications. These decisions are backed by strong empirical data gathered from experts in the field. Some examples of these principles are:
107

118
- Page load times should be reduced to a minimum.
129
- The work performed on the client should be minimized.
1310
- Errors should have a small blast radius - stuff should gracefully degrade.
1411

15-
The single biggest architecture decision that Fresh makes is its usage of the
16-
[islands architecture][islands] pattern. This means that Fresh applications ship
17-
pure HTML to the client by default. Parts of a server-rendered page can then be
18-
independently re-hydrated with interactive widgets (islands). This means that
19-
the client is only responsible for rendering parts of the page that are
20-
interactive enough to warrant the extra effort. Any content that is purely
21-
static does not have related client-side JavaScript and is thus very
22-
lightweight.
12+
The single biggest architecture decision that Fresh makes is its usage of the [islands architecture][islands] pattern. This means that Fresh applications ship pure HTML to the client by default. Parts of a server-rendered page can then be independently re-hydrated with interactive widgets (islands). This means that the client is only responsible for rendering parts of the page that are interactive enough to warrant the extra effort. Any content that is purely static does not have related client-side JavaScript and is thus very lightweight.
2313

2414
<!-- TODO(lucacasonato): elaborate on request handling, form actions, etc. -->
2515

0 commit comments

Comments
 (0)