johno / johno/ember-list-filter
RFC: Ember 1.13+ Idiomatic Style
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
I'd like to open a discussion about some things for the future of the library. These changes would likely require a major-version bump.
### Positional Params
Change
``` hbs
{{list-filter list=myUserList partial='list-user' properties='name title description'}}
```
to
``` hbs
{{list-filter "name" "title" "description" list=myUserList partial='list-user'}}
```
It would still be possible to have `[ "id" ]` be the default (just check whether the `positionalParams` are empty). It feels a little weird to me, but I have no strong feelings on the subject.
### Block-Form
Change
``` hbs
{{list-filter list=myUserList partial='list-user' properties='name title description'}}
```
to
``` hbs
{{#list-filter list=myUserList properties='name title description' as |user|}}
{{link-to user.name user}}
{{/list-filter}}
```
### Decompose
There are places in our app where the `` and the `
- ` can't be next to one another in the DOM. Thus, while I love the "easy-use" version of `{{list-filter}}`, it would be nice to decompose it as something like
- {{link-to user.name user}}
``` hbs
{{#list-filter-container list=myUserList as |changeFilter filteredList|}}
Users
{{list-filter-input changeFilter=changeFilter}}
{{#each filteredList as |user|}}
{{/each}}
{{/list-filter-container}}
```
### Small Things
- change `list=` to `content=` to match `ArrayProxy`, which has influenced many other addons
- extract the filtering logic to a helper, make it easier to override
- use `Ember.get(obj, prop)` instead of `obj.get(prop)` to support bare JS objects
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the existing list-filter component and its current usage; the issue names no files or tests. First scope the proposed API changes, then define completion around an agreed direction for positional parameters, block form, decomposition, and the listed smaller changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100