Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements several improvements to the Next2D framework, including background color support for captures, worker format changes, test coverage expansion, and refactoring of type systems and test mocks.
- Adds background color and alpha parameters to capture functionality across renderer and core packages
- Changes worker bundle format from IIFE to ES modules
- Replaces numeric IDs with UUID strings for VertexArrayObject management
- Adds extensive test coverage for numerous use cases and services
- Refactors test mocks to use proper function constructors instead of mockImplementation
Reviewed Changes
Copilot reviewed 147 out of 149 changed files in this pull request and generated 46 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Removed @vitest/web-worker from setup files |
| tsconfig.json | Removed baseUrl and paths configuration |
| test.setup.ts | Added MockWorker implementation and additional canvas context methods |
| src/tsconfig.json | Updated paths from relative to absolute |
| src/index.ts | Updated version number to 2.6.0 |
| rollup.*.worker.config.js | Changed worker output format from iife to es |
| packages/webgl/src/interface/IVertexArrayObject.ts | Changed id type from number to string |
| packages/webgl/* | Added numerous test files with comprehensive coverage |
| packages/webgl/src/VertexArrayObject.ts | Removed $getId function and counter |
| packages/webgl/src/VertexArrayObject/service/* | Replaced numeric ID with crypto.randomUUID() |
| packages/webgl/src/Shader/Fragment/* | Removed unused shader functions and optimized color transform logic |
| packages/webgl/src/PathCommand.ts | Inlined path validation logic |
| packages/webgl/src/Context.ts | Fixed UNPACK_ALIGNMENT parameter (changed to 1, not true) |
| packages/text/src/TextUtil.ts | Changed timer ID types from NodeJS.Timeout to number |
| packages/text/src/TextField/* | Added comprehensive test coverage |
| packages/renderer/src/* | Added background color and alpha support to capture |
| packages/media/src/* | Added tests and refactored mocks to use function constructors |
| packages/display/src/* | Added test coverage for various use cases |
| packages/core/src/interface/ICaptureOptions.ts | Added bgColor and bgAlpha optional properties |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/webgl/src/Context.ts
Outdated
|
|
||
| // WebTextureの設定 | ||
| gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1); | ||
| gl.pixelStorei(gl.UNPACK_ALIGNMENT, true); |
There was a problem hiding this comment.
The second parameter to gl.pixelStorei(gl.UNPACK_ALIGNMENT, ...) should be a number (1, 2, 4, or 8), not a boolean. The value true will be coerced to 1, but this should be explicit. Change true to 1.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| bg_color >> 16 & 0xff / 255, | ||
| bg_color >> 8 & 0xff / 255, | ||
| bg_color & 0xff / 255, |
There was a problem hiding this comment.
Operator precedence issue: the division by 255 is happening before the bitwise AND due to operator precedence. Each line should be: (bg_color >> N & 0xff) / 255 with parentheses around the bitwise operations.
packages/core/src/Next2D/usecase/CaptureToCanvasUseCase.test.ts
Outdated
Show resolved
Hide resolved
packages/core/src/Next2D/usecase/CaptureToCanvasUseCase.test.ts
Outdated
Show resolved
Hide resolved
packages/core/src/Next2D/usecase/CreateRootMovieClipUseCase.test.ts
Outdated
Show resolved
Hide resolved
| const textField = new TextField(); | ||
| textField.text = "Test"; | ||
|
|
||
| const result = execute(textField); |
There was a problem hiding this comment.
the function execute does not return anything, yet the return value is used.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| textField.focusIndex = 2; | ||
|
|
||
| const event = new KeyboardEvent("keydown", { key: "a" }); | ||
| const result = execute(textField, event); |
There was a problem hiding this comment.
the function execute does not return anything, yet the return value is used.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| const textField = new TextField(); | ||
| textField.text = "Test"; | ||
|
|
||
| const result = execute(textField); |
There was a problem hiding this comment.
the function execute does not return anything, yet the return value is used.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| textField.text = "Test"; | ||
| textField.selectIndex = 2; | ||
|
|
||
| const result = execute(textField); |
There was a problem hiding this comment.
the function execute does not return anything, yet the return value is used.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| textField.type = "input"; | ||
| textField.text = "Test"; | ||
|
|
||
| const result = execute(textField, 10, 10); |
There was a problem hiding this comment.
the function execute does not return anything, yet the return value is used.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…st.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: ienaga <4123454+ienaga@users.noreply.github.com>
Co-authored-by: ienaga <4123454+ienaga@users.noreply.github.com>
Co-authored-by: ienaga <4123454+ienaga@users.noreply.github.com>
Co-authored-by: ienaga <4123454+ienaga@users.noreply.github.com>
Co-authored-by: ienaga <4123454+ienaga@users.noreply.github.com>
Co-authored-by: ienaga <4123454+ienaga@users.noreply.github.com>
Fix gl.pixelStorei UNPACK_ALIGNMENT parameter type
Remove meaningless void function return value test
Fix test capturing return value from void function
Fix test checking return value of void function
Remove unnecessary void return value test in TextFieldReloadUseCase
Remove redundant void function return value test
No description provided.