์๊ฐ
๐ ๊ฐ๋ณ๊ณ ์ง๊ด์ ์ด๋ฉฐ ์ฌ์ฉ์ ์ง์ ์ด ๊ฐ๋ฅํ JavaScript ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ก, ๊ฐ๋ ฅํ ์น ์ฑ์ ์ฝ๊ฒ ๋ง๋ค ์ ์์ต๋๋ค.
์น ๋ฐ ์ฑ ๊ฐ๋ฐ์ธก์ ๋ ์คํ ์ฆ๊ฐ
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- ๊ธฐ๋ก ์์ง ์ค
์๋ก ๊ฒน์น๋ ๊ธฐ๊ฐ์ ์์ฆ๊ฐ๋์ด๋ฉฐ ์ผ๋ณ ํฉ๊ณ๊ฐ ์๋๋๋ค. ์ธก์ ๊ฐ์ด ์์ผ๋ฉด ๋น์ ๋ก๋๋ค. ์คํ๋ ๊ด์ฌ๋๋ฅผ ๋ํ๋ด๋ฉฐ ํ์ง์ ๋ณด์ฅํ์ง ์์ต๋๋ค.
README.md
OriginalUsage
Client-side
Set up mizu.js in your browser environment using one of two methods:
- Immediately Invoked Function Expression (IIFE)
- EcmaScript Module (ESM)
[!NOTE]
On the client-side...
- Rendering is explicit, requiring the
*mizuattribute to enable mizu.js on a subtree.- Reactivity is enabled, so changes to contexts will trigger a re-render.
IIFE ( .js)
This setup automatically starts rendering the page once the script is loaded. It's the simplest way to get started but limited to the default configuration.
<script src="https://mizu.sh/client.js" defer></script>
ESM ( .mjs)
This setup requires you to import and start mizu.js manually, allowing customization of the rendering process, such as setting the initial context and loading additional directives.
<script type="module">
import Mizu from "https://mizu.sh/client.mjs"
await Mizu.render(document.body, { context: { foo: "๐ Yaa, mizu!" } })
</script>
Server-side
To set up mizu.js in a server environment, install it locally. mizu.js packages are hosted on .
[!NOTE]
On the server side...
- Rendering is implicit, so the
*mizuattribute is not required.- Reactivity is disabled, meaning changes to contexts are not tracked and will not trigger a re-render.
Deno
Deno supports the jsr: specifier natively, allowing you to import mizu.js directly.
import Mizu from "jsr:@mizu/render/server"
await Mizu.render(`<div *text="foo"></div>`, { context: { foo: "๐ Yaa, mizu!" } })
Alternatively, add it to your project using the Deno CLI.
deno add jsr:@mizu/render
Other runtimes (NodeJS, Bun, etc.)
Add mizu.js to your project using the JSR npm compatibility layer.
# NodeJS
npx jsr add @mizu/render
# Bun
bunx jsr add @mizu/render
Once installed, use it in your project.
import Mizu from "@mizu/render/server"
await Mizu.render(`<div *text="foo"></div>`, { context: { foo: "๐ Yaa, mizu!" } })
๐ License
MIT License
Copyright (c) 2024 Simon Lecoq
๊ด๋ จ ํ๋ก์ ํธ ์ดํด๋ณด๊ธฐ
๋ถ๋ฌ์ค๋ ์คโฆ

