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

Upgrade @glimmer/syntax to v0.82.0 #627

Conversation

lifeart
Copy link
Contributor

@lifeart lifeart commented Sep 16, 2021

looks like few errors from "fixers" for older ast syntax versions, and few from "glimmer-syntax" itself (like paddings for attribues)

@dcyriller
Copy link
Member

dcyriller commented Sep 23, 2021

Have you seen #401? It bumps glimmer syntax to 0.79.0. If we merge it, would it ease this upgrade?

@lifeart
Copy link
Contributor Author

lifeart commented Sep 23, 2021

@dcyriller nope, missed it, thank you for reference! I will try to merge it

@lifeart
Copy link
Contributor Author

lifeart commented Sep 24, 2021

@dcyriller @rwjblue looks like it's working

@lifeart lifeart force-pushed the attempt-to-get-latest-glimmer-syntax branch from 21bdb1f to 4e03d48 Compare September 24, 2021 18:50
@dcyriller dcyriller changed the title attempt to get latest glimmer syntax support Upgrade @glimmer/syntax to v0.80.0 Oct 5, 2021
@dcyriller dcyriller force-pushed the attempt-to-get-latest-glimmer-syntax branch 2 times, most recently from d117dd2 to c9c9559 Compare October 6, 2021 08:21
Copy link
Member

@dcyriller dcyriller left a comment

Choose a reason for hiding this comment

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

So first thank you for working on this @lifeart!

Sorry, it takes me time to review, I wanted to look at the changes in glimmer-vm, in particular I need to understand what ASTv1 is vs. ASTv2.

I rebased your commit and pushed another one. In this last commit I change the imports from import { ASTv1 } from ... to import { ASTv1 as AST }.

src/index.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
@dcyriller dcyriller self-assigned this Oct 15, 2021
@dcyriller dcyriller force-pushed the attempt-to-get-latest-glimmer-syntax branch from 76e18b7 to f9de578 Compare October 27, 2021 19:19
@dcyriller
Copy link
Member

dcyriller commented Oct 27, 2021

I pushed a couple other commits @lifeart. It looks ready to me. Do you mind taking another look?

src/parse-result.ts Outdated Show resolved Hide resolved
@lifeart
Copy link
Contributor Author

lifeart commented Oct 27, 2021

I pushed a couple other commits @lifeart. It looks ready to me. Do you mind taking another look?

Only one comment, changes itself looks good!

@dcyriller dcyriller force-pushed the attempt-to-get-latest-glimmer-syntax branch from f9de578 to dcf5118 Compare October 28, 2021 10:42
@dcyriller dcyriller changed the title Upgrade @glimmer/syntax to v0.80.0 Upgrade @glimmer/syntax to v0.82.0 Oct 28, 2021
lifeart and others added 6 commits October 28, 2021 19:06
This is a workaround to a change in builders.element
Here is how a synthetic node used to be defined in glimmer/syntax
v0.65.4:
```
export const SYNTHETIC: AST.SourceLocation = {
  source: '(synthetic)',
  start: { line: 1, column: 0 },
  end: { line: 1, column: 0 },
};
```
(source https://github.com/glimmerjs/glimmer-vm/blob/v0.65.4/packages/@glimmer/syntax/lib/builders.ts#L509-L513)

With the isSynthetic function, we want to know if a node is:
- synthetic (meaning created with a builder)
- has no location set -> if a location has been set, it will be used to
  position the node
see https://github.com/glimmerjs/glimmer-vm/blob/v0.65.4/packages/@glimmer/syntax/lib/builders.ts#L509-L513
```
export const SYNTHETIC: AST.SourceLocation = {
  source: '(synthetic)',
  start: { line: 1, column: 0 },
  end: { line: 1, column: 0 },
};
```
@dcyriller dcyriller force-pushed the attempt-to-get-latest-glimmer-syntax branch from aa1636d to 9012b37 Compare October 28, 2021 17:11
@dcyriller
Copy link
Member

dcyriller commented Oct 28, 2021

So... I think we've come to the most minimal changes to upgrade @glimmer/syntax from v0.65.0 to v0.82.0

I've rewritten the git history one last time, hoppping for a good documentation of the changes we made.

I've run the ember-template-lint test suite against this PR - it will make some tests fail (see #401 (comment) for more information).

I've run some manual perf benchmarks to confirm this upgrade doesn't have a negative impact.

Thanks a lot @lifeart!

@dcyriller dcyriller merged commit e647457 into ember-template-lint:master Oct 28, 2021
@lifeart lifeart deleted the attempt-to-get-latest-glimmer-syntax branch October 28, 2021 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants