Skip to content
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

in-implementation updates to the default helper manager RFC, 756 #788

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

NullVoxPopuli
Copy link
Sponsor Contributor

@NullVoxPopuli NullVoxPopuli commented Jan 13, 2022

During implementation, a couple things came up:

  • we don't do a great job of documenting when autotracking happens outside of getters -- therefore, added an example of autotracking in a helper to the examples section -- as composing helpers in classes that have access to tracked data can be a powerful encapsulation tool for library and app authors alike

  • we need a minor tweak to how arguments are passed to the helper function to enable default arguments for helpers relying on positional args

Much thanks to @chancancode for binging these things up.

Also, Idk how this is supposed to work with staged RFCs, 🤷 I guessed (feedback welcome, as always)

Rendered

text/0756-helper-default-manager.md Outdated Show resolved Hide resolved
text/0756-helper-default-manager.md Outdated Show resolved Hide resolved
text/0756-helper-default-manager.md Outdated Show resolved Hide resolved
@wycats
Copy link
Member

wycats commented Apr 20, 2022

Notes from our meeting:

  • Motivation: "it looks like a JavaScript call"
  • Idiom Constraint: We want to support normal JavaScript idioms from Handlebars. This means that we need to support optional positionals, and we also would like to turn named arguments into a options object. However, in idiomatic JavaScript, it is difficult to have optional positional arguments and named arguments without doing a lot of manual checking. We are intentionally leaning into the JavaScript call idioms over the Handlebars call idioms, which do support that pattern.

@@ -156,6 +176,68 @@ setHelperManager(() => DEFAULT_HELPER_MANAGER, Function.prototype);
- to register this helper manager, it should occur during app boot so developers do not need to import anything to
trigger the `setHelperManager` call

**Update 2022-01-13, during implementation**
Copy link
Member

Choose a reason for hiding this comment

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

I find this odd to be in it's own section here, why isn't this updating the detailed design just above (or at least also updating the detailed design)?

Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

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

Because it made sense to me, and i wanted to progression of discovery to be known. I haven't been aware of any 'proper' way to do these kinds of updates 🙃

@NullVoxPopuli
Copy link
Sponsor Contributor Author

I no longer have the energy to put in to this, so if someone wants to take it over, that'd be much appreciated

@chancancode
Copy link
Member

I think this is currently hung up on the text is still not very clear to everyone who read it/didn't capture everything we want to convey with the change succinctly. I can eventually wrap this up (or someone else could) but it's not a huge priority for me personally, because the feature was landed anyway. It's important to capture this in the RFC as the source of truth but it's not a blocker, though it's important to do it while we still have the context.

@wagenet
Copy link
Member

wagenet commented Jul 25, 2022

@chancancode do your thoughts remain the same here?

@wagenet wagenet added the S-Proposed In the Proposed Stage label Dec 2, 2022
@wagenet wagenet removed the S-Proposed In the Proposed Stage label Jan 27, 2023
@chancancode chancancode force-pushed the helper-manager-updates branch 2 times, most recently from 8a45fcc to 3ad683b Compare June 7, 2023 19:16
@chancancode chancancode force-pushed the helper-manager-updates branch 4 times, most recently from 913be7b to 17ee690 Compare June 7, 2023 19:22
Co-authored-by: Godfrey Chan <godfreykfc@gmail.com>
@chancancode chancancode merged commit e0f34d5 into emberjs:master Jun 8, 2023
8 checks passed
chancancode added a commit to tildeio/discourse that referenced this pull request Jun 15, 2023
This feature landed in Ember 4.5+, but this polyfill would allow
it to work on 3.25+

References

RFC: emberjs/rfcs#756
Update: emberjs/rfcs#788
Guides: ember-learn/guides-source#1924
CvX pushed a commit to discourse/discourse that referenced this pull request Jun 15, 2023
* Enable "plain function as helpers" polyfill

This feature landed in Ember 4.5+, but this polyfill would allow
it to work on 3.25+

References

RFC: emberjs/rfcs#756
Update: emberjs/rfcs#788
Guides: ember-learn/guides-source#1924

* Convert truth-helpers to use plain functions

Mainly to test that the polyfill is working, but it's a good
refactor anyway.
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.

None yet

6 participants