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/pinionand 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.tsit will be typed.What if we don't have to type
Applicationexplicitly in thedeclarations.tsfile, but instead can use:Therefore
configureneeds to be strongly typed (like in pinion):So now, if the
configurecallback returns a new type, it returns with the new type:So if every
src/services/your-service/your-service.tsfile would return the typed app with the service and thesrc/services/index.tsfile looked like the following, it should work:A strongly typed application from its runtime code.
Beta Was this translation helpful? Give feedback.
All reactions