Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make dev overlay lazy #1641

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

brenelz
Copy link
Contributor

@brenelz brenelz commented Sep 29, 2024

PR Checklist

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • infrastructure changes
  • Other... Please describe:

What is the current behavior?

The current behavior is that the syntax highligher always loads with the pages even when there is no error

image

What is the new behavior?

The new behavior makes the dev overlay lazy so it only loads the syntax highlighting when their is an actual error.

I may be misunderstanding something, and this won't work but seems like it would.

image

Copy link

changeset-bot bot commented Sep 29, 2024

⚠️ No Changeset found

Latest commit: da9ed21

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@lxsmnsyc
Copy link
Member

clientOnly is already lazy. The reason we need clientOnly is because part of the component loads libraries that are meant to be on the client-side.

@brenelz
Copy link
Contributor Author

brenelz commented Sep 29, 2024

Yeah maybe I don't understand clientOnly vs lazy. I just noticed it loads the shiki library even when the overlay isn't present in dev mode. I'd think it would only load that javascript if the <DevOverlay /> is shown?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants