-
Notifications
You must be signed in to change notification settings - Fork 20
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
docs: BFF ADR #1238
docs: BFF ADR #1238
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1238 +/- ##
==========================================
- Coverage 89.05% 89.00% -0.06%
==========================================
Files 401 403 +2
Lines 8708 8729 +21
Branches 2123 2125 +2
==========================================
+ Hits 7755 7769 +14
- Misses 912 918 +6
- Partials 41 42 +1 ☔ View full report in Codecov by Sentry. |
b407cf4
to
333adae
Compare
333adae
to
113315b
Compare
9b1918f
to
e6df149
Compare
e6df149
to
f3802ca
Compare
- [Gateway Aggregation pattern](https://learn.microsoft.com/en-us/azure/architecture/patterns/gateway-aggregation) | ||
- [Backends for Frontends pattern](https://learn.microsoft.com/en-us/azure/architecture/patterns/backends-for-frontends) |
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.
Nice
- `useSubscriptions` ([source](https://github.com/openedx/frontend-app-learner-portal-enterprise/blob/337a7b44d94d8be5d9233e80e2fa0e2de72d165c/src/components/app/data/hooks/useSubscriptions.js#L11)) | ||
- This is the simplest implementation of migrating existing React query custom hooks to utilize the BFF. It passes an object representing | ||
fields typically passed within `useQuery` for the BFF query call within `bffQueryConfig`. This includes the transform to match the | ||
data structure of the existing `useSubscriptions` non-BFF call to `useBFF` within an object when making a call to the BFF query. It also passes | ||
the original arguments for making a query call within `useSubscriptions` passed within `useQuery` as a `fallbackQueryConfig` object within `useBFF`. | ||
- This structure allows the developer to continue using the original hooks as implemented. | ||
- `useEnterpriseCourseEnrollments` ([source](https://github.com/openedx/frontend-app-learner-portal-enterprise/blob/337a7b44d94d8be5d9233e80e2fa0e2de72d165c/src/components/app/data/hooks/useEnterpriseCourseEnrollments.js#L36)) | ||
- The modifications required to make this current hook utilize the original `useEnterpriseCourseEnrollments` hook and | ||
the `useBFF` layer required specific options to be passed in depending on the modified hooks downstream related to `enterpriseCourseEnrollments`. |
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.
nit: the "Custom query hooks modified" list item is still nested under the useBFF
list item versus being a sibling to useBFF
list item.
Given these hooks call useBFF
, it still doesn't quite make sense to have them nested under the useBFF
list item, as a sibling to resolveBFFQuery
(i.e., resolveBFFQuery
is called within useBFF
, but the hooks aren't called within useBFF
).
- Within `resolveBFFQuery` ([source](https://github.com/openedx/frontend-app-learner-portal-enterprise/blob/337a7b44d94d8be5d9233e80e2fa0e2de72d165c/src/components/app/data/queries/utils.js#L11)) | ||
- Whether a customer is eligible to use the BFF API call by either being explicitly enabled via the configuration API as a defined `enterpriseUuid`, | ||
or an individual customer has been selected to resolve the dashboard page with the BFF loader with a gradual rollout process via a Waffle flag. | ||
- Whether the current route the user is on is eligible to make the BFF call, if so, return the query required to call the BFF. |
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 think this comment still remains; the "eligibility" above pertains to whether the BFF should be considered based on the feature flags, but I was hoping to clarify the "eligibility" here pertaining to the current page route having a "corresponding BFF API endpoint that exists".
ADR for the frontend integration of the backend for frontend API call and and overview of resulting changes.
For all changes
Only if submitting a visual change