Skip to content

Commit 08b8460

Browse files
authored
Merge pull request #92 from OscarRG/fix-elysia-06-typos
fix: fix typos in elysia 06 post
2 parents 3fe0933 + b8be6d8 commit 08b8460

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

docs/blog/elysia-06.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ const group = new Elysia({ prefix: '/v1' })
7272
.get('/hello', () => 'Hello World')
7373
```
7474

75-
We encourage you to use the new model of Elysia plugin instance, as we can take advantage of Plugin Checksum and new possible feature in the future.
75+
We encourage you to use the new model of Elysia plugin instance, as we can take advantage of Plugin Checksum and new possible features in the future.
7676

7777
However, we are **NOT deprecating** the callback function method as there's some case function model is useful like:
7878
- Inline function
79-
- Plugin that required an information of main instance (for example accessing OpenAPI schema)
79+
- Plugins that required an information of main instance (for example accessing OpenAPI schema)
8080

8181
With this new plugin model, we hope that you can make your codebase even easier to maintain.
8282

@@ -87,7 +87,7 @@ This means that if you register a plugin for type declaration, it will duplicate
8787

8888
Which is why Plugin Checksum is introduced, to de-duplicated plugin registered for type declaration.
8989

90-
To opt-in to Plugin Checksum, you need to use a new plugin model, and provided a `name` property to tell Elysia to not deduplicated the plugin
90+
To opt-in to Plugin Checksum, you need to use a new plugin model, and provide a `name` property to tell Elysia to prevent the plugin from being deduplicate
9191
```ts
9292
const plugin = new Elysia({
9393
name: 'plugin'
@@ -96,9 +96,9 @@ const plugin = new Elysia({
9696

9797
This allows Elysia to identify the plugin and deduplicated based on name.
9898

99-
Any duplicated name will be registered only once but type-safety will be provided after registered even if the plugin is deduplicated.
99+
Any duplicated name will be registered only once but type-safety will be provided after registration even if the plugin is deduplicated.
100100

101-
In case if your plugin need configuration, you can provided the configuration into a **seed** property to generate a checksum to deduplicate the plugin.
101+
In case your plugin needs configuration, you can provide the configuration into a **seed** property to generate a checksum for deduplicating the plugin.
102102

103103
```ts
104104
const plugin = (config) = new Elysia({
@@ -107,9 +107,9 @@ const plugin = (config) = new Elysia({
107107
})
108108
```
109109

110-
name and seed will be used to generate a checksum to de-duplicated registration, which leads to even better performance improvement.
110+
Name and seed will be used to generate a checksum to de-duplicated registration, which leads to even better performance improvement.
111111

112-
This update also fixed the deduplication of the plugin's lifecycle accidentally inline life-cycle when Elysia is not sured if plugin is local and global event.
112+
This update also fixed the deduplication of the plugin's lifecycle accidentally inline lifecycle when Elysia is not sure if plugin is local and global event.
113113

114114
As always, means performance improvement for an app that's larger than "Hello World".
115115

@@ -138,7 +138,7 @@ A **fetch** function is a function that accept Web Standard Request and return W
138138
type fetch = (request: RequestLike) => Response
139139
```
140140
141-
By default, this declaration are used by:
141+
By default, this declaration is used by:
142142
- Bun
143143
- Deno
144144
- Vercel Edge Runtime
@@ -178,25 +178,25 @@ new Elysia()
178178

179179
If an instance passed to mount is an Elysia instance, it will resolve to `use` automatically, providing type-safety and support for Eden by default.
180180

181-
This made the possiblility of interlopable framework and runtime to a reality.
181+
This made the possibility of interlopable framework and runtime to a reality.
182182

183183
## Improved starts up time
184-
Starts up time is an important metric in an serverless environment which Elysia excels it incredibly, but we have taken it even further.
184+
Starts up time is an important metric in a serverless environment which Elysia excels it incredibly, but we have taken it even further.
185185

186-
By default, Elysia generate OpenAPI schema for every route automatically and stored it internally when if not used.
186+
By default, Elysia generates OpenAPI schema for every route automatically and stored it internally when if not used.
187187

188-
In this version, Elysia defers the compliation and moved to `@elysiajs/swagger` instead allowing Elysia starts up time to be even faster.
188+
In this version, Elysia defers the compilation and moved to `@elysiajs/swagger` instead allowing Elysia starts up time to be even faster.
189189

190190
And with various micro-optimization, and made possible by new Plugin model, starts up time is now up to 35% faster.
191191

192192
## Dynamic Mode
193-
Elysia introduce Static Code Analysis and Ahead of Time compliation to push to boundary of performance.
193+
Elysia introduces Static Code Analysis and Ahead of Time compilation to push the boundary of performance.
194194

195-
Static Code Analysis allow Elysia to read your code then produce the most optimized version code, allowing Elysia to push the performance to it's limit.
195+
Static Code Analysis allow Elysia to read your code then produce the most optimized version code, allowing Elysia to push the performance to its limit.
196196

197197
Even if Elysia is WinterCG compliance, environment like Cloudflare worker doesn't support function composition.
198198

199-
This means that Ahead of Time Compliation isn't possible, leading us to create a dynamic mode which use JIT compliation instead of AoT, allowing Elysia to runs in Cloudflare Worker as well.
199+
This means that Ahead of Time Compliation isn't possible, leading us to create a dynamic mode which use JIT compilation instead of AoT, allowing Elysia to run in Cloudflare Worker as well.
200200

201201
To enable dynamic mode, set `aot` to false.
202202
```ts
@@ -207,18 +207,18 @@ new Elysia({
207207

208208
Dynamic Mode is enabled by default in cloudflare worker.
209209

210-
#### It's worth note that, enabling Dynamic Mode will disable some feature like dynamic injected code like `t.Numeric` which parse string to number automatically.
210+
#### It's worth noting that, enabling Dynamic Mode will disable some feature like dynamic injected code like `t.Numeric` which parse strings to numbers automatically.
211211

212-
Ahead of Time compliation can read, detect and optimized your code in exchange of start up time in exchange of extra performance gain, while dynamic mode use JIT compilation, allowing start up time to be even faster up to 6x.
212+
Ahead of Time compilation can read, detect and optimize your code in exchange for startup time in exchange for extra performance gain, while dynamic mode uses JIT compilation, allowing start up time to be even faster up to 6x.
213213

214-
But it should be note that starts up time in Elysia is fast enough by default.
214+
But it should be noted that startup time in Elysia is fast enough by default.
215215

216-
Elysia is able to registered 10,000 routes in just 78ms which means in an average of 0.0079 ms/route
216+
Elysia is able to register 10,000 routes in just 78ms which means in an average of 0.0079 ms/route
217217

218218
That being said, we are leaving a choice for you to decided yourself.
219219

220220
## Declarative Custom Error
221-
This update add support for adding type support for handling custom error.
221+
This update adds support for adding type support for handling custom error.
222222

223223
```ts
224224
class CustomError extends Error {
@@ -242,20 +242,20 @@ new Elysia()
242242
})
243243
```
244244

245-
This allows us to handle custom type with type narrowing for handling custom error and auto-completion for error code to narrow down the correct type, fully type-safe declaratively.
245+
This allows us to handle custom types with type narrowing for handling custom errors and auto-completion for error codes to narrow down the correct types, fully type-safe declaratively.
246246

247-
This fulfills one of the our main philosophy is focused on Developer Experience especially with types.
247+
This fulfills one of our main philosophies is focused on Developer Experience especially with types.
248248

249-
Elysia Type System is complex, yet we try to refrained our user's need to write a custom type or passing a custom generic, retaining all the code to looks just like JavaScript.
249+
Elysia Type System is complex, yet we try to refrained our users need to write a custom type or passing a custom generic, retaining all the code to look just like JavaScript.
250250

251251
It just works, and all the code looks just like JavaScript.
252252

253253
## TypeBox 0.30
254-
TypeBox is a core library that powered Elysia's strict type system known as **Elysia.t**.
254+
TypeBox is a core library that powers Elysia's strict type system known as **Elysia.t**.
255255

256-
In this update, we update TypeBox from 0.28 to 0.30 to make even more fine-grained Type System near strictly typed language.
256+
In this update, we update TypeBox from 0.28 to 0.30 to make even more fine-grained Type System nearly strictly typed language.
257257

258-
This updates introduce new features and many interesting changes, for example **Iterator** type, reducing package size, TypeScript code generation.
258+
These updates introduce new features and many interesting changes, for example **Iterator** type, reducing packages size, TypeScript code generation.
259259

260260
And with support for Utility Types like:
261261
- `t.Awaited`
@@ -298,18 +298,18 @@ new Elysia({
298298
We hope that this will clear any questions regards to path matching and its expected behavior
299299

300300
## onResponse
301-
This update introduce a new life-cycle hook call `onResponse`.
301+
This update introduce a new lifecycle hook called `onResponse`.
302302

303-
This is a proposal, proposed by [elysia#67](https://github.com/elysiajs/elysia/issues/67)
303+
This is a proposal proposed by [elysia#67](https://github.com/elysiajs/elysia/issues/67)
304304

305305
Previously Elysia life-cycle works as illustrated in this diagram.
306306
![Elysia life-cycle diagram](/blog/elysia-06/lifecycle-05.webp)
307307

308-
For any metric, data-collection or logging purpose, you can use `onAfterHandle` to run the function to collect metrics, however this life-cycle doesn't executed when handler runs into an error, whether it's routing error, or custom error provided.
308+
For any metric, data-collection or logging purpose, you can use `onAfterHandle` to run the function to collect metrics, however, this lifecycle isn't executed when handler runs into an error, whether it's a routing error or a custom error provided.
309309

310310
Which is why we introduced `onResponse` to handle all cases of Response.
311311

312-
You can use `onRequest`, and `onResponse` together to measure a metric of performance or any logging requred.
312+
You can use `onRequest`, and `onResponse` together to measure a metric of performance or any required logging.
313313

314314
Quoted
315315
> However, the onAfterHandle function only fires on successful responses. For instance, if the route is not found, or the body is invalid, or an error is thrown, it is not fired. How can I listen to both successful and non-successful requests? This is why I suggested onResponse.
@@ -320,15 +320,15 @@ Quoted
320320
---
321321

322322
### Notable Improvement:
323-
- Add `error` field to Elysia type system for adding custom error message
323+
- Added an error field to the Elysia type system for adding custom error messages
324324
- Support Cloudflare worker with Dynamic Mode (and ENV)
325325
- AfterHandle now automatically maps the value
326326
- Using bun build to target Bun environment, improving the overall performance by 5-10%
327-
- Deduplicated inline life-cycle when using plugin registration
327+
- Deduplicated inline lifecycle when using plugin registration
328328
- Support for setting `prefix`
329329
- Recursive path typing
330-
- Slighty improve type checking speed
331-
- Recursive schema collision causing infinite type
330+
- Slightly improved type checking speed
331+
- Recursive schema collision causing infinite types
332332

333333
### Change:
334334
- Moved **registerSchemaPath** to @elysiajs/swagger
@@ -342,19 +342,19 @@ Quoted
342342
## Afterward
343343
We have just passed a one year milestone, and really excited how Elysia and Bun have improved over the year!
344344

345-
Pushing performance boundary of JavaScript with Bun, and developer experience with Elysia, we are thrilled to have keeps in touch with you and our community.
345+
Pushing the performance boundaries of JavaScript with Bun, and developer experience with Elysia, we are thrilled to have kept in touch with you and our community.
346346

347-
Every updates, keeps making Elysia even more stable, and having better developer experience gradually without a drop in performance and features.
347+
Every updates, keeps making Elysia even more stable, and gradually providing a better developer experience without a drop in performance and features.
348348

349-
We're thrilled to see our community of open-source developers bring Elysia to life with their works like
349+
We're thrilled to see our community of open-source developers bringing Elysia to life with their projects like.
350350
- [Elysia Vite Plugin SSR](https://github.com/timnghg/elysia-vite-plugin-ssr) allowing us to use Vite Server Side Rendering using Elysia as the server.
351351
- [Elysia Connect](https://github.com/timnghg/elysia-connect) which made Connect's plugin compatible with Elysia
352352

353353
And much more developers that choose Elysia for their next big project.
354354

355355
With our commitment, we also recently introduced [Mobius](https://github.com/saltyaom/mobius), and open-source TypeScript library to parse GraphQL to TypeScript type without relying on code generation by using TypeScript template literal type entirely to be the very first framework to achieve end-to-end type safety without relying on code generation.
356356

357-
We incredibly thanksful for your overwhelming continous support for Elysia, and we hope to see you pushing the boundary together on the next release.
357+
We incredibly thankful for your overwhelming continous support for Elysia, and we hope to see you pushing the boundaries together in the next release.
358358

359359
> As this whole new world cheers my name
360360
>

0 commit comments

Comments
 (0)