Skip to content

chore: remove dead code in maps & legacy build#2874

Merged
lzxue merged 2 commits into
masterfrom
cleanup/dead-code
Jul 18, 2026
Merged

chore: remove dead code in maps & legacy build#2874
lzxue merged 2 commits into
masterfrom
cleanup/dead-code

Conversation

@lzxue

@lzxue lzxue commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

清理死代码(零行为变更)

上一轮包合并 (12→8) 后的走查中发现的零引用文件,纯删除,无新增代码。

maps: 删除零引用 theme.ts ×3

map/theme.tsmapbox/theme.tsearth/theme.tsutils/theme.ts 逐字节相同diff 全空),且全仓无任何 import

$ grep -rn "from './theme'" packages/maps/src
packages/maps/src/utils/BaseMapService.ts   # 唯一引用方
packages/maps/src/amap-next/map.ts          # 唯一引用方

maps: 删除 tdtmap 孤儿 logo.css

其余 6 个适配器的 map.ts 都有 import './logo.css',唯独 tdtmap/map.ts 没有,但目录里留有 logo.css —— 孤儿文件。

legacy: 删除旧 rollup 构建脚本

迁移到 father 之前的构建脚本(rollup.config.jsrollup.config.worker.jsrollup-plugin-glsl.jsrollup-plugin-inline-worker.jsrollup-plugin-miniapp.jsbundle.ts),全仓无引用。legacy/dev-docs/legacy/scripts/ 作为归档保留。

验证

  • @antv/l7-maps esm/cjs + umd 全部构建通过
  • es 产物仅保留被引用的 utils/theme.tsamap-next/theme.ts
  • tsceslint 通过

改动

10 files changed, 336 deletions(-)

- maps: 删除三份零引用的 theme.ts (map/, mapbox/, earth/,与 utils/theme.ts
  逐字节相同且无任何 import); 删除 tdtmap 孤儿 logo.css (无 map.ts 引用)
- legacy: 删除迁移到 father 之前的旧 rollup 构建脚本 (rollup.config*.js,
  rollup-plugin-*.js, bundle.ts),全仓无引用

构建验证: @antv/l7-maps esm/cjs (88 文件) + umd 全部通过
@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7dc166b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

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

Copy link
Copy Markdown
Contributor

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 cleans up the codebase by removing several unused configuration files, Rollup plugins (such as glsl and inline-worker), build configurations, duplicate MapTheme definitions, and CSS styles. I have no feedback to provide as there are no review comments to evaluate.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@lzxue

lzxue commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

CI 失败说明(非代码问题)

本 PR 的 lint / unit-test / size-test 三个 job 都在 install 阶段 ~10s 内失败

[ERROR] Cannot use 'in' operator to search for 'integrity' in undefined

根因.github/actions/prepare-install/action.yml 用浮动 version: 11,近期解析到新发布的 pnpm 11.13.0,它读当前 lockfile(由 pnpm@11.12.0 生成)时崩溃。与本 PR 的代码改动无关——本 PR 只动了 (见文件清单),不碰 lockfile/package.json/workflow。

对照证据:较早的 PR(#2863 / #2856 / #2853 等)跑 lint (20.x) 全 pass 且耗时 2 分钟+;近期 11.13.0 发布后所有新 PR 才开始 10s 内崩在 install。

修复:已开 #2876 固定 pnpm 到 11.12.0

注:#2876 因 ci.yml 的 paths: [packages/**, __tests__/**] filter 不触发 lint workflow,无法自验证;为让本 PR 的 CI 真正跑起来验证代码,已在本分支附带该 1 行 pin(见相关 commit)。

prepare-install 复合 action 原用浮动 version: 11,最近解析到新发布的
pnpm 11.13.0,导致 pnpm install 在解析 lockfile 时崩溃:

  [ERROR] Cannot use 'in' operator to search for 'integrity' in undefined

影响所有基于当前 master 的新 PR(lint/unit-test/size-test 在 install
阶段即失败,~10s),与各 PR 的代码改动无关。

固定为 11.12.0(与 package.json 的 packageManager 字段一致)。
action-setup@v3 本身可读 packageManager,但显式 pin 更稳妥。
@lzxue
lzxue merged commit a281dba into master Jul 18, 2026
4 checks passed
@lzxue
lzxue deleted the cleanup/dead-code branch July 18, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant