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

Adds source file properties to HTML elements only if devToolbar is enabled #9343

Merged
merged 2 commits into from Dec 6, 2023

Conversation

martrapp
Copy link
Member

@martrapp martrapp commented Dec 6, 2023

Changes

When the compiler was called, only astro.config.devToolbar was checked to activate the source annotations, but not AstroPerferences.
Now the code mimics the check that we use in router.ts to activate devToolbar.

Closes #9324

Note: The astro.config setting currently takes precedence over preferences. If astro.config.devToolbar === false, preferences cannot turn it back on. I think we should not use preferences and astro.config together or at least give astro.config a lower priority between preferences.global and preferences.default. See thread in #maintainers from this morning (6:40 GMT)

Testing

Manually tested

Docs

Depending on how complicate the final solution might get :)

Copy link

changeset-bot bot commented Dec 6, 2023

🦋 Changeset detected

Latest commit: 50c4d0e

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 pkg: astro Related to the core `astro` package (scope) docs pr A PR that includes documentation for review labels Dec 6, 2023
Copy link
Member

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

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

Looks great to me! We can revisit the priority thing separately from this. It can definitely be a little bit confusing.

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Thanks, this seems great!

@martrapp martrapp merged commit ab0281a into main Dec 6, 2023
13 checks passed
@martrapp martrapp deleted the mt/source_file branch December 6, 2023 15:20
@astrobot-houston astrobot-houston mentioned this pull request Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs pr A PR that includes documentation for review pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

data-astro-source-file added when devToolbar disabled
3 participants