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

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

Merged
merged 4 commits into from
Jun 7, 2023

Conversation

NullVoxPopuli
Copy link
Sponsor 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
@@ -41,7 +41,7 @@ export default internalHelper((): Reference<string> => {
// implementation details into an intimate API. It also ensures that the UUID
// 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
Sponsor 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
16 checks passed
@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