@ilha/astro 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/index.js +7 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -34,6 +34,8 @@ export default defineConfig({
|
|
|
34
34
|
|
|
35
35
|
You can also pass `exclude` globs. Files outside the filter remain available to other Astro JSX renderers.
|
|
36
36
|
|
|
37
|
+
Other JSX renderers (e.g. `@astrojs/solid-js`) can appear before or after `@ilha/astro` — Ilha islands are tagged with Astro's `astro:renderer` symbol, so Astro routes them to Ilha's renderer regardless of integration order.
|
|
38
|
+
|
|
37
39
|
Then use any Ilha island as an Astro component, with a [client directive](https://docs.astro.build/en/reference/directives-reference/#client-directives) to control hydration:
|
|
38
40
|
|
|
39
41
|
```astro
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
//#region src/index.ts
|
|
2
|
+
const ASTRO_RENDERER_GLOBAL = Symbol.for("ilha.astroRenderer");
|
|
3
|
+
const rendererName = "@ilha/astro";
|
|
4
|
+
function setRendererMarker() {
|
|
5
|
+
globalThis[ASTRO_RENDERER_GLOBAL] = rendererName;
|
|
6
|
+
}
|
|
7
|
+
setRendererMarker();
|
|
2
8
|
const OPTIONS_MODULE = "virtual:@ilha/astro/options";
|
|
3
9
|
function globToRegExp(pattern) {
|
|
4
10
|
let source = "^";
|
|
@@ -56,6 +62,7 @@ function ilhaIntegration(options = {}) {
|
|
|
56
62
|
return {
|
|
57
63
|
name: "@ilha/astro",
|
|
58
64
|
hooks: { "astro:config:setup": ({ addRenderer, updateConfig }) => {
|
|
65
|
+
setRendererMarker();
|
|
59
66
|
addRenderer(getRenderer());
|
|
60
67
|
updateConfig({ vite: getViteConfig(options) });
|
|
61
68
|
} }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ilha/astro",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Astro integration for Ilha islands",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astro-component",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"test": "bun test"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"astro": "^7.2.
|
|
56
|
-
"ilha": "^0.
|
|
55
|
+
"astro": "^7.2.4",
|
|
56
|
+
"ilha": "^0.11.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"astro": "^7.2.
|
|
60
|
-
"ilha": ">=0.
|
|
59
|
+
"astro": "^7.2.4",
|
|
60
|
+
"ilha": ">=0.11.0"
|
|
61
61
|
}
|
|
62
62
|
}
|