-
Notifications
You must be signed in to change notification settings - Fork 2
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
Improve PAPI imports #634
Improve PAPI imports #634
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.
Thank you!! This is so exciting!
Reviewed 25 of 25 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @jolierabideau)
src/extension-host/services/papi-backend.service.ts
line 44 at r1 (raw file):
EventEmitter: PapiEventEmitter, /** JSDOC DESTINATION DataProviderEngine */ DataProviderEngine: dataProviderService.DataProviderEngine,
Looks like this unfortunately got translated into in-line imports in papi.d.ts
:
Would you mind trying type asserting the type with something like this:
DataProviderEngine: dataProviderService.DataProviderEngine as typeof dataProviderService.DataProviderEngine
Or if that doesn't work, you may need to import DataProviderEngine
directly from the service and use it in here.
src/renderer/services/papi-frontend.service.ts
line 65 at r1 (raw file):
/** JSDOC DESTINATION projectLookupService */ projectLookup: projectLookupService as ProjectLookupServiceType, /** JSDOC SOURCE papiReact */
Oops! We forgot to fill in this JSDoc. Something like
/**
* JSDOC SOURCE papiReact
*
* React hooks that enable interacting with the `papi` in React components more easily.
*/
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @tjcouch-sil)
src/extension-host/services/papi-backend.service.ts
line 44 at r1 (raw file):
Previously, tjcouch-sil (TJ Couch) wrote…
Looks like this unfortunately got translated into in-line imports in
papi.d.ts
:
Would you mind trying type asserting the type with something like this:
DataProviderEngine: dataProviderService.DataProviderEngine as typeof dataProviderService.DataProviderEngineOr if that doesn't work, you may need to import
DataProviderEngine
directly from the service and use it in here.
Done.
src/renderer/services/papi-frontend.service.ts
line 65 at r1 (raw file):
Previously, tjcouch-sil (TJ Couch) wrote…
Oops! We forgot to fill in this JSDoc. Something like
/** * JSDOC SOURCE papiReact * * React hooks that enable interacting with the `papi` in React components more easily. */
Done.
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.
Reviewed 4 of 4 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
Add new import path in
src/renderer global-this
Add new service for
papi-frontent-react.service
that exports all of the PAPI hooksSwitches all imports in core to the new
Export parts of PAPI individually in
papi-frontend
andpapi-backend
so they can be accessed without destructuring papi. Originally I had a destructured export instead of exporting each const, but when I commit the code I got the error:Split 'const' declarations into multiple statements
. I tried to assert as a const, but got another error:A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals.
Imports are now done like the screenshots below, and the appropriate JSDOCs display when you hover
This change is