fix: Remove the deprecated intersection-observer dependency#2904
Open
Arktomson wants to merge 1 commit intoalibaba:masterfrom
Open
fix: Remove the deprecated intersection-observer dependency#2904Arktomson wants to merge 1 commit intoalibaba:masterfrom
Arktomson wants to merge 1 commit intoalibaba:masterfrom
Conversation
- 移除 intersection-observer polyfill,因为它已不再需要 - IntersectionObserver 自 2019 年起已成为 Web 标准 - 所有现代浏览器都原生支持该 API - 减少打包体积并移除废弃依赖 Fixes alibaba#2870
commit: |
meet-student
approved these changes
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 这个变动的性质是?
🔗 相关 Issue
Fixes #2870
💡 需求背景和解决方案
问题:
项目依赖了已废弃的
intersection-observer@0.12.2包。该包在 npm 上已被标记为 deprecated,官方说明:解决方案:
packages/hooks/src/useInViewport/index.ts中的import 'intersection-observer'语句packages/hooks/package.json中删除intersection-observer依赖pnpm-lock.yaml原因:
IntersectionObserverAPI 自 2019 年起已成为 W3C 标准验证:
useInViewport功能正常📝 更新日志
intersection-observerdependency. Modern browsers support IntersectionObserver API natively.intersection-observer依赖。现代浏览器已原生支持 IntersectionObserver API。☑️ 请求合并前的自查清单