Skip to content
This repository was archived by the owner on Jan 6, 2026. It is now read-only.

Update "handlebars" to v4.0.6#397

Merged
rwjblue merged 4 commits intoglimmerjs:masterfrom
Turbo87:handlebars
Jan 22, 2017
Merged

Update "handlebars" to v4.0.6#397
rwjblue merged 4 commits intoglimmerjs:masterfrom
Turbo87:handlebars

Conversation

@Turbo87
Copy link
Copy Markdown
Member

@Turbo87 Turbo87 commented Jan 20, 2017

related to #224

/cc @mmun @rwjblue

@rwjblue
Copy link
Copy Markdown
Member

rwjblue commented Jan 20, 2017

@Turbo87 - LGTM, can you prepare the corresponding Ember PR also and confirm all works well?

@rwjblue rwjblue requested a review from mmun January 20, 2017 16:29
@rwjblue
Copy link
Copy Markdown
Member

rwjblue commented Jan 20, 2017

LGTM, I'd like @mmun to review / confirm also.

@rwjblue
Copy link
Copy Markdown
Member

rwjblue commented Jan 20, 2017

I think we should address the things listed in #224 before landing this.

From @mmun in that issue:

Partials (specifically the {{> foo}} syntax and its variations) and decorators. They weren't designed with glimmer in mind and it's not clear at this time how they fit into our component story. Block parameters are fully supported.

PartialStatement: function(partial) {
appendChild(this.currentElement(), partial);
return partial;
let { name, loc } = partial;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will decorators work?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rafde nope, working on them atm sorry ;P

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we will throw for PartialStatement, Decorator, DecoratorBlock. Possibly more, but at least these.

test("Handlebars partial should error", function(assert) {
assert.throws(() => {
parse("{{> foo}}");
}, Error(`Handlebars partials are not supported: "{{> foo" on line "1:0"`));
Copy link
Copy Markdown
Member Author

@Turbo87 Turbo87 Jan 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@locks IMHO on line "1:0" looks a bit weird.

  • if we say on line we should just print the line but not the column
  • if we said at "1:0" people might not understand that we are talking about a code location

maybe just append (at 1:0) at the end? or go with the current style and leave out the column?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, we should say on line X column Z or at L1:C2 (we do the latter in a number of ember's internal errors/warnings).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test("Handlebars decorator block should error", function(assert) {
assert.throws(() => {
parse("{{#* foo}}{{/foo}}");
}, new Error(`Handlebars decorator blocks are not supported: "{{#* foo}}{{/foo}}" at L1:C0`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% happy with the error message, seems a bit confusing to include the closing tag? I'll tweak. Please comment 😁

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to match partials, let me know if I'm missing anyway, otherwise seems good to go.

@rwjblue rwjblue mentioned this pull request Jan 22, 2017
@rwjblue
Copy link
Copy Markdown
Member

rwjblue commented Jan 22, 2017

Awesome, thank you @Turbo87 and @locks!

@rwjblue rwjblue merged commit a98f6ec into glimmerjs:master Jan 22, 2017
@Turbo87 Turbo87 deleted the handlebars branch January 24, 2017 12:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants