Skip to content

fix(antdx): resolve Think component React #130 in production build - #123

Merged
Col0ring merged 1 commit into
mainfrom
fix/antdx-think
May 18, 2026
Merged

fix(antdx): resolve Think component React #130 in production build#123
Col0ring merged 1 commit into
mainfrom
fix/antdx-think

Conversation

@Col0ring

Copy link
Copy Markdown
Collaborator

closes #121

@changeset-bot

changeset-bot Bot commented May 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 111e871

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@modelscope-studio/frontend Patch
@modelscope-studio/antdx Patch
modelscope_studio Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request addresses a production build issue for the Think component by updating the Vite plugin to correctly handle default import mappings for namespace-style globals and ensuring that children are properly forwarded to the XThink component. The baseGlobals configuration in the plugin now distinguishes between namespace and value-style globals to ensure correct resolution during transformation. I have no feedback to provide.

@Col0ring
Col0ring merged commit c36d784 into main May 18, 2026
2 checks passed
@Col0ring
Col0ring deleted the fix/antdx-think branch May 18, 2026 09:35
Col0ring added a commit that referenced this pull request Aug 12, 2026
The externalize transform referenced an undefined `variable` instead of
`entry.ref`, so every chunk importing a global would have thrown a
ReferenceError at build time, and the `ImportDefaultSpecifier` branch had
lost the `entry.namespace` check while still documenting it in a comment,
which silently reverted the Icon default import fix from #123.

- pass `entry.ref` to the global expression helpers
- resolve default imports of namespace globals back to `<ref>.default`,
  keeping value globals on `<ref>` itself
Col0ring added a commit that referenced this pull request Aug 13, 2026
…build for Vite 8 + rolldown (#125)

* chore: upgrade deps to antd 6.6.0 and antdx 2.9.0

- bump antd 6.4.2 -> 6.6.0 and @ant-design/x 2.7.0 -> 2.9.0, along with
  React 19.2.8, svelte 5.56.8, babel 8, monaco-editor 0.56, katex 0.18,
  TypeScript 6 and the @gradio/* packages
- switch @vitejs/plugin-react-swc to @vitejs/plugin-react
- add GradioDevModePlugin to rewrite the `_NORMAL_` mode marker that
  @gradio/preview fails to replace when it is emitted as a template
  literal, so `gradio cc dev` reaches the backend instead of Vite
- build global member expressions for dotted global paths and support
  string literal import/export names in the externalize transform
- update monaco-editor worker import paths for monaco-editor 0.56
- reset loading_status to null when `ms_auto_loading` is false
- resolve tsconfig `paths` relative to the config file instead of
  `baseUrl`, which TypeScript 6 deprecates and TypeScript 7 will drop
- declare `*less` next to the existing `*css` so side-effect imports of
  less files type-check under TypeScript 6
- ignore the local `gradio` symlink used for `gradio cc dev`

* feat: sync antd 6.6.0 and antdx 2.9.0 apis, add BorderBeam and Listy

New components:

- add antd.BorderBeam with `color`, `count`, `duration`, `line_width`,
  `outset` and `size`
- add antd.Listy with `items`, `row_key`, `item_render`, `group`,
  `height`, `sticky`, `virtual`, a `scroll` event and the `itemRender`
  and `group.title` slots. `row_key` takes either a field name or a
  Javascript function string; `scrollTo` stays unsupported as the
  imperative ref cannot be reached from Python

antd 6.4.2 -> 6.6.0:

- add a `clear` event to DatePicker, DatePicker.RangePicker, TimePicker
  and TimePicker.RangePicker
- add Modal and Modal.Static `scroll_lock`, Steps `max_count` and
  FloatButton.BackTop `show_progress`
- add Mentions `popup_render`, the Tabs `more.popupRender` slot and the
  `components.sizeChanger` slot for Pagination and Table pagination
- allow Slider `disabled` to be a list, Watermark `content` to carry
  per line font styles and Select `token_separators` to be a function
- complete the Dropdown and Dropdown.Button `placement` values
- add the `sq_AL` locale to ConfigProvider
- fix Input.Password `visiable_toggle` never reaching antd because of
  the typo, add `visibility_toggle` and keep the old name working
- fix a missing comma in Table SLOTS that concatenated `rowSelection`
  with `loading.tip`

antdx 2.7.0 -> 2.9.0:

- add Folder `context_menu` (items or a Javascript function string), a
  `right_click` event and Folder.TreeNode `context_menu`, which also
  accepts False to opt a single node out
- add Think and ThoughtChain.ThoughtChainItem `destroy_on_hidden`

* fix(changelog): migrate to the @changesets/get-github-info v1 api

`getInfo` and `getInfoFromPullRequest` were replaced by `getCommitInfo`
and `getPullRequestInfo`, which return `undefined` when the commit, pull
request or repository cannot be found and expose `markdownLink` on each
entity instead of a flat `links` object.

- map `links.commit`, `links.pull` and `links.user` onto
  `commit.markdownLink`, `pull.markdownLink` and `author.markdownLink`,
  falling back to null so the existing prefix and suffix handling is
  unchanged
- extract `get_repo` to null check `changelogOpts` and narrow the repo to
  a string, which the `null | Record<string, unknown>` signature requires

* fix: pin the tsup dts build to typescript 5.9

The dts build reads the compiler API through `require('typescript')` and
injects `baseUrl` into the compiler options. TypeScript 7 only exposes
`version` from its main entry, so `ts.sys` is undefined and the build
crashes, and TypeScript 6 reports the injected `baseUrl` as a deprecated
option error.

Scope the override to tsup so the workspace keeps TypeScript 6 while the
dts build gets a version that supports both. This also drops the stale
typescript 7 entries that peer resolution could otherwise hand to
typescript-eslint, which refuses to run on TypeScript 7.

* fix: babel

* fix: restore the global ref and namespace handling in the vite plugin

The externalize transform referenced an undefined `variable` instead of
`entry.ref`, so every chunk importing a global would have thrown a
ReferenceError at build time, and the `ImportDefaultSpecifier` branch had
lost the `entry.namespace` check while still documenting it in a comment,
which silently reverted the Icon default import fix from #123.

- pass `entry.ref` to the global expression helpers
- resolve default imports of namespace globals back to `<ref>.default`,
  keeping value globals on `<ref>` itself

* fix: gradio deps

* fix: rolldown externals

* chore: add changelog
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.

antdx.Think组件报错

1 participant