Skip to content

[FEATURE] Create public import for uniqueId helper #20171 #20464

Merged
wagenet merged 4 commits intoemberjs:mainfrom
NullVoxPopuli:qiawan/reexport_uniq_ids
Jun 7, 2023
Merged

[FEATURE] Create public import for uniqueId helper #20171 #20464
wagenet merged 4 commits intoemberjs:mainfrom
NullVoxPopuli:qiawan/reexport_uniq_ids

Conversation

@NullVoxPopuli
Copy link
Copy Markdown
Contributor

@NullVoxPopuli NullVoxPopuli commented May 28, 2023

Rebases: #20171

Additional changes:

  • uses the function uniqueId, rather than the helper, because this is better. We don't need the classic Helper infra ever since native functions became supported in 4.5 (this was pending feedback on Create public import for uniqueId helper #20171)
  • added JSDoc to the new export as well so that documentation shows up in the API Reference site
  • the test that was added has been changed to not pre-invoke uniqueId, because it's now just a function
  • one additional test ensuring the behavior, when used as a plain function, is the same as used via invokeHelper
  • Remove addition of _invokeHelper to the Ember global -- I don't think we don't want to keep adding to that object, because it makes future stuff and tree shaking harder (or forces us to have even more build time complexity)

Resolves: #20165

Locally,

image
image

Qian Wan and others added 3 commits May 28, 2023 15:41
Adding test and also re-organizing the export

Correcting to single quotes

correct test description

adding empty line to adhere to linting

address lint

place on global

addressed comments to use invokeHelper
// always starts with a letter, to avoid creating invalid IDs with a numeric
// digit at the start.
function uniqueId() {
export function uniqueId(): string {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this return type was previously any

@wagenet wagenet merged commit a5364b4 into emberjs:main Jun 7, 2023
@NullVoxPopuli NullVoxPopuli deleted the qiawan/reexport_uniq_ids branch August 30, 2023 19:42
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.

Add public import for uniqueId helper

3 participants