dove: strongly type app.configure
#2879
fratzinger
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
It took me a few reads to get what you are suggesting 😆 I like it and I think we can totally change the signature to make it possible, I'm currently just a little hesitant to change it in the generated application since it would require a lot of documentation and example changes. Maybe for a v5.1 or v6? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This idea is pretty similar to the use of
@feathersjs/pinion
and is not a breaking change.This has a few quirks:
It separates the service runtime registration (in
src/services/index.ts
) from the type (insrc/services/your-service/your-service
). If you just remove it fromsrc/services/index.ts
it will be typed.What if we don't have to type
Application
explicitly in thedeclarations.ts
file, but instead can use:Therefore
configure
needs to be strongly typed (like in pinion):So now, if the
configure
callback returns a new type, it returns with the new type:So if every
src/services/your-service/your-service.ts
file would return the typed app with the service and thesrc/services/index.ts
file looked like the following, it should work:A strongly typed application from its runtime code.
Beta Was this translation helpful? Give feedback.
All reactions