Skip to content

Dynamic var params#14357

Closed
ef4 wants to merge 3 commits intoemberjs:masterfrom
ef4:dynamic-var-params
Closed

Dynamic var params#14357
ef4 wants to merge 3 commits intoemberjs:masterfrom
ef4:dynamic-var-params

Conversation

@ef4
Copy link
Contributor

@ef4 ef4 commented Sep 26, 2016

This is a feature under discussion in RFC 95, implemented behind a symbol.

It allows components to access dynamically scoped variables via:

import { DYNAMIC_VAR_PARAMS } from 'ember-glimmer/utils/process-args';
MyComponent.reopenClass({
  [ DYNAMIC_VAR_PARAMS ]: [ 'outletState' ]
})

I intend to use it next within the LinkComponent as part of a refactor to make link-to cleaner and faster.

This PR depends on glimmerjs/glimmer-vm#332 and #14355.

@homu
Copy link
Contributor

homu commented Sep 27, 2016

☔ The latest upstream changes (presumably #14361) made this pull request unmergeable. Please resolve the merge conflicts.

ef4 added 2 commits September 27, 2016 11:44
This cleans up and unifies the handling of curly comopnent arguments. It splits the work into two distinct phases

 - gatherArgs assembles an EvaluatedArgs that combines all variations of positional and named arguments into a single EvaluatedArgs object
 - ComponentArgs.create takes the EvaluatedArgs and produces the curly-component specific attrs & props structures with mutable cells, etc.
This is a feature under discussion in [RFC 95](emberjs/rfcs#95), implemented behind a symbol.

It allows components to access dynamically scoped variables via:

```js
import { DYNAMIC_VAR_PARAMS } from 'ember-glimmer/utils/process-args';
MyComponent.reopenClass({
  [ DYNAMIC_VAR_PARAMS ]: [ 'outletState' ]
})
```

I intend to use it next within the LinkComponent as part of a refactor to make link-to cleaner and faster.
@ef4 ef4 force-pushed the dynamic-var-params branch from a710ff5 to cc9ee0a Compare September 27, 2016 15:46
@ef4 ef4 force-pushed the dynamic-var-params branch from cc9ee0a to 57baf73 Compare September 27, 2016 20:26
@homu
Copy link
Contributor

homu commented Sep 29, 2016

☔ The latest upstream changes (presumably #13996) made this pull request unmergeable. Please resolve the merge conflicts.

@rwjblue
Copy link
Member

rwjblue commented Oct 27, 2016

I think that we decided not to move forward on this (and emberjs/rfcs#95 ended up sticking to get-outlet-state and set-outlet-state). I'm going to close this (based on that assumption), please reopen if you disagree...

@rwjblue rwjblue closed this Oct 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants