8000 Handle upcoming prism deprecations by Earlopain · Pull Request #431 · Shopify/packwerk · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Handle upcoming prism deprecations #431

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Earlopain
Copy link

What are you trying to accomplish?

Avoid prism deprecation warnings:

What approach did you choose and why?

Use the non-deprecated classes. Parser34 is available since 0.24.0 and can be used without concern. The builder is somewhat new, so I use defined? to check it and left a note for when it can be removed.

What should reviewers focus on?

I left more context in the two commit messages.

Type of Change

  • Bugfix
  • New feature
  • Non-breaking change (a change that doesn't alter functionality - i.e., code refactor, configs, etc.)

Additional Release Notes

  • Breaking change (fix or feature that would cause existing functionality to change)

Include any notes here to include in the release description. For example, if you selected "breaking change" above, leave notes on how users can transition to this version.

If no additional notes are necessary, delete this section or leave it unchanged.

Checklist

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • It is safe to rollback this change.

Since Shopify#388, prism is used to parse ruby code.
It uses `Prism::Translation::Parser` which always parses code as Ruby 3.4.
It's a behavior change, previously it parserd as the currently running ruby. I don't know
enough about packwerk to know if that makes issues.

Anyways, I plan to deprecate `Prism::Translation::Parser` because I've seen it used as a replacement
for `Parser::CurrentRuby` (like here), which it isn't.
prism requires its own builder class in order to emit ast for
versions that the parser gem doesn't support. The next prism
version will warn when a incorrect builder class is used,
it wasn't previously enforced.
@Earlopain Earlopain requested a review from a team as a code owner March 28, 2025 09:35
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.

1 participant
0