Skip to content

Commit

Permalink
respond to final code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Mar 18, 2022
1 parent 4ffc259 commit 659ad8d
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 31 deletions.
4 changes: 1 addition & 3 deletions examples/env-vars/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { defineConfig } from 'astro/config';

// https://astro.build/config
export default defineConfig({
integrations: [],
});
export default defineConfig({});
2 changes: 1 addition & 1 deletion examples/framework-alpine/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { defineConfig } from 'astro/config';

// https://astro.build/config
export default defineConfig({
// No renderers are needed for AlpineJS support, just use Astro components!
// No integrations are needed for AlpineJS support, just use Astro components!
integrations: [],
});
2 changes: 1 addition & 1 deletion examples/framework-lit/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import lit from '@astrojs/lit';

// https://astro.build/config
export default defineConfig({
// Enable the lit renderer to support LitHTML components and templates.
// Enable Lit to support LitHTML components and templates.
integrations: [lit()],
});
8 changes: 3 additions & 5 deletions examples/integrations-playground/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Astro + Lit Example
# Integration Playground

```
npm init astro -- --template framework-lit
npm init astro -- --template integration-playground
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/framework-lit)

This example showcases Astro working with [Lit](https://lit.dev/).
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/integration-playground)
4 changes: 2 additions & 2 deletions examples/integrations-playground/src/pages/foo.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
// Page 2!
import Button from '../components/Button.jsx';
import Link from '../components/Link.jsx';
---

<!DOCTYPE html>
Expand All @@ -10,6 +10,6 @@ import Button from '../components/Button.jsx';
<title>Demo: Page 2</title>
</head>
<body>
<Button to="/" text="Go Home" />
<Link to="/" text="Go Home" />
</body>
</html>
25 changes: 18 additions & 7 deletions examples/integrations-playground/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Lorem from '../components/Lorem.astro';
import Button from '../components/Button.jsx';
import Link from '../components/Link.jsx';
import '../components/Test.js';
import '../components/Counter.js';
---
Expand All @@ -13,25 +13,36 @@ import '../components/Counter.js';
</head>
<body>
<h1 class="px-4 py-4">Test app</h1>
<h2 >Test app</h2>
<h2 class="partytown-status">
<strong>Party Mode!</strong>
Colors changing = partytown is enabled
</h2>
<my-counter client:load></my-counter>
<Button to="/foo" text="Go to Page 2" />
<Link to="/foo" text="Go to Page 2" />
<Lorem />
<calc-add num={33}></calc-add>


<script type="text/partytown">
console.log('start to block')
console.log(`Nah. you won't be blocked`)
// Remove `type="text/partytown"` to see this block the page
// and cause the page to become unresponsive
console.log('start partytown blocking script')
const now = Date.now()
let count = 1;
while (Date.now() - now < 10000) {
if (Date.now() - now > count * 1000) {
console.log('blocking');
console.log('blocking', count);
count += 1;
}
}
console.log('end block')
console.log('end partytown blocking script')
</script>

<script>
setInterval(() => {
const randomColor = Math.floor(Math.random()*16777215).toString(16);
document.querySelector('.partytown-status').style.color = "#" + randomColor;
}, 100);
</script>
<style>
h1, h2 {
Expand Down
5 changes: 1 addition & 4 deletions examples/non-html-pages/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { defineConfig } from 'astro/config';

// https://astro.build/config
export default defineConfig({
// Comment out "integrations: []" to enable Astro's default component support.
integrations: [],
});
export default defineConfig({});
5 changes: 1 addition & 4 deletions examples/starter/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { defineConfig } from 'astro/config';

// https://astro.build/config
export default defineConfig({
// Set "integrations" to "[]" to disable all default, builtin component support.
integrations: [],
});
export default defineConfig({});
1 change: 0 additions & 1 deletion examples/with-markdown-plugins/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import addClasses from './add-classes.mjs';

// https://astro.build/config
export default defineConfig({
integrations: [],
// Enable Custom Markdown options, plugins, etc.
markdownOptions: {
render: [
Expand Down
1 change: 0 additions & 1 deletion examples/with-markdown-shiki/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import astroRemark from '@astrojs/markdown-remark';

// https://astro.build/config
export default defineConfig({
integrations: [],
// Enable Custom Markdown options, plugins, etc.
markdownOptions: {
render: [
Expand Down
1 change: 0 additions & 1 deletion examples/with-vite-plugin-pwa/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { VitePWA } from 'vite-plugin-pwa';

// https://astro.build/config
export default defineConfig({
integrations: [],
vite: {
plugins: [VitePWA()],
},
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/core/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export async function validateConfig(userConfig: any, root: string): Promise<Ast
const fileProtocolRoot = pathToFileURL(root + path.sep);
// Manual deprecation checks
/* eslint-disable no-console */
if (userConfig.renderers) {
if (userConfig.hasOwnProperty('renderers')) {
console.error('Astro "renderers" are now "integrations"!');
console.error('Update your configuration and install new dependencies:');
try {
Expand Down

0 comments on commit 659ad8d

Please sign in to comment.