Skip to content

deps: upgrade three.js from 0.115.0 to 0.182.0#2801

Closed
mgtc wants to merge 2 commits intoantvis:masterfrom
mgtc:chore/threejs-upgrade
Closed

deps: upgrade three.js from 0.115.0 to 0.182.0#2801
mgtc wants to merge 2 commits intoantvis:masterfrom
mgtc:chore/threejs-upgrade

Conversation

@mgtc
Copy link
Copy Markdown

@mgtc mgtc commented Jan 11, 2026

[English Template / 英文模板]

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 工作流程
  • 版本更新
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

close #2782

该 PR 响应 issue #2782 中提出的需求,将 L7-three 模块的 threejs 依赖从 0.115.0 升级到 0.182.0

💡 需求背景和解决方案

1. 要解决的具体问题

L7-three 模块当前使用 threejs 0.115.0 版本(2020年发布),存在以下问题:

  • 版本过旧,无法使用 threejs 新特性
  • 与最新的 threejs 生态脱节
  • 缺少性能优化和安全修复

2. 最终的 API 实现和用法

  • 用户侧无变化,L7-three 的所有公开 API 保持不变
  • 内部适配:使用 renderer.outputColorSpace 替代已废弃的 renderer.outputEncoding

📝 更新日志

语言 更新描述
🇺🇸 英文 upgrade three.js dependency from 0.115.0 to 0.182.0. no breaking changes, existing code works without modification
🇨🇳 中文 升级 Three.js 依赖从 0.115.0 到 0.182.0,无破坏性变更,现有代码无需修改

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 11, 2026

🦋 Changeset detected

Latest commit: d9146cb

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

This PR includes changesets to release 12 packages
Name Type
@antv/l7-three Major
@antv/l7 Major
@antv/l7-component Major
@antv/l7-core Major
@antv/l7-layers Major
@antv/l7-map Major
@antv/l7-maps Major
@antv/l7-renderer Major
@antv/l7-scene Major
@antv/l7-source Major
@antv/l7-test-utils Major
@antv/l7-utils Major

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
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @mgtc, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request performs a major upgrade of the Three.js library from version 0.115.0 to 0.182.0 within the L7-three module. The primary goal is to modernize the underlying 3D rendering capabilities, enabling access to newer features, performance optimizations, and security fixes provided by the latest Three.js ecosystem. The changes are primarily internal, ensuring that the public API of L7-three remains stable for users while adapting to the updated Three.js API.

Highlights

  • Three.js Dependency Upgrade: The core Three.js dependency has been significantly upgraded from version 0.115.0 to 0.182.0 across the project, including the @antv/l7-three package and site examples.
  • API Adaptations: Internal code has been updated to align with new Three.js API changes, such as replacing renderer.state.reset() with renderer.resetState() and migrating from renderer.gammaFactor to renderer.outputColorSpace for color management.
  • Geometry and Camera Handling Updates: Examples and core rendering logic have been adjusted to use updated Three.js geometry handling (e.g., BoxGeometry instead of BoxBufferGeometry, and new methods for vertex manipulation) and enhanced camera projection matrix management.
  • Documentation and Examples: Documentation and various examples have been updated to reflect the new Three.js version compatibility and to incorporate the necessary API changes.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Code Review

本次 PR 将 three.js 的依赖从 0.115.0 升级到了 0.182.0。这是一次非常重要且有价值的更新,引入了 three.js 多年来的新特性、性能优化和安全修复。您在适配代码以适应 three.js 在此期间引入的重大变更方面做得非常出色,例如渲染器状态、颜色空间管理、相机矩阵更新和几何体顶点操作等 API 的变更。代码修改彻底且正确。我只有一个关于提高代码可维护性的小建议。

*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getObjectLngLat(object: Object3D) {
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.

medium

参数 object 在函数中并未使用。为了明确表示该参数是故意未使用的,并避免潜在的 lint 错误,建议在其名称前添加下划线前缀 _

Suggested change
public getObjectLngLat(object: Object3D) {
public getObjectLngLat(_object: Object3D) {

@lzxue
Copy link
Copy Markdown
Contributor

lzxue commented Mar 12, 2026

新版已经升级完成

@lzxue lzxue closed this Mar 12, 2026
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.

L7-three 内部threejs版本升级

2 participants