Skip to content

Conversation

@tbonelee
Copy link
Contributor

@tbonelee tbonelee commented Oct 22, 2025

What is this PR for?

This PR bumps Angular from 9 to 13 and updates related dependencies in zeppelin-web-angular.

It addresses:

I removed the zeppelin-helium and helium-vis-example projects in this PR. The Angular rewrite of Helium was never completed, it’s currently unused, and it introduced circular-dependency-related stack overflows during the application build. Given that, removing these modules is the safer choice.

Principal version updates

  • angular: 9 -> 13
  • ansi_up: 4 -> 6
  • date-fns: 2 -> 3
  • tslib: 1 -> 2
  • lint-staged: 8 -> 15
  • typescript: 3.8 -> 4.6

What type of PR is it?

Chore

Todos

  • - Bump Angular version (Used angular cli)
  • - Migrate TSLint to ESLint (Used @angular-eslint/schematics:convert-tslint-to-eslint)
  • - Fix deprecated code usages
  • - Bump other minor dependencies
  • - Remove zeppelin-helium and helium-vis-example

What is the Jira issue?

ZEPPELIN-6349

How should this be tested?

  • Run E2E tests
  • Manual tests across various pages
  • Verify serve (dev server), build, and lint work as expected

Questions:

  • Does the license files need to update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? No

@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/naming-convention */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It silences linting errors of using dot characters(.) in object keys.

import { OP } from './message-operator.interface';

export type MixMessageDataTypeMap = MessageSendDataTypeMap & MessageReceiveDataTypeMap;
export type MessageDataTypeMap = MessageSendDataTypeMap | MessageReceiveDataTypeMap;
Copy link
Contributor Author

@tbonelee tbonelee Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • After upgrading to TS4, using an intersection of send/receive maps caused overlapping OP keys (e.g. LIST_NOTE_JOBS) to intersect their payload types (e.g. undefined & ListNoteJobs), producing never.
  • This broke WebSocketMessage<keyof MessageSendDataTypeMap> because MixMessageTypeMap[K] evaluated to never for some K, leading to generic constraint errors (TS2344) and lost inference.
  • Switching MixMessageTypeMap to a union (Send | Receive) restores correct indexed access (Send[K] | Receive[K]) and fixes the errors.
  • Also updated WebSocketMessage to a discriminated-union friendly form for stable inference. (Type-only change; no runtime impact.)

Note

To learn how applying keyof operator to union type or intersection type works, see https://effectivetypescript.com/2024/08/30/keyof-puzzle/

TL;DR

  • keyof (A & B) = (keyof A) | (keyof B)
  • keyof (A | B) = (keyof A) & (keyof B)

Comment on lines +73 to +74
(startJob)="onStartJob($event)"
(stopJob)="onStopJob($event)"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed name conflicts with native events(start, stop)

"build-project:sdk": "ng build --project zeppelin-sdk",
"build-project:vis": "ng build --project zeppelin-visualization",
"lint": "cross-env NODE_OPTIONS='--max-old-space-size=8192' ng lint && tslint -p tslint-rules/tsconfig.json && prettier --check \"**/*.{ts,js,json,css,html}\"",
"lint:fix": "cross-env NODE_OPTIONS='--max-old-space-size=8192' ng lint --fix && tslint --fix -p tslint-rules/tsconfig.json && prettier --write \"**/*.{ts,js,json,css,html}\"",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added --max-old-space-size=9128 options to fix heap out of memory error.

Copy link
Contributor

@dididy dididy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

My environment shows the above warning when running locally. Could you take a look?

Thank you very much for handling this challenging task. I’ve done a brief review, but I’ll keep an eye on it just in case. I’ll also try cherry-picking the unmerged e2e PR to see if it passes tests. I appreciate your effort.

{
"files": ["*.ts"],
"parserOptions": {
"project": ["projects/zeppelin-sdk/tsconfig.lib.json", "projects/zeppelin-sdk/tsconfig.spec.json"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"project": ["projects/zeppelin-sdk/tsconfig.lib.json", "projects/zeppelin-sdk/tsconfig.spec.json"],
"project": ["zeppelin-web-angular/projects/zeppelin-sdk/tsconfig.lib.json", "zeppelin-web-angular/projects/zeppelin-sdk/tsconfig.spec.json"],
Image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set parserOptions.project to true and unified the per-project config filenames from tsconfig.*.json to tsconfig.json. With this, @typescript-eslint/parser automatically picks the nearest tsconfig.json for each file instead of relying on hard-coded project paths, which avoids the path-resolution error we saw.

If/when we upgrade Angular further and adopt ESLint's flat config, we can switch to a javascript flat config and keep paths relative to the config file location using __dirname, which should remove this class of issues.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/apache/zeppelin/actions/runs/18752067872/job/53494105014?pr=5109

It seems like a good direction, but this might be the reason why the e2e tests are failing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added path mapping in e2e/tsconfig.json and it seems to work.

} from '@angular/core';
import { DomSanitizer, SafeHtml, SafeUrl } from '@angular/platform-browser';
import { default as AnsiUp } from 'ansi_up';
import { AnsiUp } from 'ansi_up';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

It seems like type definitions and related setup for ansi_up are required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can’t reproduce this locally. [email protected] ships its own type definitions. Could you try again on your end? If it still fails, a clean install (remove node_modules and the lockfile, then reinstall) or sharing your TS version and the exact error would help.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that .browserslistrc exists in both zeppelin-web-angular/ and zeppelin-web-angular/src/. Aside from comments, there doesn’t appear to be any difference between them. So I think it should be fine to keep just one of them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed src/.browserslistrc.

"ts-node": "~7.0.0",
"tsickle": "0.38.1",
"tslint": "~5.15.0",
"tslint-no-circular-imports": "^0.7.0",
Copy link
Contributor

@dididy dididy Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're removing TSLint, I think you can also remove nz-tslint-rules and tslint-no-circular-imports.
For any custom rules, you can either add them as ESLint rules if possible, or create an issue for them if not.

After that, you can remove the tslint-rule folder and the postinstall build step (npm run build:tslint-rules), and update the lint and lint:fix scripts to use ESLint instead.

It seems that src/tslint.json should be removed as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve removed all TSLint-related code for now. If we need any custom lint rules, we can re-implement them later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://issues.apache.org/jira/browse/ZEPPELIN-6372
I’ve opened an issue for this, and I’ll add it later.

@tbonelee
Copy link
Contributor Author

I've fixed failed .less file path resolution with this commit (f68719f)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

How about replacing the JIT-based RUNTIME_COMPILER_PROVIDERS with an Ivy-compatible approach?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think replacing this with reliable, public APIs won't be straightforward. The Angular team has opposed exposing a runtime API that compiles string templates for security and performance reasons.
(angular/angular-cli#9306 (comment))

We've also had to implement workarounds for related runtime-compiler/AOT issue. (#4809)

Given that, we may consider alternative approaches to rendering dynamic templates with data binding.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

, or else we could deprecate %angular interpreter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for checking instead. As you mentioned, since replacing it isn’t straightforward, I think it’s fine to leave it as is if there are no issues with its functionality. Deprecating the Angular interpreter for this would mean we won’t be able to upgrade it in the future, so that doesn’t seem like a good approach.

I’ve confirmed that all the reviews I left earlier are functioning correctly. Thank you for the great work, and I’ll take a closer look before approving. Thanks again.

>
<span style="vertical-align: middle; display: inline-block; margin-top: 3px; color: #333;">Available Fields</span>
<div style="clear: both;"></div>
<span style="vertical-align: middle; display: inline-block; margin-top: 3px; color: #333">Available Fields</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have a consistent rule for this as well, since in some cases the styles are aligned with line breaks and in others they are not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe printWidth option do that work. Also, as we use (almost) the latest prettier now, we won't face major reformatting for a while.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I think we can consider this part later. Thanks!

Copy link
Contributor

@dididy dididy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/dididy/zeppelin/actions/runs/18786968912

https://github.com/dididy/zeppelin/commits/pr/5109-e2e-2/

I created a new branch(e2e test purpose) based on current PR, merged #5101, #5102, and #5105 into it, and ran the tests — all of them passed. Since the core notebook-related features in Zeppelin are functioning properly, it seems there are no major issues.

ParkGyeongTae
ParkGyeongTae previously approved these changes Oct 26, 2025
Copy link
Contributor

@ParkGyeongTae ParkGyeongTae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@tbonelee tbonelee merged commit 358f9e5 into apache:master Oct 26, 2025
21 of 23 checks passed
tbonelee added a commit that referenced this pull request Oct 26, 2025
### What is this PR for?

This PR bumps Angular from 9 to 13 and updates related dependencies in zeppelin-web-angular.

It addresses:
- https://issues.apache.org/jira/browse/ZEPPELIN-6349
- https://issues.apache.org/jira/browse/ZEPPELIN-6227 (except the custom TSLint rules)

I removed the zeppelin-helium and helium-vis-example projects in this PR. The Angular rewrite of Helium was never completed, it’s currently unused, and it introduced circular-dependency-related stack overflows during the application build. Given that, removing these modules is the safer choice.

#### Principal version updates
- angular: 9 -> 13
- ansi_up: 4 -> 6
- date-fns: 2 -> 3
- tslib: 1 -> 2
- lint-staged: 8 -> 15
- typescript: 3.8 -> 4.6

### What type of PR is it?
Chore

### Todos
* [x] - Bump Angular version (Used angular cli)
* [x] - Migrate TSLint to ESLint (Used `<at>angular-eslint/schematics:convert-tslint-to-eslint`)
* [x] - Fix deprecated code usages
* [x] - Bump other minor dependencies
* [x] - Remove `zeppelin-helium` and `helium-vis-example`

### What is the Jira issue?

[ZEPPELIN-6349](https://issues.apache.org/jira/browse/ZEPPELIN-6349)

### How should this be tested?
- Run E2E tests
- Manual tests across various pages
- Verify `serve` (dev server), `build`, and `lint` work as expected

### Questions:
* Does the license files need to update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Closes #5109 from tbonelee/upgrade-web-angular.

Signed-off-by: ChanHo Lee <[email protected]>
(cherry picked from commit 358f9e5)
Signed-off-by: ChanHo Lee <[email protected]>
@tbonelee
Copy link
Contributor Author

Thanks, merged into master and branch-0.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants