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

Splat redux with es6-ish syntax #1149

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
@machty
Contributor

machty commented Dec 10, 2015

This PR includes and improves upon the first splat PR (#1128) based on discussions within #1050. Specifically, this PR provides (or will provide):

  • ES6-ish ...-based splatting syntax
  • splatting for hashes
  • splatting for positional params
  • splatting subexpressions e.g. ...(wat)

@machty machty referenced this pull request Dec 10, 2015

Closed

Splat operator #1050

@machty

This comment has been minimized.

Show comment
Hide comment
@machty

machty Dec 11, 2015

Contributor

@kpdecker @nathanhammond @BenjaminHorn this is ready for review now; just got splatting positional params and subexpressions to work.

Notes:

  • I haven't figured out how to de-dupe the new grammar; I tried SPLAT? but it yielded grammar conflicts, even though to my eyes that's functionally equivalent to the grammar I explicitly specify
  • positional param splatting works as follows: if there's no splats, there's no change to how helpers are called today; if there's at least one splat, instead doing a .call on the helper, we first invoke a new runtime function splatArgs and then .apply those to the helper function.
  • I didn't implement splatting the various helper method missing methods; I'm not sure it's worth the bloat?
Contributor

machty commented Dec 11, 2015

@kpdecker @nathanhammond @BenjaminHorn this is ready for review now; just got splatting positional params and subexpressions to work.

Notes:

  • I haven't figured out how to de-dupe the new grammar; I tried SPLAT? but it yielded grammar conflicts, even though to my eyes that's functionally equivalent to the grammar I explicitly specify
  • positional param splatting works as follows: if there's no splats, there's no change to how helpers are called today; if there's at least one splat, instead doing a .call on the helper, we first invoke a new runtime function splatArgs and then .apply those to the helper function.
  • I didn't implement splatting the various helper method missing methods; I'm not sure it's worth the bloat?
Show outdated Hide outdated lib/handlebars/compiler/compiler.js
let params = this.setupFullMustacheParams(decorator, program, undefined),
let setup = this.setupFullMustacheParams(decorator, program, undefined),
params = setup.params,
splatMap = setup.splatMap,

This comment has been minimized.

@kpdecker

kpdecker Dec 12, 2015

Collaborator

nit: Should we use destructuring here? (I forget what exact rules Handlebars has enabled, it was one of the earlier ES6 projects for me so it is likely a bit more conservative than need be)

@kpdecker

kpdecker Dec 12, 2015

Collaborator

nit: Should we use destructuring here? (I forget what exact rules Handlebars has enabled, it was one of the earlier ES6 projects for me so it is likely a bit more conservative than need be)

shouldThrow(function() {
astFor('{{foo ...=lol ...baz}}');
}, Error, /Parse error on line 1/);

This comment has been minimized.

@kpdecker

kpdecker Dec 12, 2015

Collaborator

Is {{foo ...=lol baz}} invalid as well?

@kpdecker

kpdecker Dec 12, 2015

Collaborator

Is {{foo ...=lol baz}} invalid as well?

This comment has been minimized.

@machty

machty Dec 12, 2015

Contributor

Yes, I'll add a test. Basically this PR doesn't change the rule that params are on the left, hashy things on the right.

@machty

machty Dec 12, 2015

Contributor

Yes, I'll add a test. Basically this PR doesn't change the rule that params are on the left, hashy things on the right.

@@ -85,6 +85,23 @@ export function template(templateSpec, env) {
return typeof current === 'function' ? current.call(context) : current;
},
splat: function() {
return Utils.extend.apply(null, arguments);

This comment has been minimized.

@kpdecker

kpdecker Dec 12, 2015

Collaborator

What is the first argument passed here? Are we ok with it being modified in all cases?

@kpdecker

kpdecker Dec 12, 2015

Collaborator

What is the first argument passed here? Are we ok with it being modified in all cases?

This comment has been minimized.

@kpdecker

kpdecker Dec 12, 2015

Collaborator

Just saw this so please disregard :) Do we have test coverage asserting that the first object is not mutated?

@kpdecker

kpdecker Dec 12, 2015

Collaborator

Just saw this so please disregard :) Do we have test coverage asserting that the first object is not mutated?

Show outdated Hide outdated lib/handlebars/compiler/javascript-compiler.js
this.hash = this.hashes.pop();
let hashPieces = this.hashPieces;
this.hashPieces = this.hashes.pop();
this.hashPiece = this.hashPieces && this.hashPieces[this.hashPieces.length - 1];

