Skip to content

feat(overlay): Add click to go to editor for audits#9016

Merged
Princesseuh merged 8 commits intomainfrom
feat/audit-to-editor
Nov 8, 2023
Merged

feat(overlay): Add click to go to editor for audits#9016
Princesseuh merged 8 commits intomainfrom
feat/audit-to-editor

Conversation

@Princesseuh
Copy link
Copy Markdown
Member

Changes

Needs withastro/compiler#375

Much like you can go to the editor for xray, now you can for audits.

Testing

Will be tested in a separate PR

Docs

N/A

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Nov 7, 2023

🦋 Changeset detected

Latest commit: 3962a6e

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Nov 7, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 7, 2023

⚖️ Bundle Size Check

Latest commit: 3962a6e

File Old Size New Size Change
dev-overlay/plugins/audit 14.11 KB 14.43 KB + 320 B

@github-actions github-actions bot added the pr: docs A PR that includes documentation for review label Nov 7, 2023
const newResponse = response.clone();
const /** @type {string} */ html = await newResponse.text();
const newhtml = html.replace('<h1>testing</h1>', '<h1>it works</h1>');
const newhtml = html.replace('testing', 'it works');
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this is a bit awkward. But since we now add attributes, those kind of naive replacements don't work in dev.

In my humble, informed, opinion, you shouldn't rely on string replaces like this anyway, because whitespaces, minification etc etc could ruin it anyway. Typically, I'd recommend people to use a real tool for this, like https://github.com/cloudflare/lol-html

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, such shade 🌨

@Princesseuh Princesseuh marked this pull request as ready for review November 8, 2023 12:49
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
@Princesseuh Princesseuh merged commit 1ecc9aa into main Nov 8, 2023
@Princesseuh Princesseuh deleted the feat/audit-to-editor branch November 8, 2023 14:29
@astrobot-houston astrobot-houston mentioned this pull request Nov 8, 2023
natemoo-re pushed a commit that referenced this pull request Nov 22, 2023
* feat(overlay): Add click to go to editor for audits

* chore: changeset

* chore: update compiler dep

* fix: tests

* Update packages/astro/src/core/compile/compile.ts

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>

* Update packages/astro/src/core/compile/compile.ts

---------

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope) pr: docs A PR that includes documentation for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants