-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,179 additions
and
445 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"astro": minor | ||
--- | ||
|
||
Adds support for page mutations to the audits in the dev toolbar. Astro will now rerun the audits whenever elements are added or deleted from the page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"astro": minor | ||
--- | ||
|
||
Updates the UI for dev toolbar audits with new information |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/astro/e2e/fixtures/dev-toolbar/src/pages/audits-mutations-2.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
import Layout from "../layout/Layout.astro"; | ||
--- | ||
|
||
<Layout> | ||
<button id="bad-button-2">Click me to add an image that is missing an alt!</button> | ||
<a id="link-to-1" href="/audits-mutations">Go to Mutations 1</a> | ||
|
||
<br /><br /><br /> | ||
<img src="" width="100" height="100" /> | ||
|
||
<script> | ||
document.addEventListener('astro:page-load', () => { | ||
const badButton = document.getElementById('bad-button-2'); | ||
if (!badButton) return; | ||
|
||
badButton.addEventListener('click', clickHandler); | ||
|
||
function clickHandler() { | ||
const img = document.createElement('img'); | ||
img.width = 100; | ||
img.height = 100; | ||
|
||
document.body.appendChild(img); | ||
console.log("Image added to the page") | ||
} | ||
}) | ||
</script> | ||
</Layout> |
28 changes: 28 additions & 0 deletions
28
packages/astro/e2e/fixtures/dev-toolbar/src/pages/audits-mutations.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
import Layout from "../layout/Layout.astro"; | ||
--- | ||
|
||
<Layout> | ||
<button id="bad-button">Click me to add an image that is missing an alt!</button> | ||
<a id="link-to-2" href="/audits-mutations-2">Go to Mutations 2</a> | ||
|
||
<img src="" width="100" height="100" /> | ||
|
||
<script> | ||
document.addEventListener('astro:page-load', () => { | ||
const badButton = document.getElementById('bad-button'); | ||
if (!badButton) return; | ||
|
||
badButton.addEventListener('click', clickHandler); | ||
|
||
function clickHandler() { | ||
const img = document.createElement('img'); | ||
img.width = 100; | ||
img.height = 100; | ||
|
||
document.body.appendChild(img); | ||
console.log("Image added to the page") | ||
} | ||
}) | ||
</script> | ||
</Layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.