Skip to content

CONSOLE-5159: Replace deprecated Node10 moduleResolution with Bundler for TS6 compatibility#16259

Open
sachaudh wants to merge 1 commit intoopenshift:mainfrom
sachaudh:fix/ts6-module-resolution-deprecation
Open

CONSOLE-5159: Replace deprecated Node10 moduleResolution with Bundler for TS6 compatibility#16259
sachaudh wants to merge 1 commit intoopenshift:mainfrom
sachaudh:fix/ts6-module-resolution-deprecation

Conversation

@sachaudh
Copy link
Copy Markdown

@sachaudh sachaudh commented Apr 6, 2026

CONSOLE Features and Fixes:

Fixes TypeScript 6+ compatibility for @openshift-console/dynamic-plugin-sdk-webpack.

Jira: https://issues.redhat.com/browse/CONSOLE-5159

Solution description

getDynamicModuleMap() in dynamic-module-parser.ts hardcodes
moduleResolution: ts.ModuleResolutionKind.NodeJs (alias for Node10).
TypeScript 6 treats this as a hard error (TS5107), breaking all consumers.

This replaces it with ts.ModuleResolutionKind.Bundler, which is functionally
equivalent -- the SDK only resolves relative paths within PatternFly packages'
dist/esm/ and dist/dynamic/ directories.

This also prepares for TypeScript 7, where node10 will stop functioning entirely.

Closes #16258

Test cases:

  • Build an OCP plugin project with TypeScript 6.0.2 -- webpack config loads successfully
  • PatternFly dynamic module exports are parsed correctly (765 exports from @patternfly/react-core, zero errors)

Additional info:

  • No visual/content/interaction changes
  • Alternative fix: add ignoreDeprecations: '6.0' instead, but that only suppresses the warning without removing the deprecated option
  • All published versions of @openshift-console/dynamic-plugin-sdk-webpack are affected, including latest 4.22.0-prerelease.2

Screen shots / gifs / design review:

N/A -- no UI changes

Summary by CodeRabbit

  • Bug Fixes
    • Improved module resolution handling for dynamic plugin modules in the SDK.

TypeScript 6 treats moduleResolution node10 as deprecated and emits
TS5107 as a hard error. Since ModuleResolutionKind.NodeJs is an alias
for Node10, this breaks any consumer using TypeScript 6+.

The SDK only resolves relative paths within PatternFly packages'
dist/esm/ and dist/dynamic/ directories, so Bundler resolution is
functionally equivalent.

This also prepares for TypeScript 7, where node10 will stop
functioning entirely.

Closes openshift#16258

Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 6, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 6, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Apr 6, 2026

@sachaudh: This pull request references CONSOLE-5159 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

CONSOLE Features and Fixes:

Fixes TypeScript 6+ compatibility for @openshift-console/dynamic-plugin-sdk-webpack.

Jira: https://issues.redhat.com/browse/CONSOLE-5159

Solution description

getDynamicModuleMap() in dynamic-module-parser.ts hardcodes
moduleResolution: ts.ModuleResolutionKind.NodeJs (alias for Node10).
TypeScript 6 treats this as a hard error (TS5107), breaking all consumers.

This replaces it with ts.ModuleResolutionKind.Bundler, which is functionally
equivalent -- the SDK only resolves relative paths within PatternFly packages'
dist/esm/ and dist/dynamic/ directories.

This also prepares for TypeScript 7, where node10 will stop functioning entirely.

Closes #16258

Test cases:

  • Build an OCP plugin project with TypeScript 6.0.2 -- webpack config loads successfully
  • PatternFly dynamic module exports are parsed correctly (765 exports from @patternfly/react-core, zero errors)

Additional info:

  • No visual/content/interaction changes
  • Alternative fix: add ignoreDeprecations: '6.0' instead, but that only suppresses the warning without removing the deprecated option
  • All published versions of @openshift-console/dynamic-plugin-sdk-webpack are affected, including latest 4.22.0-prerelease.2

Screen shots / gifs / design review:

N/A -- no UI changes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the component/sdk Related to console-plugin-sdk label Apr 6, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 6, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sachaudh
Once this PR has been reviewed and has the lgtm label, please assign spadgett for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 6, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 6, 2026

Hi @sachaudh. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@sachaudh sachaudh marked this pull request as ready for review April 6, 2026 19:39
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 6, 2026
@openshift-ci openshift-ci bot requested review from cajieh and rhamilto April 6, 2026 19:40
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Apr 6, 2026

@sachaudh: This pull request references CONSOLE-5159 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

CONSOLE Features and Fixes:

Fixes TypeScript 6+ compatibility for @openshift-console/dynamic-plugin-sdk-webpack.

Jira: https://issues.redhat.com/browse/CONSOLE-5159

Solution description

getDynamicModuleMap() in dynamic-module-parser.ts hardcodes
moduleResolution: ts.ModuleResolutionKind.NodeJs (alias for Node10).
TypeScript 6 treats this as a hard error (TS5107), breaking all consumers.

This replaces it with ts.ModuleResolutionKind.Bundler, which is functionally
equivalent -- the SDK only resolves relative paths within PatternFly packages'
dist/esm/ and dist/dynamic/ directories.

This also prepares for TypeScript 7, where node10 will stop functioning entirely.

Closes #16258

Test cases:

  • Build an OCP plugin project with TypeScript 6.0.2 -- webpack config loads successfully
  • PatternFly dynamic module exports are parsed correctly (765 exports from @patternfly/react-core, zero errors)

Additional info:

  • No visual/content/interaction changes
  • Alternative fix: add ignoreDeprecations: '6.0' instead, but that only suppresses the warning without removing the deprecated option
  • All published versions of @openshift-console/dynamic-plugin-sdk-webpack are affected, including latest 4.22.0-prerelease.2

Screen shots / gifs / design review:

N/A -- no UI changes

Summary by CodeRabbit

  • Bug Fixes
  • Improved module resolution handling for dynamic plugin modules in the SDK.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 9ea732f1-8b6c-4504-9553-2273aaee7242

📥 Commits

Reviewing files that changed from the base of the PR and between d0f1252 and f3f1305.

📒 Files selected for processing (1)
  • frontend/packages/console-dynamic-plugin-sdk/src/utils/dynamic-module-parser.ts
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • frontend/packages/console-dynamic-plugin-sdk/src/utils/dynamic-module-parser.ts
🔇 Additional comments (1)
frontend/packages/console-dynamic-plugin-sdk/src/utils/dynamic-module-parser.ts (1)

11-11: Good TS6 compatibility update.

Line 11’s switch to ts.ModuleResolutionKind.Bundler is the right fix for the TS5107 deprecation path and stays consistent with this utility’s ESM module parsing flow.


📝 Walkthrough

Walkthrough

This change modifies the TypeScript compiler configuration within the dynamic module parser utility. The moduleResolution setting was updated from NodeJs to Bundler mode. This affects how the TypeScript compiler resolves module specifiers when analyzing exported types from dynamic modules during the program creation and type-checking phases. The modification is internal to the compiler options and does not alter any exported APIs, control flow, logic, or error handling behavior of the module parser.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

component/sdk Related to console-plugin-sdk jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dynamic-plugin-sdk-webpack: Hardcoded moduleResolution Node10 breaks TypeScript 6+ (TS5107)

2 participants