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

refactor the JSX plugin, improve performance #4405

Merged
merged 1 commit into from
Aug 22, 2022
Merged

Conversation

FredKSchott
Copy link
Member

Changes

  • Refactor the JSX plugin to move expensive work out of the hot code path
  • This actually was a nice chance to clean up the file a bit, move some code into helper functions, and remove some redundant code that was no longer needed due to Astro's internal JSX renderer.
  • NOTE: This changes one thing about current behavior, which is that it now prioritizes the explicit @jsxImportSource pragma over import scanning. I had assumed that the explicit pragma always beat out the implicit import scanning, and would make the case here that ignoring an explicit pragma is a bug. This change would only impact a user who had a @jsxImportSource to one framework and then ESM imports to another. I don't think that's realistic, but I thought I'd call it out here in case anyone feels differently.

Testing

  • Covered by existing tests
  • On a flight so can't perf test, but this should be worth merging regardless

Docs

  • N/A

@changeset-bot
Copy link

changeset-bot bot commented Aug 21, 2022

🦋 Changeset detected

Latest commit: eb0eddf

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

This PR includes changesets to release 13 packages
Name Type
astro Patch
@e2e/astro-component Patch
@e2e/error-react-spectrum Patch
@e2e/error-sass Patch
@e2e/errors Patch
@e2e/lit-component Patch
@e2e/preact-component Patch
@e2e/react-component Patch
@e2e/solid-component Patch
@e2e/solid-recurse Patch
@e2e/svelte-component Patch
@e2e/e2e-tailwindcss Patch
@e2e/ts-resolution Patch

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 Aug 21, 2022
@matthewp matthewp merged commit a70f69a into main Aug 22, 2022
@matthewp matthewp deleted the refactor-jsx-plugin branch August 22, 2022 18:25
This was referenced Aug 22, 2022
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants