ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

Add public import for `uniqueId` helper

Open chriskrycho opened this issue 3 years ago • 4 comments

This landed as available via string resolution at unique-id but did not come with a public import, meaning it doesn't currently work in <template>/strict mode. Per discussion at the Framework team meeting a few weeks ago, it should be exported from @ember/helper, the same as the other public helpers which are not built-ins (hash, array, concat, get, and fn etc.).

It needs two things to be public:

  • [ ] #20171
  • [ ] A note in the blog post for that release (which should be 4.8).

Additionally, we'll want to update ecosystem support for it:

  • [x] add it to the list of allowed built-ins for the no-curly-component-invocation rule in ember-template-lint
    • ember-template-lint/ember-template-lint#2592
    • ember-template-lint/ember-template-lint#2593

chriskrycho avatar Aug 26 '22 15:08 chriskrycho

I should be able to take a look at this within a day or two. Should we also add it to the list of 'allowed' built-ins for the no-curly-component-invocation ember-template-lint rule?

geneukum avatar Aug 28 '22 13:08 geneukum

@geneukum good call. Let me add that to the list of tasks – and also, a colleague mentioned to me late Friday that he’s also interested in helping; let's coordinate efforts in #dev-ember-js on Discord!

chriskrycho avatar Aug 28 '22 15:08 chriskrycho

I've opened up the issue: https://github.com/ember-template-lint/ember-template-lint/issues/2592 and PR: https://github.com/ember-template-lint/ember-template-lint/pull/2593 to hopefully get the ember-template-lint part of this handled.

geneukum avatar Aug 28 '22 18:08 geneukum

That colleague is me! That discord channel link doesn't seem to work. Edit: Okay got it.

Question about the re-export, I see we're exposing these functions as part of global Ember object. Should we do that for this as well?

Ember._Input = Input;
Ember._hash = hash;
Ember._array = array;
Ember._concat = concat;
Ember._get = get;
Ember._on = on;
Ember._fn = fn;

TechieQian avatar Aug 29 '22 13:08 TechieQian

does this issue still need fixing?

oscareng avatar Jan 05 '23 04:01 oscareng