-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
Make hash built-in in strict-mode #999
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am sceptical.
I feel like we went from "implicit things"
to "let's make them explicit for the greater good"
to now this "well actually let's make some things implicit again",
and possibly in a few months "you know what, actually let's make things explicit".
Co-authored-by: MrChocolatine <[email protected]>
Co-authored-by: MrChocolatine <[email protected]>
The problem for arrays and hashes comes down to the fact that these do not exists as language primitives, and every other language makes arrays and objects super super easy. fn is out of place for the reason stated in that rfc. On is the only true convenience, imo. But that's the point of a framework, yea? To be convenient? |
Should we create real objects in |
would we not want them to crazy fine-grained reactivity for each property? the equiv of a |
RFC Review (1) are in favour of this. |
Co-authored-by: Aaron Chambers <[email protected]>
For folks using gts/gjs, to keep importing the I'm in favor of making hash and others built-in in strict mode. However, what I really wish we had was the syntax to just create an object in hbs scope. Something like Anyway, making hash build-in in strict mode would be a good step forward. |
Can we support/add <User @model={{hash password='ThR4ceKrnOK65Z6' }} /> Is this a hash function that will hash the password ? While the term <User @model={{obj password='ThR4ceKrnOK65Z6'}} /> Ok, this is just an object helper: |
@flashios09 This is a reasonable point and one that has come up before. However, since |
Additionally, I think everyone is in favor of object and array literals, rather than helpers -- which still need design, but would eliminate the problem altogether. imagine (something like): <template mode='exp'>
<Foo
@someArray={ [1, 2, 3, 4] }
@someObj={ { a: 1, b: 2, c: 3 } }
/>
</template> |
As an alias, which means supporting the |
Because adding an alias to |
A different task ? if (helper === 'hash') {
import('hash').from('@ember/helper');
} So we will need a new RFC to just do this ? if (helper === 'hash' || helper === 'obj') {
import('hash').from('@ember/helper');
} @NullVoxPopuli is it possible to update this RFC to support the |
@flashios09 , given that we're going gjs/gts for all things as default (soon 🤞 ), folks are free to do: import { hash as obj } from '@ember/helper';
import Foo from './foo';
<template>
<Foo @data={{obj a=1 b=2}} />
</template> |
Propose making
(hash)
a built in helperRendered
Summary
Today, we need
This should be built in, and not require an import.
An FCP is required before merging this PR to advance to Accepted.
Upon merging this PR, automation will open a draft PR for this RFC to move to the Ready for Released Stage.
Exploring Stage Description
This stage is entered when the Ember team believes the concept described in the RFC should be pursued, but the RFC may still need some more work, discussion, answers to open questions, and/or a champion before it can move to the next stage.
An RFC is moved into Exploring with consensus of the relevant teams. The relevant team expects to spend time helping to refine the proposal. The RFC remains a PR and will have an
Exploring
label applied.An Exploring RFC that is successfully completed can move to Accepted with an FCP is required as in the existing process. It may also be moved to Closed with an FCP.
Accepted Stage Description
To move into the "accepted stage" the RFC must have complete prose and have successfully passed through an "FCP to Accept" period in which the community has weighed in and consensus has been achieved on the direction. The relevant teams believe that the proposal is well-specified and ready for implementation. The RFC has a champion within one of the relevant teams.
If there are unanswered questions, we have outlined them and expect that they will be answered before Ready for Release.
When the RFC is accepted, the PR will be merged, and automation will open a new PR to move the RFC to the Ready for Release stage. That PR should be used to track implementation progress and gain consensus to move to the next stage.
Checklist to move to Exploring
S-Proposed
is removed from the PR and the labelS-Exploring
is added.Checklist to move to Accepted
Final Comment Period
label has been added to start the FCP