-
Notifications
You must be signed in to change notification settings - Fork 1
WIP fill in style guide with current Ember standards #32
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,12 @@ | |
| ## Table Of Contents | ||
|
|
||
| * [General](#general) | ||
| * [Class syntax](#class-syntax) | ||
| * [Computed Properties](#computed-properties) | ||
| * [Components](#components) | ||
| * [Data down Actions Up](#data-down-actions-up) | ||
| * [Glimmer Components](glimmer-components) | ||
| * [Tailwind CSS](tailwind-css) | ||
| * [Templates](#templates) | ||
| * [Tests](#tests) | ||
|
|
||
|
|
@@ -68,10 +72,25 @@ ember g component my-component --pod | |
| ``` | ||
| ## Components | ||
|
|
||
| ### Modals | ||
|
|
||
| - Standardized classes for modal design | ||
|
|
||
|
|
||
| ### UI:Button | ||
|
|
||
| - Always use, as we set `type=button` | ||
|
|
||
| ### Do not create components in zapatos | ||
|
|
||
| We used to share components by adding it to zapatos, but we're moving away from this practice. Please share components by adding it to `/components` | ||
|
|
||
| ## Class Syntax | ||
|
|
||
| ### TODO | ||
|
|
||
| For routes, controllers, components | ||
|
|
||
| ## Computed Properties | ||
|
|
||
|
|
||
|
|
@@ -116,8 +135,35 @@ fullName: computed('firstName', 'lastName', { | |
|
|
||
| ``` | ||
|
|
||
| ## Glimmer Components | ||
|
|
||
| ### Component Args | ||
|
|
||
| - constructor with setting local props, args with objects, chain in template or getter in JS? | ||
|
|
||
| ### Tracked properties | ||
|
|
||
| - Concerns for mixed use of computed props passed down from existing controllers | ||
|
|
||
| ### Computed properties | ||
|
|
||
| - Using computed properties instead of getter and setter | ||
|
|
||
|
|
||
| ## Tailwind CSS | ||
|
|
||
| - Using important when tailwind css is overwritten or adding to scss? | ||
|
Author
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. @kamal @esbanarango any thoughts on when to add to scss vs use tailwind |
||
|
|
||
|
|
||
|
|
||
| ## Templates | ||
|
|
||
| ### Actions | ||
|
Author
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. Perhaps Need to document use of |
||
|
|
||
| - Triggering single boolean property, use `action` or `mut`? | ||
|
Author
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.
docs: articles:
Contributor
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. Side note: I find |
||
|
|
||
| ### Block Syntax | ||
|
|
||
| ### {{#each}} - Specifying Keys | ||
|
|
||
| To improve rendering speed, the `{{#each}}` helper favors reusing it's inner block. Behind the scenes Ember compares the identity of each object in the array. Where there is a difference that inner inner dom will be torn down and rerendered. By passing a `key` param we inform `{{#each}}` that it should only tear down its inner dom when a specific property has changed. This is important because componments with state will lose their state when torn down and rerenderd. Specifying a key is one way to make sure this doesn't happen on accident. [more info](https://api.emberjs.com/ember/3.20/classes/Ember.Templates.helpers/methods/each?anchor=each)... | ||
|
|
@@ -126,6 +172,12 @@ To improve rendering speed, the `{{#each}}` helper favors reusing it's inner blo | |
| {{#each array key="<someProp>|@index|@identity" |item|}} | ||
| ``` | ||
|
|
||
| We should always use the key, I can't think of a reason it would hurt us. | ||
|
|
||
| ## Named Blocks | ||
|
|
||
| - | ||
|
|
||
| ### Don't use partials | ||
|
|
||
| Use components instead of partials. | ||
|
|
||
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.
need to discuss these two again