[ZEPPELIN-6564] Route the published paragraph through the shared react-mount loader - #5391
Open
voidmatcha wants to merge 4 commits into
Open
[ZEPPELIN-6564] Route the published paragraph through the shared react-mount loader#5391voidmatcha wants to merge 4 commits into
voidmatcha wants to merge 4 commits into
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is this PR for?
Moves the published paragraph off its own React loader and onto the shared
react-mountdirective, and removes the dead Module Federation configuration that this exposed.Today there are two loaders.
published/paragraph.component.tsinjects a script tag intodocument.headand readswindow.reactAppdirectly, while the paragraph footer goes through the[zeppelin-react-mount]directive added in ZEPPELIN-6428. The two paths differ in load-failure handling, container caching and typing. The bespoke path has no fallback at all, so a published paragraph whose remote fails to load renders nothing.Split into four commits.
1. Remove dead Module Federation configuration
The shell
webpack.config.jsdeclares areactAppremote but never callscontainer.initand never bundles React. Also removes theGenerateRemoteEntryJsonplugin, which writes aremoteEntry.jsonnothing reads, and the unused@angular-architects/module-federationandngx-build-plusdevDependencies. As a side effect the hard-codedreactApp@http://localhost:3001/remoteEntry.jsno longer ends up in production shell bundles.2. Make @zeppelin/sdk framework-neutral
The SDK declares
@angular/commonand@angular/coreas peerDependencies but imports neither, and pins them at^8.2.9while the project is on Angular 21. It does userxjs, which is not declared. A non-Angular consumer, which is what the React remote is, inherits a requirement that does not exist and misses one that does.3. Add ReactFeatureService as the single flag resolver
Flag parsing was split. The published paragraph accepted both
?react=trueand a bare?react, whilenotebook.component.tsrequired exactly?reactFooter=true. Unified on the permissive rule so the URLs documented in ZEPPELIN-6371 keep working. As a result a bare?reactFooternow enables the footer as well. Both flags are experimental opt-ins; with no flag the behaviour is unchanged.4. Route the published paragraph through the shared react-mount loader
Moves the component onto the directive and makes
./PublishedParagraphsatisfy the mount contract. It previously returned a bare unmount function, which the directive classified as legacy and for which it madeupdatea no-op.What type of PR is it?
Refactoring
Todos
None
What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-6564
How should this be tested?
zeppelin-reactvitest suite, extended with a mount-contract spec forPublishedParagraphmirroring the existingParagraphFooterone. It covers the handle shape, in-place update within the same subtree, the empty-state round trip, andonErroron a render failure.Screenshots (if appropriate)
No
Questions: