Skip to content

Fixes deprecated usage of node.path.orignal in htmlbars-plugin #321

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 1 commit into
base: master
Choose a base branch
from

Conversation

syphe
Copy link

@syphe syphe commented Sep 3, 2024

The original property on literal nodes is deprecated: https://github.com/glimmerjs/glimmer-vm/blob/10eae7429b702b1e7f5434b91802d5767ff7ad9a/packages/%40glimmer/syntax/lib/v1/legacy-interop.ts#L130

This PR adds a check to see whether the path is one of the literal node paths, and if so does not access the original property

@syphe
Copy link
Author

syphe commented Sep 3, 2024

Could also change the check for literal's to either endsWith 'Literal', or check only for path.node.type === 'PathExpression'

@@ -62,15 +62,15 @@ module.exports = class ClassTransformPlugin {
}

transformStatement(node) {
if (node.path.original === 'local-class') {
if (!this.isNodePathLiteral(node.path) && node.path.original === 'local-class') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we fix this differently by using either .original or .value?

Copy link
Author

Choose a reason for hiding this comment

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

Honestly it's been so long since I've looked at this issue, I can't tell you what I expected to see anymore, but suspect it was just the warning "spew" as you say in your attempt.

@RobbieTheWagner
Copy link
Contributor

RobbieTheWagner commented Apr 21, 2025

This was my attempted fix #322

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