-
-
Notifications
You must be signed in to change notification settings - Fork 1
Replace documents page with Resumier microfrontend embed #244
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
Open
adriandarian
wants to merge
1
commit into
main
Choose a base branch
from
codex/create-proposal-for-microfrontend-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Proposal: Embed Resumier as the Documents microfrontend | ||
|
|
||
| ## Summary | ||
| Replace the existing Documents page in THRIVE with the Resumier microfrontend so the documents workflow is powered by the Prosperis Resumier app. The microfrontend will run standalone for demos while also being embedded into THRIVE for production usage. | ||
|
|
||
| ## Goals | ||
| - Swap the `/documents` route in THRIVE to host the Resumier microfrontend. | ||
| - Support a standalone Resumier deployment that can also be embedded as an iframe/microfrontend. | ||
| - Keep the integration configurable via environment variables for local and production environments. | ||
|
|
||
| ## Non-goals | ||
| - Rewriting THRIVE document data stores or migrations in this PR. | ||
| - Designing cross-app data synchronization (handled in the Resumier microfrontend backlog). | ||
|
|
||
| ## Proposed Integration Approach | ||
| 1. **Microfrontend Embed** | ||
| - Expose Resumier as an embeddable experience (microfrontend build or hosted app). | ||
| - THRIVE loads Resumier via an iframe (or later via module federation) so the Documents page fully delegates to Resumier. | ||
|
|
||
| 2. **Configuration** | ||
| - Add a `VITE_RESUMIER_URL` environment variable in THRIVE to point to the Resumier deployment. | ||
| - Local development can point to `http://localhost:<port>` when running Resumier standalone. | ||
|
|
||
| 3. **Progressive Enhancement** | ||
| - Short term: iframe-based embed for quick validation. | ||
| - Medium term: switch to a first-class microfrontend (module federation or web component) once Resumier publishes a stable remote entry. | ||
|
|
||
| ## Open Questions / Follow-ups | ||
| - What is the canonical deployment URL for Resumier in each environment (dev/staging/prod)? | ||
| - Does Resumier need SSO or token handoff from THRIVE for access control? | ||
| - Should THRIVE retain a fallback Documents view in case Resumier is unreachable? | ||
|
|
||
| ## Rollout Plan | ||
| 1. Merge the embed-only integration in THRIVE. | ||
| 2. Deploy Resumier standalone and confirm embedding works in THRIVE. | ||
| 3. Iterate on shared auth/session and data contract if needed. | ||
|
|
||
| ## Acceptance Criteria | ||
| - Navigating to `/documents` shows the Resumier microfrontend. | ||
| - The embed URL is configurable via `VITE_RESUMIER_URL`. | ||
| - THRIVE builds without requiring the old Documents page implementation. |
28 changes: 28 additions & 0 deletions
28
src/components/features/documents/ResumierMicrofrontend.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| export function ResumierMicrofrontend() { | ||
| const resumierUrl = import.meta.env.VITE_RESUMIER_URL as string | undefined; | ||
|
|
||
| if (!resumierUrl) { | ||
| return ( | ||
| <div className="flex h-full min-h-[60vh] w-full items-center justify-center p-8"> | ||
| <div className="max-w-xl text-center text-sm text-muted-foreground"> | ||
| <h1 className="mb-2 text-lg font-semibold text-foreground">Resumier microfrontend</h1> | ||
| <p> | ||
| Set <code className="rounded bg-muted px-1 py-0.5">VITE_RESUMIER_URL</code> to | ||
| load the Resumier microfrontend in the documents page. | ||
| </p> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <div className="h-full w-full"> | ||
| <iframe | ||
| title="Resumier microfrontend" | ||
| src={resumierUrl} | ||
| className="h-full min-h-[80vh] w-full border-0" | ||
| allow="clipboard-read; clipboard-write" | ||
| /> | ||
| </div> | ||
| ); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The iframe
srcis always justVITE_RESUMIER_URL, so any document-selection context in the parent URL is dropped. Other parts of the app still navigate to/documentswith adocIdquery (e.g.,LinkedDocumentsPopoverusesnavigate({ to: '/documents', search: { docId } })), which previously opened a specific document. With the new embed, thatdocIdnever reaches Resumier, so clicking “View document” from an application will no longer open the intended document. Consider appendingwindow.location.search(or adocIdparam) to the iframesrc, or using postMessage, so the microfrontend can preserve this deep-link behavior.Useful? React with 👍 / 👎.