-
Notifications
You must be signed in to change notification settings - Fork 52
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
Fix type issues with v5.2.0 #503
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.
Thanks for doing this. Needs two very small tweaks, and then we'll be off to the races!
…porter.ts Co-authored-by: Chris Krycho <[email protected]>
…t/setup-global-a11y-hooks.ts Co-authored-by: Chris Krycho <[email protected]>
Co-authored-by: Chris Krycho <[email protected]>
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.
Excellent, thank you!
Unfortunately, CI was disabled (unrelated to this PR). I just fixed that. @robostheimer - Could you rebase / amend & update to trigger a CI job? |
…ut yarn was run with `--frozen-lockfile`
@@ -24,6 +24,10 @@ type HelperName = | |||
| 'typeIn' | |||
| 'visit'; | |||
|
|||
interface HookUnregister { | |||
unregister: () => void; | |||
} |
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.
Considering the changes in PR #1344, a 2.9.4 release of @ember/test-helpers would allow us to just import registerHook
and HookUnregister
as official public APIs. Is there a reason why we can't just wait for that release before making these changes? Seems like duplicative work.
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.
Right now, I'm trying to migrate an addon to typescript; this PR unblocks that as there is an issue with a reference to ember__test-helpers. Being that the code is already written and ready for merging. Seems like the duplicative work has been done.
Do we know when the PR referenced above will be released? @drewlee
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.
That would be a question for @chriskrycho, who maintains the @ember/test-helpers
releases.
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.
To be specific, the duplicative work would entail removing the inline HookUnregister
type that's being introduced with this change. Just seems more efficient to incorporate these changes wholesale in accommodating a 2.9.4 release of @ember/test-helpers
. We've been aware of the TypeScript bug (see issue #498) and is one of the reasons why the changes were carried out in PR #1344.
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 see. I pushed this PR at the suggestion of @chriskrycho. Chris, is there a reason why we cant just release @ember/test-helpers
and then update this addon?
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 agree with @drewlee that it would be better to ask @chriskrycho to please release the package with the fix in it and we can consume that. Sorry for the circles on this, and thank you for your patience! We'll get this resolved. 👍
One reason is: I'm super busy with other things and keeping these two things decoupled from each other is useful. :) I am happy to try to get to it, but it will be some time before I can commit to that. |
Gotcha @chriskrycho Given this, @drewlee @MelSumner, do you have objections to pushing this change? cc: @rwjblue |
I think we should see who else on the team can release the package; I can even check since as a core framework team member I should have access. Let me check and see. |
no worries if you don't have time to do a release, I will find someone who can though. I have learned that it's not helpful in the long run to keep things like this limping along and I have the time and energy to see this through. 👍 |
We need to address https://github.com/emberjs/ember-test-helpers/pull/1344/files#r1205681209 before releasing a new ember-test-helpers, we should land this as is IMO. |
Change Log:
ember__test-helpers
from package@ember/test-helpers to v 2.9.2
to get types directly from this packagesetup-global-a11y-hooks
as it is not an exported type and updated the_unregisterHooks
variable's type to match HookUnregister (Note: happy to make thatHookUnregister
type exportable if that makes more sense)getContext
could return undefine, howevergetTestMetadata
expects a defined context)types/@ember/test-helpers.d.ts
since the types are available via the bumped version of @ember/test-helpersTests:
yarn prepublishOnly
returns no errorsyarn test:ember
returns