summaryrefslogtreecommitdiff
path: root/examples/framework-multiple/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/framework-multiple/src')
-rw-r--r--examples/framework-multiple/src/components/PreactCounter.tsx1
-rw-r--r--examples/framework-multiple/src/components/PreactSFC.tsx12
-rw-r--r--examples/framework-multiple/src/components/ReactCounter.jsx2
-rw-r--r--examples/framework-multiple/src/components/SolidCounter.tsx21
-rw-r--r--examples/framework-multiple/src/pages/index.astro7
5 files changed, 40 insertions, 3 deletions
diff --git a/examples/framework-multiple/src/components/PreactCounter.tsx b/examples/framework-multiple/src/components/PreactCounter.tsx
index be4ddb6ce..bfead53da 100644
--- a/examples/framework-multiple/src/components/PreactCounter.tsx
+++ b/examples/framework-multiple/src/components/PreactCounter.tsx
@@ -1,4 +1,3 @@
-import { h, Fragment } from 'preact';
import { useState } from 'preact/hooks';
/** a counter written in Preact */
diff --git a/examples/framework-multiple/src/components/PreactSFC.tsx b/examples/framework-multiple/src/components/PreactSFC.tsx
new file mode 100644
index 000000000..a92e258f8
--- /dev/null
+++ b/examples/framework-multiple/src/components/PreactSFC.tsx
@@ -0,0 +1,12 @@
+/** @jsxImportSource preact */
+
+/** a counter written in Preact */
+export default function PreactSFC({ children }) {
+ return (
+ <>
+ <div className="counter">
+ Hello from Preact!
+ </div>
+ </>
+ );
+}
diff --git a/examples/framework-multiple/src/components/ReactCounter.jsx b/examples/framework-multiple/src/components/ReactCounter.jsx
index 06d8f2513..4b7c4bfa3 100644
--- a/examples/framework-multiple/src/components/ReactCounter.jsx
+++ b/examples/framework-multiple/src/components/ReactCounter.jsx
@@ -1,4 +1,4 @@
-import React, { useState } from 'react';
+import { useState } from 'react';
/** a counter written in React */
export function Counter({ children }) {
diff --git a/examples/framework-multiple/src/components/SolidCounter.tsx b/examples/framework-multiple/src/components/SolidCounter.tsx
new file mode 100644
index 000000000..0ec274bb4
--- /dev/null
+++ b/examples/framework-multiple/src/components/SolidCounter.tsx
@@ -0,0 +1,21 @@
+import { createSignal } from "solid-js";
+
+/** a counter written with Solid */
+export default function SolidCounter({ children }) {
+ const [count, setCount] = createSignal(0);
+ const add = () => setCount(count() + 1);
+ const subtract = () => setCount(count() - 1);
+
+ return (
+ <>
+ <div id="solid" class="counter">
+ <button onClick={subtract}>-</button>
+ <pre>{count()}</pre>
+ <button onClick={add}>+</button>
+ </div>
+ <div class="children">
+ {children}
+ </div>
+ </>
+ );
+}
diff --git a/examples/framework-multiple/src/pages/index.astro b/examples/framework-multiple/src/pages/index.astro
index c49744b18..1128029c2 100644
--- a/examples/framework-multiple/src/pages/index.astro
+++ b/examples/framework-multiple/src/pages/index.astro
@@ -3,10 +3,11 @@
import { A, B as Renamed } from '../components';
import * as react from '../components/ReactCounter.jsx';
import { PreactCounter } from '../components/PreactCounter.tsx';
+import PreactSFC from '../components/PreactSFC.tsx';
+import SolidCounter from '../components/SolidCounter.tsx';
import VueCounter from '../components/VueCounter.vue';
import SvelteCounter from '../components/SvelteCounter.svelte';
-
// Full Astro Component Syntax:
// https://docs.astro.build/core-concepts/astro-components/
---
@@ -45,6 +46,10 @@ import SvelteCounter from '../components/SvelteCounter.svelte';
<h1>Hello Preact!</h1>
</PreactCounter>
+ <SolidCounter client:visible>
+ <h1>Hello Solid!</h1>
+ </SolidCounter>
+
<VueCounter client:visible>
<h1>Hello Vue!</h1>
</VueCounter>
* Add vite back as a dep * Adds a changeset 2021-11-19[ci] yarn formatGravatar matthewp 1-1/+1 2021-11-19Add polyfill scripts to result.scripts (#1920)Gravatar Matthew Phillips 3-4/+13 * Add polyfill scripts to result.scripts * These scripts are bundled together now * Adds changeset 2021-11-19Remove escape in blog example postGravatar Matthew Phillips 1-1/+1 2021-11-19Do not let Prettier bot mess wit the blog example (#1918)Gravatar Matthew Phillips 1-0/+1 2021-11-19[ci] yarn formatGravatar matthewp 1-1/+1 2021-11-19Fix blog example yet again (#1917)Gravatar Matthew Phillips 2-3/+3 2021-11-19Version Packages (next) (#1916)astro@0.21.0-next.11@astrojs/markdown-remark@0.4.0-next.2Gravatar github-actions[bot] 25-23/+39 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> 2021-11-19Adding a changeset for package.json bump (#1913)Gravatar Matthew Phillips 2-0/+10 * Adding a changeset * Add changeset for remark plugin 2021-11-19Remove additional newlines added to HTML (#1908)Gravatar Jonathan Neal 1-1/+1 * Remove additional newlines added to HTML * keep template newlines 2021-11-19[ci] yarn formatGravatar matthewp 1-1/+1 2021-11-19Small fixes (#1911)Gravatar Matthew Phillips 3-1/+5 2021-11-19[ci] yarn formatGravatar matthewp 1-1/+1 2021-11-19Fix blog example (#1910)Gravatar Matthew Phillips 1-1/+1 2021-11-19Version Packages (next) (#1907)astro@0.21.0-next.10Gravatar github-actions[bot] 23-21/+28 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> 2021-11-19Remove further dependence on vite package (#1906)Gravatar Matthew Phillips 3-5/+9 * Remove further dependence on vite package * Adds a changeset * Add graymatter as a regular dep 2021-11-19Version Packages (next) (#1904)astro@0.21.0-next.9Gravatar github-actions[bot] 23-21/+30 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> 2021-11-19Remove OSX \x00 workaround (#1901)Gravatar Matthew Phillips 2-5/+5 * Remove OSX \x00 workaround * Adds a changeset 2021-11-19Resolve vite client modules to vendored vite (#1903)Gravatar Matthew Phillips 2-2/+7 * Resolve vite client modules to vendored vite * Adds a changeset 2021-11-19[ci] yarn formatGravatar matthewp 1-3/+3 2021-11-19Add Debug tests (#1882)Gravatar Matthew Phillips 4-0/+62 * Make Debug use the Code component * Use a random port so parallel testing works * some debugging * Skip these tests for now * Dont run these tests on osx 2021-11-19[ci] collect statsGravatar FredKSchott 1-0/+1 2021-11-19Version Packages (next) (#1881)astro@0.21.0-next.8@astrojs/renderer-vue@0.2.0-next.2Gravatar github-actions[bot] 25-23/+42 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> 2021-11-18Improve HMR (#1896)Gravatar Drew Powers 2-10/+18 2021-11-18update depsGravatar Fred K. Schott 5-352/+65 2021-11-18fix #1778Gravatar Fred K. Schott 2-1/+8 2021-11-18Update compiler (#1869)Gravatar Nate Moore 3-11/+6 * chore: update compiler * redeploy * fix(www): ensure www can build * chore: update compiler Co-authored-by: Fred K. Schott <fkschott@gmail.com> 2021-11-18remove unused remark dependency (#1894)Gravatar Fred K. Schott 2-245/+13 2021-11-18Improve error messages (#1875)Gravatar Drew Powers 39-61/+448 * Fix error handling in correct scope Also improve Vite IDs for better module graph lookups * Improve code frame * Add changeset * maybeLoc can be undefined * Add tests Co-authored-by: Matthew Phillips <matthew@skypack.dev> 2021-11-18pin astro compiler to older versionGravatar Fred K. Schott 2-5/+5 2021-11-18Update yarn.lock to reflect the state of the package.json files (#1892)Gravatar Jonathan Neal 5-1300/+1000 * update dependencies * update file to fix build:all 2021-11-19[ci] yarn formatGravatar FredKSchott 1-5/+3