This comment has been minimized.

@kpdecker

kpdecker Dec 12, 2015

Collaborator

What is this bit of code doing here?

@kpdecker

kpdecker Dec 12, 2015

Collaborator

What is this bit of code doing here?

This comment has been minimized.

@machty

machty Dec 12, 2015

Contributor

What use to just be stack of hash objects is now a stack of hash piece arrays, and this.hashPiece refers to the last (current) hashPiece, so we restore it to that last element unless we've popped off all the hash piece arrays.

@machty

machty Dec 12, 2015

Contributor

What use to just be stack of hash objects is now a stack of hash piece arrays, and this.hashPiece refers to the last (current) hashPiece, so we restore it to that last element unless we've popped off all the hash piece arrays.

This comment has been minimized.

@kpdecker

kpdecker Dec 12, 2015

Collaborator

Ok, maybe we can put a comment in the code to explain the restore operation?

@kpdecker

kpdecker Dec 12, 2015

Collaborator

Ok, maybe we can put a comment in the code to explain the restore operation?

]);
},
helperFunctionCall: function(helperName, helperOptions, splatMap) {
if (splatMap) {
let splatMapObj = {};

This comment has been minimized.

@kpdecker

kpdecker Dec 12, 2015

Collaborator

Any thoughts on performance/code size of this vs. array with missing values notation? I.e. [,,1] vs. {"2":1}.

@kpdecker

kpdecker Dec 12, 2015

Collaborator

Any thoughts on performance/code size of this vs. array with missing values notation? I.e. [,,1] vs. {"2":1}.

This comment has been minimized.

@machty

machty Sep 30, 2017

Contributor

I don't know, don't have the perf wizard knowledge myself.

@machty

machty Sep 30, 2017

Contributor

I don't know, don't have the perf wizard knowledge myself.

Show outdated Hide outdated lib/handlebars/compiler/javascript-compiler.js
}
let argsWithSplatMap = helperOptions.params.slice();
argsWithSplatMap.push(this.objectLiteral(splatMapObj));

This comment has been minimized.

@kpdecker

kpdecker Dec 12, 2015

Collaborator

nit: Can we do a concat here to avoid the intermediate array from the slice operation?

@kpdecker

kpdecker Dec 12, 2015

Collaborator

nit: Can we do a concat here to avoid the intermediate array from the slice operation?

This comment has been minimized.

@jamesarosen

jamesarosen Dec 17, 2016

push mutates. concat returns a new array. Either way the goal seems to be to create a new array to avoid mutating helperOptions.params. Though I suppose VMs might optimize a.concat(b) in ways they can't a.slice().push(b).

@jamesarosen

jamesarosen Dec 17, 2016

push mutates. concat returns a new array. Either way the goal seems to be to create a new array to avoid mutating helperOptions.params. Though I suppose VMs might optimize a.concat(b) in ways they can't a.slice().push(b).

Show outdated Hide outdated lib/handlebars/runtime.js
},
splatArgs: function() {
let splatMap = arguments[arguments.length - 1];

This comment has been minimized.

@kpdecker

kpdecker Dec 12, 2015

Collaborator

nit: Would the code be clearer here if we did splatArgs(args, splatMap) {} rather than trying to extract from the end of the args list?
Alt: Lets pass splatMap as the first parameter so we can avoid the .length - 1 gymnastics.

@kpdecker

kpdecker Dec 12, 2015

Collaborator

nit: Would the code be clearer here if we did splatArgs(args, splatMap) {} rather than trying to extract from the end of the args list?
Alt: Lets pass splatMap as the first parameter so we can avoid the .length - 1 gymnastics.

@kpdecker

This comment has been minimized.

Show comment
Hide comment
@kpdecker

kpdecker Dec 12, 2015

Collaborator

@machty Generally this looks really good, had a few minor comments. Responding to your notes:

  1. I've seen similar issues when trying to do the same. Sometimes Jison gives ambiguous productions for things that to me seem like they should be unambiguous and are the same as the duplicated listing. Since it's in the compiler I'm not too worried about it not being completely DRY.
  2. Perfect
  3. For blockHelperMissing, that code is only run if the template has no args or hash, so you are correct that no changes are needed.
Collaborator

kpdecker commented Dec 12, 2015

@machty Generally this looks really good, had a few minor comments. Responding to your notes:

  1. I've seen similar issues when trying to do the same. Sometimes Jison gives ambiguous productions for things that to me seem like they should be unambiguous and are the same as the duplicated listing. Since it's in the compiler I'm not too worried about it not being completely DRY.
  2. Perfect
  3. For blockHelperMissing, that code is only run if the template has no args or hash, so you are correct that no changes are needed.
@kpdecker

This comment has been minimized.

Show comment
Hide comment
@kpdecker

kpdecker Feb 24, 2016

Collaborator

Pong?

Collaborator

kpdecker commented Feb 24, 2016

Pong?

@machty

This comment has been minimized.

Show comment
Hide comment
@machty

machty Feb 24, 2016

Contributor

We've been holding off on pulling the trigger on this while we flesh out some remaining semantics on the Ember side of things, particularly related to how splatting will work for so-called angle-bracket components.

Contributor

machty commented Feb 24, 2016

We've been holding off on pulling the trigger on this while we flesh out some remaining semantics on the Ember side of things, particularly related to how splatting will work for so-called angle-bracket components.

@joeyjiron06

This comment has been minimized.

Show comment
Hide comment
@joeyjiron06

joeyjiron06 Feb 26, 2016

when do you think this will get in? im desperately waiting for this :)

