Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/blog/elysia-06.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ new Elysia()
.mount(C)
```

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.

This made the possibility of interlopable framework and runtime to a reality.
::: info Note
As of Elysia 1.x, `.mount()` does not resolve to `.use()`. It always extracts the `.fetch` handler. Use [**.use()**](/essential/plugin) to compose Elysia instances with type safety and Eden Treaty support.
:::

## Improved starts up time
Starts up time is an important metric in a serverless environment which Elysia excels it incredibly, but we have taken it even further.
Expand Down
6 changes: 5 additions & 1 deletion docs/patterns/mount.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ head:
import TutorialBadge from '../components/arona/badge.vue'
</script>

# Mount <TutorialBadge href="/tutorial/features/openapi" />
# Mount <TutorialBadge href="/tutorial/features/mount" />
[WinterTC](https://wintertc.org/) is a standard for building HTTP Server behind Cloudflare, Deno, Vercel, and others.

It allows web servers to run interoperably across runtimes by using [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request), and [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response).
Expand All @@ -27,6 +27,10 @@ Elysia is WinterTC compliant. Optimized to run on Bun, but also support other ru

This allows any framework or code that is WinterTC compliant to be run together, allowing frameworks like Elysia, Hono, Remix, Itty Router to run together in a simple function.

::: tip
To compose Elysia instances with full type safety, Eden Treaty support, and OpenAPI documentation, use [**.use()**](/essential/plugin) instead. **.mount** does not preserve type inference or OpenAPI schemas.
:::
Comment on lines +30 to +32
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix the standard name typo.

The tip box uses "WinterTC" but the correct name of the standard is "WinterCG" (Winter Community Group). This is inconsistent with the blog post (lines 118-122 of elysia-06.md) which correctly uses "WinterCG".

📝 Proposed fix
 ::: tip
-**.mount** is intended for mounting non-Elysia, WinterTC-compliant handlers. Mounted routes are registered as a wildcard handler and are **not** included in OpenAPI/Swagger documentation, Eden Treaty type inference, or WebSocket support.
+**.mount** is intended for mounting non-Elysia, WinterCG-compliant handlers. Mounted routes are registered as a wildcard handler and are **not** included in OpenAPI/Swagger documentation, Eden Treaty type inference, or WebSocket support.
 
 To compose Elysia instances with full type safety, Eden Treaty support, and OpenAPI documentation, use [**.use()**](/essential/plugin) instead.
 :::
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
::: tip
**.mount** is intended for mounting non-Elysia, WinterTC-compliant handlers. Mounted routes are registered as a wildcard handler and are **not** included in OpenAPI/Swagger documentation, Eden Treaty type inference, or WebSocket support.
To compose Elysia instances with full type safety, Eden Treaty support, and OpenAPI documentation, use [**.use()**](/essential/plugin) instead.
:::
::: tip
**.mount** is intended for mounting non-Elysia, WinterCG-compliant handlers. Mounted routes are registered as a wildcard handler and are **not** included in OpenAPI/Swagger documentation, Eden Treaty type inference, or WebSocket support.
To compose Elysia instances with full type safety, Eden Treaty support, and OpenAPI documentation, use [**.use()**](/essential/plugin) instead.
:::
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/patterns/mount.md` around lines 30 - 34, Update the typo in the tip text
that mentions the standard: change "WinterTC" to the correct name "WinterCG"
where .mount is described (the sentence about mounting non-Elysia,
WinterTC-compliant handlers); keep the rest of the text intact and ensure the
.use() reference remains unchanged.


## Mount
To use **.mount**, [simply pass a `fetch` function](https://twitter.com/saltyAom/status/1684786233594290176):
```ts
Expand Down
Loading