Skip to content

refactor: split system info APIs - #6092

Merged
rex-zsd merged 1 commit into
youzan:devfrom
rex-zsd:codex/split-system-info
Oct 10, 2026
Merged

rex-zsd merged 1 commit into
youzan:devfrom
rex-zsd:codex/split-system-info

Conversation

@rex-zsd

@rex-zsd rex-zsd commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Components previously read SDK, device and window fields from a permanently cached wx.getSystemInfoSync() result. Use wx.getAppBaseInfo(), wx.getDeviceInfo() and wx.getWindowInfo() for their respective fields, with independent legacy fallbacks and existing helper exports preserved.

An upward DropdownMenu now uses the current window height whenever it positions its popup. Circle reads the pixel ratio only when initializing its 2D canvas. Preserve WeCom detection, raise the typings dependency minimum to ^3.4.4 while keeping the locked version at 3.12.2, and update the affected dist and lib files.

Validation:

  • Existing Jest suite: 55 suites, 56 tests and 55 snapshots passed.
  • TypeScript checks for ES and CommonJS configurations passed.
  • Focused ESLint and git diff --check passed.
  • Frozen lockfile dependency installation passed.

Copilot AI 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.

🟢 Approval recommended

The focused refactor preserves compatibility and keeps source, generated outputs, typings, and dependencies consistent.

0 open findings

What changed in this PR

Refactors system information access into field-specific APIs while preserving legacy compatibility and exports.

Changes:

  • Adds cached app/device helpers and dynamic window information access.
  • Updates affected components and preserves WeCom detection.
  • Regenerates dist/lib outputs and updates typings.
File Description
package.json Raises typings minimum.
yarn.lock Updates typings lock entry.
packages/​common/​system.ts Adds system information helpers.
packages/​common/​version.ts Uses app base information.
packages/​common/​utils.ts Exports helpers and updates detection.
packages/​notify/​index.ts Uses window status-bar data.
packages/​nav-bar/​index.ts Uses window status-bar data.
packages/​dropdown-menu/​index.ts Reads current window height.
packages/​circle/​index.ts Reads DPR during initialization.
lib/​common/​system.js CommonJS helper output.
lib/​common/​system.d.ts CommonJS helper declarations.
lib/​common/​version.js CommonJS version output.
lib/​common/​version.d.ts CommonJS version declarations.
lib/​common/​utils.js CommonJS utility output.
lib/​common/​utils.d.ts CommonJS utility declarations.
lib/​notify/​index.js CommonJS notify output.
lib/​nav-bar/​index.js CommonJS nav-bar output.
lib/​dropdown-menu/​index.js CommonJS dropdown output.
lib/​circle/​index.js CommonJS circle output.
dist/​common/​system.js ES helper output.
dist/​common/​system.d.ts ES helper declarations.
dist/​common/​version.js ES version output.
dist/​common/​version.d.ts ES version declarations.
dist/​common/​utils.js ES utility output.
dist/​common/​utils.d.ts ES utility declarations.
dist/​notify/​index.js ES notify output.
dist/​nav-bar/​index.js ES nav-bar output.
dist/​dropdown-menu/​index.js ES dropdown output.
dist/​circle/​index.js ES circle output.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@rex-zsd
rex-zsd merged commit 93f06bd into youzan:dev Oct 10, 2026
4 checks passed
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.

2 participants