Skip to content

Commit

Permalink
Fix the doc and migration guide about the new API
Browse files Browse the repository at this point in the history
  • Loading branch information
whitphx committed Jan 12, 2025
1 parent 3696436 commit 365976b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ The points are:
- Instead, **add `type="module"` to the script tag where you use Stlite** and **import the package in the way like `import * as stlite from "https://.../stlite.js";` inside it**, then you can use `stlite.mount()` as before.
- `import { mount } from "https://.../stlite.js";` and calling `mount()` directly is also available.
- Note that the package name is changed from `@stlite/mountable` to `@stlite/browser`, so the **CDN URL is also changed** to `https://cdn.jsdelivr.net/npm/@stlite/browser@<version>/build/stlite.js`.
- **Delete `<link rel="stylesheet" href="https://.../stlite.css" />`**. Loading a CSS file is no longer needed.
- **Change the CSS file name** from `stlite.css` to `style.css`.
- The `mount()` API is the same as before.

Here is an example of migrating from `@stlite/mountable` to `@stlite/browser`:
Expand All @@ -87,6 +87,10 @@ The new way with `@stlite/browser`:
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<title>Stlite App</title>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@stlite/[email protected]/build/style.css"
/>
</head>
<body>
<div id="root"></div>
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ Here is a sample HTML file.
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<title>Stlite App</title>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@stlite/[email protected]/build/style.css"
/>
</head>
<body>
<div id="root"></div>
Expand Down

0 comments on commit 365976b

Please sign in to comment.