Skip to content

chore: refactor analysis #12651

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

Merged
merged 62 commits into from
Jul 30, 2024
Merged

chore: refactor analysis #12651

merged 62 commits into from
Jul 30, 2024

Conversation

Rich-Harris
Copy link
Member

@Rich-Harris Rich-Harris commented Jul 29, 2024

Been wanting to do this for a long time — have a single visitor per node type in the analysis phase, so we have more precise control and easier-to-follow code

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests and linting

  • Run the tests with pnpm test and lint the project with pnpm lint

Copy link

changeset-bot bot commented Jul 29, 2024

🦋 Changeset detected

Latest commit: d0a3678

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

This PR includes changesets to release 1 package
Name Type
svelte 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

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

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

Trusting our good test coverage here and not thoroughly reviewing every line - looks good, only found a few outdated comments and possibility to remove some import(...) statements

Comment on lines 133 to 134
// TODO it would be better to just bail out when we hit the ExportSpecifier node but that's
// not currently possibly because of our visitor merging, which I desperately want to nuke
Copy link
Member

Choose a reason for hiding this comment

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

You nuked it :D

Suggested change
// TODO it would be better to just bail out when we hit the ExportSpecifier node but that's
// not currently possibly because of our visitor merging, which I desperately want to nuke

Comment on lines 69 to 70
// Ideally this would be in the validation file, but that isn't possible because this visitor
// calls "next" before setting the reactive statements.
Copy link
Member

Choose a reason for hiding this comment

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

Outdated

Suggested change
// Ideally this would be in the validation file, but that isn't possible because this visitor
// calls "next" before setting the reactive statements.

e.style_directive_invalid_modifier(node);
}

// the case for node.value different from true is already covered by the Identifier visitor
Copy link
Member

Choose a reason for hiding this comment

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

Outdated (and now wrong) comment

Suggested change
// the case for node.value different from true is already covered by the Identifier visitor

@Rich-Harris Rich-Harris merged commit 71c373d into main Jul 30, 2024
9 checks passed
@Rich-Harris Rich-Harris deleted the refactor-analysis branch July 30, 2024 22:21
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