From 6f347e479a1b94be749bdb81da099db0ffdf5f57 Mon Sep 17 00:00:00 2001 From: Aaron Date: Mon, 25 Nov 2024 14:11:59 +0800 Subject: [PATCH] Release (#1848) * fix: fixed the issue where RenderCache could not cache RenderPipeline (#1839) * chore: add changeset * fix: fix incorrect bounds calculate when pass stroke and lineWidth to group (#1847) * fix: fix incorrect bounds calculate when pass stroke and lineWidth to group * chore: commit changeset * test: fix test case * update test (#1846) * chore: fix test * chore: update vite version * chore: update test snapshots * chore: remove pnpm-lock.yaml * chore: update workflows --------- Co-authored-by: Aaron * chore: update workflows (#1849) * chore(release): bump version (#1845) Co-authored-by: github-actions[bot] --------- Co-authored-by: RE <1609403959@qq.com> Co-authored-by: wang1212 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] --- .github/workflows/{test.yml => ci.yml} | 16 +- .github/workflows/lint.yml | 32 - .github/workflows/release.yml | 17 +- .github/workflows/version.yml | 13 +- .gitignore | 1 + __tests__/demos/bugfix/group-with-stroke.ts | 53 + __tests__/demos/bugfix/index.ts | 1 + __tests__/index.html | 7 +- __tests__/integration/generator.ts | 2 +- .../integration/snapshots/2d/canvas/text.png | Bin 12254 -> 12294 bytes .../integration/snapshots/2d/svg/text.png | Bin 10148 -> 10171 bytes .../integration/snapshots/2d/webgl/text.png | Bin 15961 -> 15968 bytes __tests__/main.ts | 5 +- __tests__/unit/abstract-renderer.spec.ts | 2 + .../display-object.node.spec.ts | 2 +- package.json | 2 +- packages/g-camera-api/CHANGELOG.md | 7 + packages/g-camera-api/package.json | 2 +- packages/g-canvas/CHANGELOG.md | 13 + packages/g-canvas/package.json | 2 +- packages/g-canvaskit/CHANGELOG.md | 13 + packages/g-canvaskit/package.json | 2 +- packages/g-components/CHANGELOG.md | 7 + packages/g-components/package.json | 2 +- .../g-dom-mutation-observer-api/CHANGELOG.md | 7 + .../g-dom-mutation-observer-api/package.json | 2 +- packages/g-gesture/CHANGELOG.md | 7 + packages/g-gesture/package.json | 2 +- packages/g-image-exporter/CHANGELOG.md | 7 + packages/g-image-exporter/package.json | 2 +- packages/g-lite/CHANGELOG.md | 6 + packages/g-lite/package.json | 2 +- packages/g-lite/src/css/StyleValueRegistry.ts | 50 +- packages/g-lite/src/display-objects/Group.ts | 15 +- packages/g-lottie-player/CHANGELOG.md | 7 + packages/g-lottie-player/package.json | 2 +- packages/g-mobile-canvas-element/CHANGELOG.md | 7 + packages/g-mobile-canvas-element/package.json | 2 +- packages/g-mobile-canvas/CHANGELOG.md | 14 + packages/g-mobile-canvas/package.json | 2 +- packages/g-mobile-svg/CHANGELOG.md | 12 + packages/g-mobile-svg/package.json | 2 +- packages/g-mobile-webgl/CHANGELOG.md | 14 + packages/g-mobile-webgl/package.json | 2 +- packages/g-pattern/CHANGELOG.md | 7 + packages/g-pattern/package.json | 2 +- packages/g-plugin-3d/CHANGELOG.md | 9 + packages/g-plugin-3d/package.json | 2 +- packages/g-plugin-a11y/CHANGELOG.md | 7 + packages/g-plugin-a11y/package.json | 2 +- packages/g-plugin-annotation/CHANGELOG.md | 7 + packages/g-plugin-annotation/package.json | 2 +- packages/g-plugin-box2d/CHANGELOG.md | 7 + packages/g-plugin-box2d/package.json | 2 +- .../CHANGELOG.md | 7 + .../package.json | 2 +- packages/g-plugin-canvas-picker/CHANGELOG.md | 9 + packages/g-plugin-canvas-picker/package.json | 2 +- .../g-plugin-canvas-renderer/CHANGELOG.md | 9 + .../g-plugin-canvas-renderer/package.json | 2 +- .../g-plugin-canvaskit-renderer/CHANGELOG.md | 8 + .../g-plugin-canvaskit-renderer/package.json | 2 +- packages/g-plugin-control/CHANGELOG.md | 7 + packages/g-plugin-control/package.json | 2 +- packages/g-plugin-css-select/CHANGELOG.md | 7 + packages/g-plugin-css-select/package.json | 2 +- .../g-plugin-device-renderer/CHANGELOG.md | 9 + .../g-plugin-device-renderer/package.json | 2 +- .../src/render/RenderCache.ts | 9 +- .../g-plugin-dom-interaction/CHANGELOG.md | 7 + .../g-plugin-dom-interaction/package.json | 2 +- packages/g-plugin-dragndrop/CHANGELOG.md | 7 + packages/g-plugin-dragndrop/package.json | 2 +- packages/g-plugin-gesture/CHANGELOG.md | 7 + packages/g-plugin-gesture/package.json | 2 +- packages/g-plugin-html-renderer/CHANGELOG.md | 7 + packages/g-plugin-html-renderer/package.json | 2 +- packages/g-plugin-image-loader/CHANGELOG.md | 7 + packages/g-plugin-image-loader/package.json | 2 +- packages/g-plugin-matterjs/CHANGELOG.md | 7 + packages/g-plugin-matterjs/package.json | 2 +- .../g-plugin-mobile-interaction/CHANGELOG.md | 7 + .../g-plugin-mobile-interaction/package.json | 2 +- packages/g-plugin-physx/CHANGELOG.md | 7 + packages/g-plugin-physx/package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- .../g-plugin-rough-svg-renderer/CHANGELOG.md | 8 + .../g-plugin-rough-svg-renderer/package.json | 2 +- packages/g-plugin-svg-picker/CHANGELOG.md | 8 + packages/g-plugin-svg-picker/package.json | 2 +- packages/g-plugin-svg-renderer/CHANGELOG.md | 7 + packages/g-plugin-svg-renderer/package.json | 2 +- packages/g-plugin-yoga/CHANGELOG.md | 7 + packages/g-plugin-yoga/package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- .../g-plugin-zdog-svg-renderer/CHANGELOG.md | 9 + .../g-plugin-zdog-svg-renderer/package.json | 2 +- packages/g-svg/CHANGELOG.md | 10 + packages/g-svg/package.json | 2 +- packages/g-web-animations-api/CHANGELOG.md | 7 + packages/g-web-animations-api/package.json | 2 +- packages/g-web-components/CHANGELOG.md | 9 + packages/g-web-components/package.json | 2 +- packages/g-webgl/CHANGELOG.md | 12 + packages/g-webgl/package.json | 2 +- packages/g-webgpu/CHANGELOG.md | 12 + packages/g-webgpu/package.json | 2 +- packages/g/CHANGELOG.md | 10 + packages/g/package.json | 2 +- packages/react-g/CHANGELOG.md | 6 + packages/react-g/package.json | 2 +- pnpm-lock.yaml | 14580 ---------------- 114 files changed, 575 insertions(+), 14717 deletions(-) rename .github/workflows/{test.yml => ci.yml} (87%) delete mode 100644 .github/workflows/lint.yml create mode 100644 __tests__/demos/bugfix/group-with-stroke.ts delete mode 100644 pnpm-lock.yaml diff --git a/.github/workflows/test.yml b/.github/workflows/ci.yml similarity index 87% rename from .github/workflows/test.yml rename to .github/workflows/ci.yml index 43caf4ab4..b01d95a2d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/ci.yml @@ -17,18 +17,17 @@ jobs: with: python-version: '3.10' - - uses: pnpm/action-setup@v2 - with: - version: 9 - - - name: Use Node.js 20 + - name: Use Node.js uses: actions/setup-node@v3 with: node-version: 20 - cache: 'pnpm' + + - uses: pnpm/action-setup@v4 + with: + version: 9 - name: Install dependencies - run: pnpm install + run: pnpm install --no-frozen-lockfile - name: Install Playwright browsers run: npx playwright install --with-deps @@ -36,6 +35,9 @@ jobs: - name: Build run: pnpm build + - name: Lint + run: pnpm lint + - name: Test run: pnpm test diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index d6e974df9..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: 🚀 Lint - -on: ['pull_request'] - -jobs: - lint: - name: Lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - # Python 3.11 和 node-gyp 有兼容问题, 导致无法安装依赖 - # https://github.com/slint-ui/slint/commit/a9c48e33502fdebc36c5aa2f4f516c2218424679#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133dd - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - uses: pnpm/action-setup@v2 - with: - version: 9 - - - name: Use Node.js 20 - uses: actions/setup-node@v3 - with: - node-version: 20 # semantic-release 需要 >= 16 的 Node.js 环境 - cache: 'pnpm' - - - name: Install dependencies - run: pnpm install - - - name: Lint - run: pnpm lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9cfdac8e2..a2bddd375 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,15 +18,17 @@ jobs: with: python-version: '3.10' - - uses: pnpm/action-setup@v2 - with: - version: 9 - - - name: Use Node.js 20 + - name: Use Node.js uses: actions/setup-node@v3 with: node-version: 20 - cache: 'pnpm' + + - uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Install dependencies + run: pnpm install --no-frozen-lockfile # 发布开始通知 - name: Release start ding talk dev group notify @@ -45,9 +47,6 @@ jobs: } } - - name: Install dependencies - run: pnpm install - - name: Build run: pnpm build diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 83e306b01..9a1657abd 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -17,18 +17,17 @@ jobs: with: python-version: '3.10' - - uses: pnpm/action-setup@v2 - with: - version: 9 - - - name: Use Node.js 20 + - name: Use Node.js uses: actions/setup-node@v3 with: node-version: 20 - cache: 'pnpm' + + - uses: pnpm/action-setup@v4 + with: + version: 9 - name: Install dependencies - run: pnpm install + run: pnpm install --no-frozen-lockfile - name: Create Release Pull Request uses: changesets/action@v1 diff --git a/.gitignore b/.gitignore index 6dae14527..30a1c1923 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ pids *.seed *.pid.lock yarn.lock +pnpm-lock.yaml .dumi # Directory for instrumented libs generated by jscoverage/JSCover diff --git a/__tests__/demos/bugfix/group-with-stroke.ts b/__tests__/demos/bugfix/group-with-stroke.ts new file mode 100644 index 000000000..11851f373 --- /dev/null +++ b/__tests__/demos/bugfix/group-with-stroke.ts @@ -0,0 +1,53 @@ +import { Group, Path, Rect, runtime } from '@antv/g'; + +export async function group_with_stroke(context) { + const { canvas } = context; + + runtime.enableMassiveParsedStyleAssignOptimization = true; + + await canvas.ready; + + const group = new Group({ + style: { + stroke: 'red', + lineWidth: 6, + }, + }); + + group.appendChild( + new Path({ + style: { + d: [ + ['M', 100, 100], + ['L', 200, 100], + ['L', 200, 200], + ], + stroke: 'pink', + lineWidth: 2, + }, + }), + ); + + canvas.appendChild(group); + + const bounds = group.getRenderBounds(); + + const { + min: [minX, minY], + max: [maxX, maxY], + } = bounds; + const width = maxX - minX; + const height = maxY - minY; + const rect = new Rect({ + style: { + x: minX, + y: minY, + width, + height, + fill: 'green', + fillOpacity: 0.1, + }, + }); + + canvas.appendChild(rect); +} diff --git a/__tests__/demos/bugfix/index.ts b/__tests__/demos/bugfix/index.ts index 07da08e87..abcffb7b7 100644 --- a/__tests__/demos/bugfix/index.ts +++ b/__tests__/demos/bugfix/index.ts @@ -9,3 +9,4 @@ export { zoom } from './1667'; export { test_pick } from './1747'; export { issue_1760 } from './1760'; export { textWordWrap } from './textWordWrap'; +export { group_with_stroke } from './group-with-stroke'; diff --git a/__tests__/index.html b/__tests__/index.html index adcdec7a8..93357a57a 100644 --- a/__tests__/index.html +++ b/__tests__/index.html @@ -5,14 +5,17 @@ G: Preview