Decoupled Router Support
Decoupled Router Support:
- Created decoupled-router-client package
- Created decoupled-router-client-example
- Added translatePath method in decoupled-router-client - sources a response from decoupled-router endpoint
- Added instance of DecoupledRouterClass as property on JsonApiClient
- Added getResourceByPath method to JsonApiClient
- Moved getCachedResponse to base class
- Ensured features like caching, locale, etc. are supported by getResourceByPath method and passed down to DecoupledRoute rClient instance.
Merge request reports
Activity
This is really great, awesome work! I noticed when trying to access properties on
translatedPath
in the example, there was no typescript autocomplete. I think we should be able to know the type at this time and cast thejson
to the Resolved or Unresolved path object shape.I noticed that in
getResource
andgetCollection
, I forgot to cast the returned json in some cases to the generic type (I know casting isn't great but this is one of the few times it's needed since we can never know the type returned from fetch/json()
But remembering to cast it in all of these places isn't great). Once that is fixed, we should get better types returned fromgetResourceByPath
. Right now all three of those are returningany
most of the time which could be improved.- Resolved by Coby Sher
added 6 commits
-
45c1bf3a...4f2a8050 - 5 commits from branch
project:canary
- b27ae3d1 - Merge branch 'canary' into decoupled-router-client
-
45c1bf3a...4f2a8050 - 5 commits from branch