-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Update table of contents component to glimmer #809
Update table of contents component to glimmer #809
Conversation
Let's avoid passing the 'projectId' argument to the TableOfContents component as it does not do anything with it.
Let's update the TableOfContents component to extend glimmer/component instead of ember/component. Glimmer components offer a bunch of various advantages over classic components and are the direction that ember is heading in general.
Right now, we mix both single quotes and double quotes throughout the template file. Let's prefer single quotes instead.
Let's prefer angle bracket syntax to curly syntax when invoking the TableOfContents component in our integration tests. This will fix deprecation warnings about using the latter, which make the test results a bit harder to decipher.
@@ -0,0 +1,44 @@ | |||
<ol class='toc-level-0'> |
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.
One note: this is not going to have the exact same DOM as we had before, in two ways:
- It won't accept
...attributes
, which@ember/component
implicitly did. - It won't have a wrapping
div
.
In this case, that should be fine: the rendering doesn't depend on the wrapping element (I checked!), but I wanted to flag it up for anyone who reads this PR later.
isShowingNamespaces=true | ||
}} | ||
<TableOfContents | ||
@showPrivateClasses={{true}} |
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.
Note for a follow-on: this currently uses two-way binding between an Input
in the implementation and a property on a service very far away. As a follow-up, we'll want to update that to actually just use normal event handling.
{{/if}} | ||
|
||
<li class='toc-level-0'> | ||
<a {{action 'toggle' 'classes'}} href='#' data-test-toc-title='classes'>Classes</a> |
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.
It is good that these didn't change in this case, but we'll definitely want to switch to {{on}}
in a follow-up.
</li> | ||
</ol> | ||
<label class='toc-private-toggle'> | ||
<Input @type='checkbox' @checked={{@showPrivateClasses}} class='private-deprecated-toggle' /> |
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.
And this is the two-way binding we'll want to replace.
This specific CI failure is happening on |
Let's update the TableOfContents component to extend glimmer/component instead of ember/component. Glimmer components offer a bunch of various advantages over classic components and are the direction that ember is
heading in general.
While we're here, let's prefer single quotes to double quotes throughout our template file and cleanup any unused arguments into this component.
Finally, let's make sure that we're using angle bracket syntax rather than curly brace syntax to invoke the component in our tests as this cleans up some deprecations logged when they are run.
This should resolve the
app/components/table-of-contents.js
section of #805.