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

Cleanup unused JSX code #11741

Merged
merged 8 commits into from
Aug 20, 2024
Merged

Cleanup unused JSX code #11741

merged 8 commits into from
Aug 20, 2024

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Aug 16, 2024

Changes

linear issue: PLT-1935

Removes unused code as previously I've refactored the logic into @astrojs/mdx already:

  • astro/jsx/babel.js
  • astro/jsx/component.js
  • astro/jsx/index.js
  • astro/jsx/renderer.js
  • astro/jsx/server.js (moved to @astrojs/mdx/server.js)
  • astro/jsx/transform-options.js

There's only astro/jsx/rehype.js left as it includes code tied to the astro metadata by Vite plugins. We could move it into @astrojs/mdx too, but that may expose more internal stuff than wanted.

Testing

Existing tests should pass. I also deleted some outdated jsx test for this.

Docs

I added a major changeset to astro, and only a minor for @astrojs/mdx as the change there is technically not breaking. I expect that this change shouldn't affect many people as long as they have @astrojs/mdx v3, which was released since 9th May 2024.

Copy link

changeset-bot bot commented Aug 16, 2024

🦋 Changeset detected

Latest commit: 84d91d7

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: integration Related to any renderer integration (scope) pkg: astro Related to the core `astro` package (scope) semver: major Change triggers a `major` release labels Aug 16, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This PR is blocked because it contains a major changeset. A reviewer will merge this at the next release if approved.

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

This change must be reflected in the following places:

serverEntrypoint: 'astro/jsx/server.js',

export function getContainerRenderer(): ContainerRenderer {
return {
name: 'astro:jsx',
serverEntrypoint: 'astro/jsx/server.js',
};
}

@bluwy
Copy link
Member Author

bluwy commented Aug 19, 2024

The first one will be removed, and the second is already updated?

@sarah11918
Copy link
Member

@bluwy Is there a linear task in the 5.0 project associated with this breaking change? I think this should be added to the breaking changes section of the upgrade guide, and I've been tracking that we don't miss any of those by Linear issue number.

@bluwy
Copy link
Member Author

bluwy commented Aug 19, 2024

Sorry this is related to PLT-1935 but I forgot to link it back. Yeah I'm planning to write this in the migration guide once the docs/changesets here are reviewed.

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Looks good @bluwy ! I don't think you need to go full "breaking change upgrade guide format" on the Astro major, but I still would like that in the 5.0 upgrade guide when it comes time! Some thoughts below for your consideration!

.changeset/many-garlics-lick.md Outdated Show resolved Hide resolved
.changeset/many-garlics-lick.md Outdated Show resolved Hide resolved
.changeset/perfect-fans-fly.md Show resolved Hide resolved
Co-authored-by: Sarah Rainsberger <[email protected]>
@bluwy bluwy merged commit 6617491 into next Aug 20, 2024
13 checks passed
@bluwy bluwy deleted the mdx-cleanup branch August 20, 2024 09:39
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) pkg: integration Related to any renderer integration (scope) semver: major Change triggers a `major` release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants