Commit 4bde6b2
authored
[ZEPPELIN-6371] Convert published paragraph rendering to Micro Frontend(Angular to React) in New UI
### What is this PR for?
[Micro Frontend Migration(Angular to React) Proposal](https://cwiki.apache.org/confluence/display/ZEPPELIN/Micro+Frontend+Migration%28Angular+to+React%29+Proposal)
---
#### Summary
* Implement React-based micro-frontend architecture using Module Federation.
* Convert published paragraph component to support React rendering.
* Add environment-based configuration for development and production builds.
#### Changes
**1. React Micro-Frontend Project Setup**
* Created new React project at `projects/zeppelin-react/`.
* Configured Webpack Module Federation for micro-frontend architecture.
* Set up React 18 with TypeScript support.
**2. Component Implementation**
*New React Components:*
* `PublishedParagraph`: Main entry point for published paragraph rendering.
* `SingleResultRenderer`: Template for rendering single paragraph results.
*Renderers:*
* `HTMLRenderer`: Renders HTML content with sanitization.
* `TextRenderer`: Renders plain text with ANSI support.
* `ImageRenderer`: Renders image outputs.
*Visualizations:*
* `TableVisualization`: Table rendering with sorting, filtering, and export.
* `VisualizationControls`: Control panel for table operations.
*Common Components:*
* `Loading`: Loading state indicator.
* `Empty`: Empty state display.
**3. Angular Integration**
* `paragraph.component.ts`: Added React widget loading logic via Module Federation.
* `paragraph.component.html`: Added React container element.
* `environment.ts` / `environment.prod.ts`: Added `reactRemoteEntryUrl` configuration.
* Development: `http://localhost:3001/remoteEntry.js`
* Production: `/assets/react/remoteEntry.js`
**4. Build Configuration**
* `angular.json`: Copy React build output to `/assets/react/`.
* `webpack.config.js`: Configured Module Federation plugin:
* Dev server: port 3001
* CORS headers for cross-origin requests
* Environment-specific `publicPath`
* `proxy.conf.js`: Updated proxy configuration.
**5. Package**
* Added React and React-DOM dependencies.
* Added Webpack and Module Federation plugins.
* Added Ant Design for React UI components.
* Added <at>antv/g2plot for data visualization (also used in Angular version with G2).
#### License
This PR uses several open-source libraries. The `xlsx` (v0.18.5) and `typescript` (v4.6.4) packages are licensed under **Apache-2.0**, while all other dependencies and devDependencies (such as `react`, `react-dom`, `antd`, `<at>ant-design/icons`, etc.) are licensed under **MIT**. The MIT license is more permissive than Apache-2.0, so including MIT-licensed packages does not violate Apache-2.0 terms. All packages may be used commercially, and license notices should be included when distributing the project.
#### Technical Details
**Module Federation Configuration**
```ts
// Development: http://localhost:3001/remoteEntry.js
// Production: /assets/react/remoteEntry.js
new ModuleFederationPlugin({
name: 'reactApp',
filename: 'remoteEntry.js',
exposes: {
'./PublishedParagraph': './src/pages/PublishedParagraph'
}
})
```
#### Usage
* Render published paragraph with React:
`/notebook/{noteId}/paragraph/{paragraphId}?react=true`
### What type of PR is it?
Improvement
### Todos
### What is the Jira issue?
ZEPPELIN-6371
### How should this be tested?
```sh
// Start Zeppelin Server
./mvnw clean install -DskipTests
./mvnw clean package -DskipTests
./bin/zeppelin-daemon.sh start
// Start Zeppelin New UI Client
cd zeppelin-web-angular
nvm use
npm i
npm run start
```
#### TextRenderer
http://localhost:4200/#/notebook/2EYDJKFFY/paragraph/20180118-122136_1299905608?react=true
#### TableVisualization
http://localhost:4200/#/notebook/2EYDJKFFY/paragraph/20180118-122136_1299905608?react=true
#### ImageRenderer
http://localhost:4200/#/notebook/2F1S9ZY8Z/paragraph/20180117-220535_590781730?react=true
#### HTMLRenderer - Table
http://localhost:4200/#/notebook/2F1S9ZY8Z/paragraph/paragraph_1580885453474_1167659991?react=true
#### HTMLRenderer - Script(Bokeh JS)
http://localhost:4200/#/notebook/2F1S9ZY8Z/paragraph/paragraph_1580885707198_-1652524072?react=true
### Screenshots (if appropriate)
### Questions:
* Does the license files need to update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
Closes #5111 from dididy/feature/micro-frontend.
Signed-off-by: ChanHo Lee <chanholee@apache.org>1 parent c3ccd9b commit 4bde6b2
46 files changed
Lines changed: 12199 additions & 172 deletions
File tree
- zeppelin-web-angular
- e2e
- models
- tests
- notebook/published
- theme
- projects/zeppelin-react
- src
- components
- common
- renderers
- visualizations
- pages
- templates
- utils
- src
- app/pages/workspace/published/paragraph
- environments
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
| |||
100 | 108 | | |
101 | 109 | | |
102 | 110 | | |
103 | | - | |
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
107 | 114 | | |
108 | 115 | | |
109 | 116 | | |
110 | 117 | | |
111 | | - | |
112 | 118 | | |
113 | | - | |
114 | 119 | | |
115 | 120 | | |
116 | 121 | | |
117 | 122 | | |
118 | | - | |
| 123 | + | |
| 124 | + | |
119 | 125 | | |
120 | 126 | | |
121 | | - | |
| 127 | + | |
122 | 128 | | |
123 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
124 | 134 | | |
125 | 135 | | |
126 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
92 | 97 | | |
93 | 98 | | |
94 | 99 | | |
| |||
152 | 157 | | |
153 | 158 | | |
154 | 159 | | |
| 160 | + | |
| 161 | + | |
155 | 162 | | |
156 | 163 | | |
157 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
158 | 170 | | |
159 | 171 | | |
160 | 172 | | |
| |||
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 18 | + | |
| 19 | + | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | | - | |
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
25 | 37 | | |
26 | 38 | | |
27 | 39 | | |
| |||
0 commit comments