You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/at-glance.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,11 @@ head:
7
7
8
8
- - meta
9
9
- name: 'description'
10
-
content: Designed with ergonomic design, extensive support for TypeScript, modern JavaScript API, optimized for Bun. Offers a unique experience unified type, and end-to-end type safety while maintaining excellent performance.
10
+
content: Designed with ergonomic design, extensive support for TypeScript, modern JavaScript API, optimized for Bun. Offers a unique experience with unified types, and end-to-end type safety while maintaining excellent performance.
11
11
12
12
- - meta
13
13
- property: 'og:description'
14
-
content: Designed with ergonomic design, extensive support for TypeScript, modern JavaScript API, optimized for Bun. Offers a unique experience unified type, and end-to-end type safety while maintaining excellent performance.
14
+
content: Designed with ergonomic design, extensive support for TypeScript, modern JavaScript API, optimized for Bun. Offers a unique experience with unified types, and end-to-end type safety while maintaining excellent performance.
Copy file name to clipboardExpand all lines: docs/blog/elysia-10.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ head:
45
45
46
46
Elysia 1.0 is the first stable release after development for 1.8 years.
47
47
48
-
Since started, we have always waiting for a framework that focuses on developer experience, velocity, and how to make writing code for humans, not a machine.
48
+
Since we started, we have always been waiting for a framework that focuses on developer experience, velocity, and how to make writing code for humans, not a machine.
49
49
50
50
We battle-test Elysia in various situations, simulate medium and large-scale projects, shipping code to clients and this is the first version that we felt confident enough to ship.
Elysia OpenTelemetry is will **collect span of any library compatible OpenTelemetry standard**, and will apply parent and child span automatically.
92
+
Elysia OpenTelemetry will **collect span of any library compatible with the OpenTelemetry standard**, and will apply parent and child span automatically.
93
93
94
94
In the code above, we apply `Prisma` to trace how long each query took.
Copy file name to clipboardExpand all lines: docs/blog/elysia-12.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,11 @@ head:
10
10
11
11
- - meta
12
12
- name: 'description'
13
-
content: Introducing Adapter for universal runtime suppport, Object macro with resolve, Parser with custom name, WebSocket with lifecycle, TypeBox 0.34 with recursive type, and Eden validation inference.
13
+
content: Introducing Adapter for universal runtime support, Object macro with resolve, Parser with custom name, WebSocket with lifecycle, TypeBox 0.34 with recursive type, and Eden validation inference.
14
14
15
15
- - meta
16
16
- property: 'og:description'
17
-
content: Introducing Adapter for universal runtime suppport, Object macro with resolve, Parser with custom name, WebSocket with lifecycle, TypeBox 0.34 with recursive type, and Eden validation inference.
17
+
content: Introducing Adapter for universal runtime support, Object macro with resolve, Parser with custom name, WebSocket with lifecycle, TypeBox 0.34 with recursive type, and Eden validation inference.
18
18
19
19
- - meta
20
20
- property: 'og:image'
@@ -38,9 +38,9 @@ head:
38
38
shadow
39
39
>
40
40
41
-
Named after the song [Φ²](https://youtu.be/b9IkzWO63Fg) from album "At the Fingertip of the Sea" by HoyoMix as used in as in [**"You and Me"**](https://youtu.be/nz_Ra4G57A4).
41
+
Named after the song [Φ²](https://youtu.be/b9IkzWO63Fg) from album "At the Fingertip of the Sea" by HoyoMix as used in [**"You and Me"**](https://youtu.be/nz_Ra4G57A4).
42
42
43
-
Elysia 1.2 focus on commitment to expand universal runtime support and developer experience:
43
+
Elysia 1.2 focuses on commitment to expand universal runtime support and developer experience:
44
44
-[Adapter](#adapter)
45
45
-[Macro with resolve](#macro-with-resolve)
46
46
-[Parser](#parser)
@@ -92,7 +92,7 @@ We will continue to expand support for more runtimes in the future starting with
92
92
- uWebSocket.js
93
93
94
94
### Universal runtime API
95
-
To be comaptible with different runtime, Elysia now wrap over a hand-picked utility function to provide a consistent API across different runtime.
95
+
To be compatible with different runtime, Elysia now wraps over a hand-picked utility function to provide a consistent API across different runtime.
96
96
97
97
For example, in Bun you may use `Bun.file` to return a file response which is not available in Node.
Copy file name to clipboardExpand all lines: docs/blog/elysia-13.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,7 +102,7 @@ When comparing to the same code **without schema**, we see < 2% performance diff
102
102
103
103
This is huge.
104
104
105
-
Previously, you have to choose between safety and performance but as we close the performance gap between using and not using validation. But now you don't have to worry about it.
105
+
Previously, you had to choose between safety and performance as we close the performance gap between using and not using validation. But now you don't have to worry about it.
106
106
107
107
But now, we drop validation overhead from a significant amount to almost near zero without requiring any changes on your side.
108
108
@@ -150,13 +150,13 @@ We can then override a public schema by providing a schema in a route handler wh
150
150

151
151
> Elysia run with default override guard
152
152
153
-
But sometime we **don't want to override** a schema.
153
+
But sometimes we **don't want to override** a schema.
154
154
155
155
Instead we want it to work both allowing us to combine schemas instead of overriding them.
156
156
157
157
Starting from Elysia 1.3, we can do just that.
158
158
159
-
We can now tell Elysia to not to override it and instead treat it as its own by providing a schema as **standalone**.
159
+
We can now tell Elysia not to override it and instead treat it as its own by providing a schema as **standalone**.
160
160
161
161
```ts
162
162
import { Elysia } from'elysia'
@@ -170,7 +170,7 @@ new Elysia()
170
170
})
171
171
```
172
172
173
-
As a result, we have a results that like merging a local and global schema together.
173
+
As a result, we have results that are like merging a local and global schema together.
174
174
175
175

176
176
> Elysia run with standalone merging multiple guard together
@@ -181,7 +181,7 @@ Elysia's type inference is already extremely fast.
181
181
182
182
We are really confident in our optimization of type inference and it's faster than most frameworks that use an express-like syntax.
183
183
184
-
However, our users with really **really** large scale with multiple routes and complex type inference.
184
+
However, our users with really **really** large scale applications with multiple routes and complex type inference.
185
185
186
186
We managed to **reduce type instantiation by half** in most cases, and measured up to 60% improvement in inference speed.
187
187
@@ -195,7 +195,7 @@ This should solve the problem with users who use heavy object/class for example
195
195
As a result, we should end up with faster IDE auto-completion, suggestion, type checking and Eden Treaty.
196
196
197
197
## Performance Improvement
198
-
We have refactored and optimized a lot of internal code which accumulate up to significant improvements.
198
+
We have refactored and optimized a lot of internal code which accumulates up to significant improvements.
Copy file name to clipboardExpand all lines: docs/eden/overview.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,11 @@ head:
7
7
8
8
- - meta
9
9
- name: 'description'
10
-
content: Elysia supports end-to-end type safety with Elysia Eden since start. End-to-end type-safety refers to a system in which every component of the system is checked for type consistency, meaning that data is passed between components only if the types of the data are compatible.
10
+
content: Elysia supports end-to-end type safety with Elysia Eden from the start. End-to-end type-safety refers to a system in which every component of the system is checked for type consistency, meaning that data is passed between components only if the types of the data are compatible.
11
11
12
12
- - meta
13
13
- property: 'og:description'
14
-
content: Elysia supports end-to-end type safety with Elysia Eden since start. End-to-end type-safety refers to a system in which every component of the system is checked for type consistency, meaning that data is passed between components only if the types of the data are compatible.
14
+
content: Elysia supports end-to-end type safety with Elysia Eden from the start. End-to-end type-safety refers to a system in which every component of the system is checked for type consistency, meaning that data is passed between components only if the types of the data are compatible.
15
15
---
16
16
17
17
# End-to-End Type Safety
@@ -23,14 +23,14 @@ End-to-end type safety is like making sure all the pieces of the track match up
23
23
24
24
For a framework to have end-to-end type safety means you can connect client and server in a type-safe manner.
25
25
26
-
Elysia provide end-to-end type safety **without code generation** out of the box with RPC-like connector, **Eden**
26
+
Elysia provides end-to-end type safety **without code generation** out of the box with an RPC-like connector, **Eden**
@@ -52,20 +52,20 @@ Hover over variable and function to see type definition.
52
52
Elysia allows you to change the type on the server and it will be instantly reflected on the client, helping with auto-completion and type-enforcement.
53
53
54
54
## Eden
55
-
Eden is a RPC-like client to connect Elysia **end-to-end type safety** using only TypeScript's type inference instead of code generation.
55
+
Eden is an RPC-like client to connect Elysia with**end-to-end type safety** using only TypeScript's type inference instead of code generation.
56
56
57
-
Allowing you to sync client and server types effortlessly, weighing less than 2KB.
57
+
It allows you to sync client and server types effortlessly, weighing less than 2KB.
58
58
59
59
Eden consists of 2 modules:
60
60
1. Eden Treaty **(recommended)**: an improved version RFC version of Eden Treaty
61
-
2. Eden Fetch: Fetch-like client with type safety.
61
+
2. Eden Fetch: Fetch-like client with type safety
62
62
63
63
Below is an overview, use-case and comparison for each module.
64
64
65
65
## Eden Treaty (Recommended)
66
66
Eden Treaty is an object-like representation of an Elysia server providing end-to-end type safety and a significantly improved developer experience.
67
67
68
-
With Eden Treaty we can connect interact Elysia server with full-type support and auto-completion, error handling with type narrowing, and creating typesafe unit test.
68
+
With Eden Treaty we can interact with an Elysia server with full-type support and auto-completion, error handling with type narrowing, and create type-safe unit tests.
Copy file name to clipboardExpand all lines: docs/eden/treaty/response.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,11 @@ head:
7
7
8
8
- - meta
9
9
- name: 'og:description'
10
-
content: Eden Treaty is an object-like representation of an Elysia server, providing an end-to-end type safety, and a significantly improved developer experience. With Eden, we can fetch an API from Elysia server fully type-safe without code generation.
10
+
content: Eden Treaty is an object-like representation of an Elysia server, providing end-to-end type safety and a significantly improved developer experience. With Eden, we can fetch an API from Elysia server fully type-safe without code generation.
11
11
12
12
- - meta
13
13
- name: 'og:description'
14
-
content: Eden Treaty is an object-like representation of an Elysia server, providing an end-to-end type safety, and a significantly improved developer experience. With Eden, we can fetch an API from Elysia server fully type-safe without code generation.
14
+
content: Eden Treaty is an object-like representation of an Elysia server, providing end-to-end type safety and a significantly improved developer experience. With Eden, we can fetch an API from Elysia server fully type-safe without code generation.
By default, Elysia infers `error` and `response` types to TypeScript automatically, and Eden will be providing auto-completion and type narrowing for accurate behavior.
71
71
72
72
::: tip
73
-
If the server responds with an HTTP status >= 300, then the value will be always be `null`, and `error` will have a returned value instead.
73
+
If the server responds with an HTTP status >= 300, then the value will always be `null`, and `error` will have a returned value instead.
Copy file name to clipboardExpand all lines: docs/eden/treaty/unit-test.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,17 +7,17 @@ head:
7
7
8
8
- - meta
9
9
- name: 'og:description'
10
-
content: Eden Treaty is an object-like representation of an Elysia server, providing an end-to-end type safety, and a significantly improved developer experience. With Eden, we can fetch an API from Elysia server fully type-safe without code generation.
10
+
content: Eden Treaty is an object-like representation of an Elysia server, providing end-to-end type safety and a significantly improved developer experience. With Eden, we can fetch an API from Elysia server fully type-safe without code generation.
11
11
12
12
- - meta
13
13
- name: 'og:description'
14
-
content: Eden Treaty is an object-like representation of an Elysia server, providing an end-to-end type safety, and a significantly improved developer experience. With Eden, we can fetch an API from Elysia server fully type-safe without code generation.
14
+
content: Eden Treaty is an object-like representation of an Elysia server, providing end-to-end type safety and a significantly improved developer experience. With Eden, we can fetch an API from Elysia server fully type-safe without code generation.
15
15
---
16
16
17
17
# Unit Test
18
18
According to [Eden Treaty config](/eden/treaty/config.html#urlorinstance) and [Unit Test](/patterns/unit-test), we may pass an Elysia instance to Eden Treaty directly to interact with Elysia server directly without sending a network request.
19
19
20
-
We may use this patterns to create a unit test with end-to-end type safety and type-level test all at once.
20
+
We may use this pattern to create a unit test with end-to-end type safety and type-level test all at once.
21
21
22
22
```typescript twoslash
23
23
// test/index.test.ts
@@ -29,7 +29,7 @@ const app = new Elysia().get('/hello', 'hi')
29
29
const api =treaty(app)
30
30
31
31
describe('Elysia', () => {
32
-
it('return a response', async () => {
32
+
it('returns a response', async () => {
33
33
const { data } =awaitapi.hello.get()
34
34
35
35
expect(data).toBe('hi')
@@ -40,7 +40,7 @@ describe('Elysia', () => {
40
40
```
41
41
42
42
## Type safety test
43
-
To perform a type safety test, simply run **tsc**to test folders.
43
+
To perform a type safety test, simply run **tsc**on test folders.
0 commit comments