joeyjiron06 commented Feb 26, 2016

when do you think this will get in? im desperately waiting for this :)

@rtablada

This comment has been minimized.

Show comment
Hide comment
@rtablada

rtablada commented Mar 23, 2016

@machty I want Spready

@morhook

This comment has been minimized.

Show comment
Hide comment
@morhook

morhook Apr 18, 2016

I like this!!

morhook commented Apr 18, 2016

I like this!!

@foxnewsnetwork

This comment has been minimized.

Show comment
Hide comment
@foxnewsnetwork

foxnewsnetwork May 8, 2016

While we're waiting spread and splat to come out in 5.0.0 handlebars, I wrote up a small Ember addon that handles spreading for Ember's component helper here: https://github.com/foxnewsnetwork/ember-component-helpers

That can be used by users of Ember2.0 and above like this:

Ember.Controller.extend({
  arrayArgs: ["admin.posts.post", 33, {class: "mdl-navigation__link", tagName: "li"}]
});
{{#component-apply "link-to" arrayArgs}}
  Your Link Text
{{/component-apply}}

You know, in case anyone else is particularly hungry for the spread after 1 year of waiting for it to come out like 2 straight months of looking at @rtablada 's animated gif of butter being spread on bread

foxnewsnetwork commented May 8, 2016

While we're waiting spread and splat to come out in 5.0.0 handlebars, I wrote up a small Ember addon that handles spreading for Ember's component helper here: https://github.com/foxnewsnetwork/ember-component-helpers

That can be used by users of Ember2.0 and above like this:

Ember.Controller.extend({
  arrayArgs: ["admin.posts.post", 33, {class: "mdl-navigation__link", tagName: "li"}]
});
{{#component-apply "link-to" arrayArgs}}
  Your Link Text
{{/component-apply}}

You know, in case anyone else is particularly hungry for the spread after 1 year of waiting for it to come out like 2 straight months of looking at @rtablada 's animated gif of butter being spread on bread

@workmanw

This comment has been minimized.

Show comment
Hide comment
@workmanw

workmanw May 12, 2016

Just curious if there is any update on this. We could badly use this in our app. :)

workmanw commented May 12, 2016

Just curious if there is any update on this. We could badly use this in our app. :)

@vomchik

This comment has been minimized.

Show comment
Hide comment
@vomchik

vomchik commented Jun 2, 2016

+1

@knownasilya

This comment has been minimized.

Show comment
Hide comment
@knownasilya

knownasilya Nov 21, 2016

What's the status on this?

knownasilya commented Nov 21, 2016

What's the status on this?

@sglanzer

This comment has been minimized.

Show comment
Hide comment
@sglanzer

sglanzer Nov 21, 2016

For anyone looking for another option while waiting https://github.com/ciena-blueplanet/ember-spread is mixin based, but works with dynamic hashes

sglanzer commented Nov 21, 2016

For anyone looking for another option while waiting https://github.com/ciena-blueplanet/ember-spread is mixin based, but works with dynamic hashes

@knownasilya

This comment has been minimized.

Show comment
Hide comment
@knownasilya

knownasilya Nov 21, 2016

On another note, splats might work better as Element Modifiers (emberjs/rfcs#112), e.g. {{my-comp (splat params)}} or <my-comp {{splat params}}/>.

The downside is that element modifiers look like positional params, as @dfreeman mentioned on Slack.

knownasilya commented Nov 21, 2016

On another note, splats might work better as Element Modifiers (emberjs/rfcs#112), e.g. {{my-comp (splat params)}} or <my-comp {{splat params}}/>.

The downside is that element modifiers look like positional params, as @dfreeman mentioned on Slack.

jamesarosen added a commit to jamesarosen/ember-i18n that referenced this pull request Dec 20, 2016

t helper supports context object
Previously, the `{{t}}` helper, like the `i18n.t` utility, accepted a
translation key and a context hash. This worked when the Handlebars template
had the individual keys and values (or value bindings) for the context,
but didn't when there was a pre-built object that represented the context.

Now it accepts a second ordered (non-hash) argument that represents the
context as an object. Hash context properties override those from
the context object.

```hbs
{{t 'some.key' someObject prop=value}}
```

is approximately the same as

```js
i18n.t('some.key', Object.assign({}, someObject, { prop: value }))
```

This is a workaround for the fact that Handlebars does not yet have a syntax
for splatting an object into hash arguments.

See wycats/handlebars.js#1050
See wycats/handlebars.js#1128
See wycats/handlebars.js#1149
Closes #423
@GCheung55

This comment has been minimized.

Show comment
Hide comment
@GCheung55

GCheung55 Feb 28, 2017

Any updates on this? How can people help to get this merged?

GCheung55 commented Feb 28, 2017

Any updates on this? How can people help to get this merged?

@gnapse

This comment has been minimized.

Show comment
Hide comment
@gnapse

gnapse May 9, 2017

Still nothing on this? I keep coming back to needing this about once a month. And every time I have to make compromises in my architecture design because of this. If there's anything on which help is needed, I'd be happy to try and help.

gnapse commented May 9, 2017

Still nothing on this? I keep coming back to needing this about once a month. And every time I have to make compromises in my architecture design because of this. If there's anything on which help is needed, I'd be happy to try and help.

@machty

This comment has been minimized.

Show comment
Hide comment
@machty

machty May 15, 2017

Contributor

I'd like to get a sense of how many people would use this feature/syntax for splatting arrays, spreading a hash of options. or both? This may or may not impact the future of this feature, I'm mostly just curious as to the real world use cases people expect this to address.

Personally, 99% of the time I'd be using this to spread a hash of options, since I do a lot of work in Ember with components and it's a common desire to be able to create a wrapper component that might introduce additional KV pairs into the options hash but otherwise forward the hash to the wrapped component. I don't think I'd ever use array splatting.

Contributor

machty commented May 15, 2017

I'd like to get a sense of how many people would use this feature/syntax for splatting arrays, spreading a hash of options. or both? This may or may not impact the future of this feature, I'm mostly just curious as to the real world use cases people expect this to address.

Personally, 99% of the time I'd be using this to spread a hash of options, since I do a lot of work in Ember with components and it's a common desire to be able to create a wrapper component that might introduce additional KV pairs into the options hash but otherwise forward the hash to the wrapped component. I don't think I'd ever use array splatting.

@pjcarly

This comment has been minimized.

Show comment
Hide comment
@pjcarly

pjcarly May 15, 2017

I'd use it exactly as you describe @machty

I currently have situations with a wrapper component like this, but then with 5 or 6 attributes that are being passed.

index/template.hbs
{{wrapper-component arg1=arg1 arg2=arg2 arg3=arg3}}

wrapper-component/template.hbs
{{wrapped-component arg1=arg1 arg2=arg2 arg3=arg3}}

it would be nice to not have to duplicate the passing of arguments in the wrapper-component's template

pjcarly commented May 15, 2017

I'd use it exactly as you describe @machty

I currently have situations with a wrapper component like this, but then with 5 or 6 attributes that are being passed.

index/template.hbs
{{wrapper-component arg1=arg1 arg2=arg2 arg3=arg3}}

wrapper-component/template.hbs
{{wrapped-component arg1=arg1 arg2=arg2 arg3=arg3}}

it would be nice to not have to duplicate the passing of arguments in the wrapper-component's template

@workmanw

This comment has been minimized.

Show comment
Hide comment
@workmanw

workmanw May 15, 2017

👍 on a hash of options (named args). Probably wouldn't use the array much.

workmanw commented May 15, 2017

👍 on a hash of options (named args). Probably wouldn't use the array much.

@foxnewsnetwork

This comment has been minimized.

Show comment
Hide comment
@foxnewsnetwork

foxnewsnetwork May 15, 2017

@machty From my personal experience, this is mostly an issue when trying to build a component to wrap {{link-to}} components (as oppose to extending LinkComponent). For example, if I were to create a {{my-fancy-link-to}} component that looks something like:

app/components/templates/my-fancy-link-to.hbs

{{yield}}
{{#link-to ...args }}
  <div class='fancy-stuff'>...</div>
{{/link-to}}
<div class='other-links'>
  {{#link-to "somewhere.else"}}
    ...
  {{/link-to}}
</div>

I would need to "splat" the ...args to properly emulate the functionality, but at the same time, I have no easy way of doing the splat

foxnewsnetwork commented May 15, 2017

@machty From my personal experience, this is mostly an issue when trying to build a component to wrap {{link-to}} components (as oppose to extending LinkComponent). For example, if I were to create a {{my-fancy-link-to}} component that looks something like:

app/components/templates/my-fancy-link-to.hbs

{{yield}}
{{#link-to ...args }}
  <div class='fancy-stuff'>...</div>
{{/link-to}}
<div class='other-links'>
  {{#link-to "somewhere.else"}}
    ...
  {{/link-to}}
</div>

I would need to "splat" the ...args to properly emulate the functionality, but at the same time, I have no easy way of doing the splat

@gnapse

This comment has been minimized.

Show comment
Hide comment
@gnapse

gnapse May 15, 2017

I too have always looked for something like this for spreading a hash of options. And I also wanted to say that it's not just to avoid duplicating the enumeration of options in the component and the wrapper. It's also to make the wrapper component agnostic of the component it is wrapping. I've had use cases with components that could conceivably wrap totally different inner components, with largely different sets of possible options. The wrapper component need not know about these kind of stuff.

gnapse commented May 15, 2017

I too have always looked for something like this for spreading a hash of options. And I also wanted to say that it's not just to avoid duplicating the enumeration of options in the component and the wrapper. It's also to make the wrapper component agnostic of the component it is wrapping. I've had use cases with components that could conceivably wrap totally different inner components, with largely different sets of possible options. The wrapper component need not know about these kind of stuff.

@XaserAcheron

This comment has been minimized.

Show comment
Hide comment
@XaserAcheron

XaserAcheron May 19, 2017

Confession time: when I was first learning Ember, I resorted to some shameful hacking to get around the exact case of having to pass a zillion variables through a wrapper component. I eventually gave in and started doing things the proper way, but being able to splat the hash (eww) would really save both my past and present self a few brain cells.

XaserAcheron commented May 19, 2017

Confession time: when I was first learning Ember, I resorted to some shameful hacking to get around the exact case of having to pass a zillion variables through a wrapper component. I eventually gave in and started doing things the proper way, but being able to splat the hash (eww) would really save both my past and present self a few brain cells.

@LevelbossMike

This comment has been minimized.

Show comment
Hide comment
@LevelbossMike

LevelbossMike May 23, 2017

I'd also like to see this for the use-case of wrapper components. Right now I'm using ember-spread to do this:

http://blog.firstiwaslike.com/clean-ember-addon-component-customization-with-ember-spread/

but it would be great if that was built-in functionality.

LevelbossMike commented May 23, 2017

I'd also like to see this for the use-case of wrapper components. Right now I'm using ember-spread to do this:

http://blog.firstiwaslike.com/clean-ember-addon-component-customization-with-ember-spread/

but it would be great if that was built-in functionality.

@jamesarosen

This comment has been minimized.

Show comment
Hide comment
@jamesarosen

jamesarosen Jun 5, 2017

I have another potential use-case for this. I have a pagination-controls component that builds up a list of pages, then does

{{#each pages as |page|}}
  {{#link-to (query-params page=page.number)}}page.number{{/link-to}}
{{/each}}

I'd like to make the name of the query-param configurable:

{{my-pagination param='foosPage'}}

I can think of two ways of doing that, both of which require new syntax

// interpolate hash key:
{{#link-to (query-params [param]=page.number)}}

// hash-splat:
{{#link-to (query-params ...page.queryParamsHash)}}

(Because of how helper:query-params works, I might just be able to build up a { isQueryParams: true, values: { foosPage: 4 } } object and omit the (query-params ...) invocation altogether, but that's just because the implementation of that helper is so simple.)

jamesarosen commented Jun 5, 2017

I have another potential use-case for this. I have a pagination-controls component that builds up a list of pages, then does

{{#each pages as |page|}}
  {{#link-to (query-params page=page.number)}}page.number{{/link-to}}
{{/each}}

I'd like to make the name of the query-param configurable:

{{my-pagination param='foosPage'}}

I can think of two ways of doing that, both of which require new syntax

// interpolate hash key:
{{#link-to (query-params [param]=page.number)}}

// hash-splat:
{{#link-to (query-params ...page.queryParamsHash)}}

(Because of how helper:query-params works, I might just be able to build up a { isQueryParams: true, values: { foosPage: 4 } } object and omit the (query-params ...) invocation altogether, but that's just because the implementation of that helper is so simple.)

@knownasilya

This comment has been minimized.

Show comment
Hide comment
@knownasilya

knownasilya Jun 5, 2017

Also the array splat is pretty important for positional params, {{#link-to dynamicRouteName ...routeParams}}. Currently, you cannot use link-to with dynamic params.

knownasilya commented Jun 5, 2017

Also the array splat is pretty important for positional params, {{#link-to dynamicRouteName ...routeParams}}. Currently, you cannot use link-to with dynamic params.

@gabrielgrant

This comment has been minimized.

Show comment
Hide comment
@gabrielgrant

gabrielgrant Jul 15, 2017

Is this only going to work for components, or will this also work for passing params to helpers? In practice, helpers seem to take positional params far more frequently than components do

gabrielgrant commented Jul 15, 2017

Is this only going to work for components, or will this also work for passing params to helpers? In practice, helpers seem to take positional params far more frequently than components do

@ldong

This comment has been minimized.

Show comment
Hide comment
@ldong

ldong Jul 25, 2017

Cannot wait to see this get merged.

ldong commented Jul 25, 2017

Cannot wait to see this get merged.

@stevenvachon

This comment has been minimized.

Show comment
Hide comment
@stevenvachon

stevenvachon Jul 25, 2017

I thought it was called "spread" in ES2015.

stevenvachon commented Jul 25, 2017

I thought it was called "spread" in ES2015.

andrew8er added a commit to anfema/website that referenced this pull request Sep 26, 2017

REFACTOR: Render slide components by name
Slide components must take a model object as a "data" attribute, since splat operator is not merged yet: wycats/handlebars.js#1149

Re: 30

andrew8er added a commit to anfema/website that referenced this pull request Sep 26, 2017

REFACTOR: Render slide components by name
Slide components must take a model object as a "data" attribute, since splat operator is not merged yet: wycats/handlebars.js#1149

Re: 30

andrew8er added a commit to anfema/website that referenced this pull request Sep 26, 2017

REFACTOR: Render slide components by name
Slide components must take a model object as a "data" attribute, since splat operator is not merged yet: wycats/handlebars.js#1149

Re: 30

andrew8er added a commit to anfema/website that referenced this pull request Sep 27, 2017

REFACTOR: Render slide components by name
Slide components must take a model object as a "data" attribute, since splat operator is not merged yet: wycats/handlebars.js#1149

Re: 30

andrew8er added a commit to anfema/website that referenced this pull request Sep 27, 2017

REFACTOR: Render slide components by name
Slide components must take a model object as a "data" attribute, since splat operator is not merged yet: wycats/handlebars.js#1149

Re: 30

andrew8er added a commit to anfema/website that referenced this pull request Sep 28, 2017

REFACTOR: Render slide components by name
Slide components must take a model object as a "data" attribute, since splat operator is not merged yet: wycats/handlebars.js#1149

Re: 30

andrew8er added a commit to anfema/website that referenced this pull request Sep 28, 2017

REFACTOR: Render slide components by name
Slide components must take a model object as a "data" attribute, since splat operator is not merged yet: wycats/handlebars.js#1149

Re: 30

andrew8er added a commit to anfema/website that referenced this pull request Sep 29, 2017

REFACTOR: Render slide components by name
Slide components must take a model object as a "data" attribute, since splat operator is not merged yet: wycats/handlebars.js#1149

Re: 30

andrew8er added a commit to anfema/website that referenced this pull request Sep 29, 2017

REFACTOR: Render slide components by name
Slide components must take a model object as a "data" attribute, since splat operator is not merged yet: wycats/handlebars.js#1149

Re: 30

andrew8er added a commit to anfema/website that referenced this pull request Sep 29, 2017

REFACTOR: Render slide components by name
Slide components must take a model object as a "data" attribute, since splat operator is not merged yet: wycats/handlebars.js#1149

Re: 30
@jbescoyez

This comment has been minimized.

Show comment
Hide comment
@jbescoyez

jbescoyez Sep 30, 2017

@machty Thanks for this awesome PR. I'm wondering how comes this has not been merged yet.

3 questions:

  • Is there some blocker at the moment?
  • What workarounds are you using for handling dynamic options passing between components?
  • How can I help to see this merged?

jbescoyez commented Sep 30, 2017

@machty Thanks for this awesome PR. I'm wondering how comes this has not been merged yet.

3 questions:

  • Is there some blocker at the moment?
  • What workarounds are you using for handling dynamic options passing between components?
  • How can I help to see this merged?
@machty

This comment has been minimized.

Show comment
Hide comment
@machty

machty Sep 30, 2017

Contributor

Just pushed a rebase to fix merge conflicts.

@jbescoyez

  1. Basically the issue is that a large enough threshold of people are wanting this for Ember, but even if we land this syntax, the implementation for template data-binding on the Ember/Glimmer side of things still needs to happen, and particularly with Glimmer there are performance constraints that need to be considered before we ship a syntax that everyone might like but is unfortunately doomed to be untenably slow.
  2. See these comments from this thread: #1149 (comment) and https://github.com/ciena-blueplanet/ember-spread
  3. I'm not sure, it's really mostly blocked on Glimmer, which is developing quite rapidly (though admittedly this feature's been on the backburner). I've pinged the Ember/Glimmer team as to how to proceed with this PR. I'm thinking though that it probably makes sense for there to be an official Ember/Glimmer RFC with some backing from the core team, like we did with Named Blocks.
Contributor

machty commented Sep 30, 2017

Just pushed a rebase to fix merge conflicts.

@jbescoyez

  1. Basically the issue is that a large enough threshold of people are wanting this for Ember, but even if we land this syntax, the implementation for template data-binding on the Ember/Glimmer side of things still needs to happen, and particularly with Glimmer there are performance constraints that need to be considered before we ship a syntax that everyone might like but is unfortunately doomed to be untenably slow.
  2. See these comments from this thread: #1149 (comment) and https://github.com/ciena-blueplanet/ember-spread
  3. I'm not sure, it's really mostly blocked on Glimmer, which is developing quite rapidly (though admittedly this feature's been on the backburner). I've pinged the Ember/Glimmer team as to how to proceed with this PR. I'm thinking though that it probably makes sense for there to be an official Ember/Glimmer RFC with some backing from the core team, like we did with Named Blocks.

andrew8er added a commit to anfema/website that referenced this pull request Oct 2, 2017

REFACTOR: Render slide components by name
Slide components must take a model object as a "data" attribute, since splat operator is not merged yet: wycats/handlebars.js#1149

Re: 30

andrew8er added a commit to anfema/website that referenced this pull request Oct 5, 2017

REFACTOR: Render slide components by name
Slide components must take a model object as a "data" attribute, since splat operator is not merged yet: wycats/handlebars.js#1149

Re: 30
@nknapp

This comment has been minimized.

Show comment
Hide comment
@nknapp

nknapp Oct 7, 2017

Collaborator

Basically @wycats has to say that it should get merged. I promised only to fix bug and not add new features, when I asked for push access.

He wants a spec first, have a look at #1277

Collaborator

nknapp commented Oct 7, 2017

Basically @wycats has to say that it should get merged. I promised only to fix bug and not add new features, when I asked for push access.

He wants a spec first, have a look at #1277

@NindroidX

This comment has been minimized.

Show comment
Hide comment
@NindroidX

NindroidX Jul 23, 2018

Are there any plans on merging this (or implementing something similar)? Any news?

NindroidX commented Jul 23, 2018

Are there any plans on merging this (or implementing something similar)? Any news?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment