Skip to content

Commit

Permalink
Update renderer API for Vite (#1623)
Browse files Browse the repository at this point in the history
* Update renderer API for Vite

* Fix lit-element tests

* Clean up comments

* Throw friendly error if renderer provides viteConfig in a bad format
  • Loading branch information
drwpow committed Oct 22, 2021
1 parent 4b25d55 commit 330620e
Show file tree
Hide file tree
Showing 67 changed files with 420 additions and 548 deletions.
3 changes: 0 additions & 3 deletions examples/blog-multiple-authors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@
},
"devDependencies": {
"astro": "^0.20.12"
},
"snowpack": {
"workspaceRoot": "../.."
}
}
3 changes: 0 additions & 3 deletions examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@
},
"devDependencies": {
"astro": "^0.20.12"
},
"snowpack": {
"workspaceRoot": "../.."
}
}
10 changes: 0 additions & 10 deletions examples/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,5 @@
"devDependencies": {
"astro": "^0.20.12",
"@snowpack/plugin-dotenv": "^2.1.0"
},
"snowpack": {
"alias": {
"components": "./src/components",
"~": "./src"
},
"plugins": [
"@snowpack/plugin-dotenv"
],
"workspaceRoot": "../.."
}
}
3 changes: 0 additions & 3 deletions examples/framework-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
"devDependencies": {
"@astrojs/renderer-lit": "^0.1.2",
"astro": "^0.20.12"
},
"snowpack": {
"workspaceRoot": "../.."
}
}
18 changes: 7 additions & 11 deletions examples/framework-lit/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@ import '../components/Counter.js';

<!doctype html>
<html lang="en">
<head>
<link rel="icon" type="image/x-icon" href="/favicon.ico" />

<title>Demo</title>
</head>
<body>
<head>
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<title>Demo</title>
</head>
<body>
<h1>Test app</h1>

<my-counter client:load />

<Lorem />

<Lorem />
<calc-add num={33} />
</body>
</body>
</html>
3 changes: 0 additions & 3 deletions examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
"devDependencies": {
"astro": "^0.20.12",
"@astrojs/renderer-solid": "^0.1.1"
},
"snowpack": {
"workspaceRoot": "../.."
}
}
3 changes: 0 additions & 3 deletions examples/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@
},
"devDependencies": {
"astro": "^0.20.12"
},
"snowpack": {
"workspaceRoot": "../.."
}
}
18 changes: 6 additions & 12 deletions examples/framework-preact/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,37 @@
// Component Imports
import Counter from '../components/Counter.tsx'
// Full Astro Component Syntax:
// https://docs.astro.build/core-concepts/astro-components/
---
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width"
/>

<link rel="icon" type="image/x-icon" href="/favicon.ico" />

<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<style>
:global(:root) {
font-family: system-ui;
padding: 2em 0;
}
:global(.counter) {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
place-items: center;
font-size: 2em;
grid-template-columns: repeat(3, minmax(0, 1fr));
margin-top: 2em;
place-items: center;
}
:global(.children) {
display: grid;
place-items: center;
margin-bottom: 2em;
place-items: center;
}
</style>
</head>
<body>
<main>
<Counter client:visible>
<h1>Hello Preact!</h1>
<h1>Hello, Preact!</h1>
</Counter>
</main>
</body>
Expand Down
3 changes: 0 additions & 3 deletions examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@
},
"devDependencies": {
"astro": "^0.20.12"
},
"snowpack": {
"workspaceRoot": "../.."
}
}
17 changes: 6 additions & 11 deletions examples/framework-react/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,31 @@ const someProps = {
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width"
/>

<link rel="icon" type="image/x-icon" href="/favicon.ico" />

<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<style>
:global(:root) {
font-family: system-ui;
padding: 2em 0;
}
:global(.counter) {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
place-items: center;
font-size: 2em;
grid-template-columns: repeat(3, minmax(0, 1fr));
margin-top: 2em;
place-items: center;
}
:global(.children) {
display: grid;
place-items: center;
margin-bottom: 2em;
place-items: center;
}
</style>
</head>
<body>
<main>
<Counter {...someProps} client:visible>
<h1>Hello React!</h1>
<h1>Hello, React!</h1>
</Counter>
</main>
</body>
Expand Down
3 changes: 0 additions & 3 deletions examples/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
"devDependencies": {
"astro": "^0.20.12",
"@astrojs/renderer-solid": "0.1.1"
},
"snowpack": {
"workspaceRoot": "../.."
}
}
3 changes: 1 addition & 2 deletions examples/framework-solid/src/components/Counter.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { createSignal } from 'solid-js';

/** */
export default function SolidCounter({ children }) {
export default function Counter({ children }) {
const [count, setCount] = createSignal(0);
const add = () => setCount(count() + 1);
const subtract = () => setCount(count() - 1);
Expand Down
5 changes: 2 additions & 3 deletions examples/framework-solid/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
import Counter from '../components/Counter.jsx';
---

<html>
<head>
<meta charset="utf-8" />
Expand All @@ -13,10 +12,10 @@ import Counter from '../components/Counter.jsx';
}
.counter {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
place-items: center;
font-size: 2em;
grid-template-columns: repeat(3, minmax(0, 1fr));
margin-top: 3em;
place-items: center;
}
.counter-message {
text-align: center;
Expand Down
3 changes: 0 additions & 3 deletions examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@
},
"devDependencies": {
"astro": "^0.20.12"
},
"snowpack": {
"workspaceRoot": "../.."
}
}
17 changes: 6 additions & 11 deletions examples/framework-svelte/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,31 @@ import Counter from '../components/Counter.svelte'
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width"
/>

<link rel="icon" type="image/x-icon" href="/favicon.ico" />

<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<style>
:global(:root) {
font-family: system-ui;
padding: 2em 0;
}
:global(.counter) {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
place-items: center;
font-size: 2em;
grid-template-columns: repeat(3, minmax(0, 1fr));
margin-top: 2em;
place-items: center;
}
:global(.children) {
display: grid;
place-items: center;
margin-bottom: 2em;
place-items: center;
}
</style>
</head>
<body>
<main>
<Counter client:visible>
<h1>Hello Svelte!</h1>
<h1>Hello, Svelte!</h1>
</Counter>
</main>
</body>
Expand Down
3 changes: 0 additions & 3 deletions examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@
},
"devDependencies": {
"astro": "^0.20.12"
},
"snowpack": {
"workspaceRoot": "../.."
}
}
17 changes: 6 additions & 11 deletions examples/framework-vue/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,31 @@ import Counter from '../components/Counter.vue'
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width"
/>

<link rel="icon" type="image/x-icon" href="/favicon.ico" />

<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<style>
:global(:root) {
font-family: system-ui;
padding: 2em 0;
}
:global(.counter) {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
place-items: center;
font-size: 2em;
grid-template-columns: repeat(3, minmax(0, 1fr));
margin-top: 2em;
place-items: center;
}
:global(.children) {
display: grid;
place-items: center;
margin-bottom: 2em;
place-items: center;
}
</style>
</head>
<body>
<main>
<Counter client:visible>
<h1>Hello Vue!</h1>
<h1>Hello, Vue!</h1>
</Counter>
</main>
</body>
Expand Down
3 changes: 0 additions & 3 deletions examples/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@
},
"devDependencies": {
"astro": "^0.20.12"
},
"snowpack": {
"workspaceRoot": "../.."
}
}
3 changes: 0 additions & 3 deletions examples/portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@
},
"devDependencies": {
"astro": "^0.20.12"
},
"snowpack": {
"workspaceRoot": "../.."
}
}
3 changes: 0 additions & 3 deletions examples/starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@
},
"devDependencies": {
"astro": "^0.20.12"
},
"snowpack": {
"workspaceRoot": "../.."
}
}
3 changes: 0 additions & 3 deletions examples/with-markdown-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@
"rehype-toc": "^3.0.2",
"remark-code-titles": "^0.1.2",
"remark-slug": "^6.0.0"
},
"snowpack": {
"workspaceRoot": "../.."
}
}
3 changes: 0 additions & 3 deletions examples/with-markdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@
},
"devDependencies": {
"astro": "^0.20.12"
},
"snowpack": {
"workspaceRoot": "../.."
}
}
3 changes: 0 additions & 3 deletions examples/with-nanostores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,5 @@
},
"dependencies": {
"nanostores": "^0.3.3"
},
"snowpack": {
"workspaceRoot": "../.."
}
}
3 changes: 0 additions & 3 deletions examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@
"astro": "^0.20.12",
"autoprefixer": "^10.3.7",
"tailwindcss": "^2.2.17"
},
"snowpack": {
"workspaceRoot": "../.."
}
}
Loading

0 comments on commit 330620e

Please sign in to comment.