-
Notifications
You must be signed in to change notification settings - Fork 54
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
use new glimmer ElementNode sub nodes #696
base: v1.x
Are you sure you want to change the base?
Changes from 9 commits
eb16ae6
eb75445
f0bf4c4
240b8d4
d9f6d21
3be0379
962ec06
a6f4f07
ef094ec
15286b9
bf1df59
7103b7d
3fedc71
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,6 +145,10 @@ function checkResolveError( | |
// we need to traverse up through the path to find the true parent. | ||
let sourceMapping = mapping.sourceNode.type === 'Identifier' ? mapping.parent : mapping; | ||
let parentNode = sourceMapping?.parent?.sourceNode; | ||
if (sourceMapping?.sourceNode.type === 'ElementNameNode') { | ||
sourceMapping = sourceMapping.parent; | ||
parentNode = sourceMapping?.parent?.sourceNode; | ||
} | ||
|
||
// If this error is on the first param to a {{component}} or other bind invocation, this means | ||
// we either have a non-component value or a string that's missing from the registry. | ||
|
@@ -176,7 +180,12 @@ function checkResolveError( | |
// Otherwise if this is on a top level invocation, we're trying to use a template-unaware | ||
// value in a template-specific way. | ||
let nodeType = sourceMapping?.sourceNode.type; | ||
if (nodeType === 'ElementNode' || nodeType === 'PathExpression' || nodeType === 'Identifier') { | ||
if ( | ||
nodeType === 'ElementNode' || | ||
nodeType === 'PathExpression' || | ||
nodeType === 'Identifier' || | ||
nodeType === 'ElementNameNode' | ||
) { | ||
return addGlintDetails( | ||
diagnostic, | ||
'The given value does not appear to be usable as a component, modifier or helper.' | ||
|
@@ -201,8 +210,8 @@ function checkImplicitAnyError( | |
|
||
// This error may appear either on `<Foo />` or `{{foo}}`/`(foo)` | ||
let globalName = | ||
sourceNode.type === 'ElementNode' | ||
? sourceNode.tag.split('.')[0] | ||
sourceNode.type === 'ElementNameNode' | ||
? sourceNode.value.split('.')[0] | ||
: sourceNode.type === 'PathExpression' && sourceNode.head.type === 'VarHead' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This kind of stuff should now work better, since |
||
? sourceNode.head.name | ||
: null; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { SafeString } from '@glimmer/runtime'; | ||
// @ts-expect-error cannot import, but we only need the type... | ||
import type { SafeString } from '@glimmer/runtime'; | ||
import { htmlSafe } from '@ember/template'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did it stop working? It seems to be here: https://github.com/glimmerjs/glimmer-vm/blob/v0.89.0/packages/%40glimmer/runtime/index.ts#L43 And I don't think we would want There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was the error:
|
||
import { emitContent } from '../-private/dsl'; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
"composite": true, | ||
"declaration": true, | ||
"sourceMap": true, | ||
"skipLibCheck": true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this may be controversial with the former ember-TS members, but I don't know of another way to have a node16 project interoperable with non-none16 projects There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer to fix this issue upstream in the glimmer side. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
"types": [] | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's up with these changes? 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not sure... i just run vite --update & prettier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, wait, I did add a space in case its empty attributes