Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes the toolchain/dependencies, adds WebP import/export support, and addresses a few UI/viewport/export reliability issues uncovered by stricter TypeScript resolution and export worker failure modes.
Changes:
- Updated major dev dependencies (PCUI v6, TypeScript v6, Rollup, PlayCanvas, ESLint ecosystem) and adjusted TS config (
moduleResolution: bundler, removed unusedbaseUrl). - Added WebP support end-to-end:
.webpallowlist, new WebP exporter backed bystatic/lib/webpWASM module, and an “Export to WebP” UI button. - Improved robustness/UX around export and empty-document rendering: error paths for PNG worker + try/finally UI re-enable; viewport/info panel resets when no texture is selected.
Reviewed changes
Copilot reviewed 10 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Switches TS module resolution to bundler and removes unused baseUrl. |
| static/lib/webp/webp.mjs | Adds the libwebp WASM JS loader module. |
| src/webp-exporter.ts | Implements lossless WebP encoding via the WASM module. |
| src/texture-view.ts | Prevents rendering artifacts by hiding the mesh instance when no texture is loaded; improves null-safety for texSize. |
| src/png-exporter.ts | Adds proper worker error reporting/rejection and revokes the worker Blob URL. |
| src/main.ts | Adds a non-null assertion for the #root element under stricter TS checks. |
| src/info-panel.ts | Resets the info bar to an empty state when no texture is selected. |
| src/files-browser-panel.ts | Allows .webp files in the image filename allowlist. |
| src/export-panel.ts | Adds “Export to WebP” and hardens export UI state with try/finally + error logging. |
| src/declaration.d.ts | Declares *.scss modules for bundler-handled style imports. |
| README.md | Documents WebP support in export features and supported formats list. |
| package.json | Updates dev dependency versions (including major bumps). |
| package-lock.json | Locks updated dependency tree for the bumped packages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Brings the project up to date after a long gap, adds WebP input/output, and fixes several latent bugs found along the way.
Dependencies
@playcanvas/pcui5→6,typescript5→6,concurrently9→10, plusplaycanvas2.15→2.19,rollup,@typescript-eslint/*, and others.@rollup/plugin-typescriptstays at 12.1.4 (12.3.0 breaks the build with anoutDir/Rollupdirerror — already excluded in Renovate),eslintstays on 9.x (9.39.4) because@playcanvas/eslint-config's bundledeslint-plugin-importhas no eslint 10 support yet, androllup-plugin-sassstays at 1.15.3 (its only newer release is a pre-release RC).tsconfig.json: removed the unusedbaseUrland switchedmoduleResolutiontobundlerto clear TypeScript 6 deprecation warnings. The stricter resolution surfaced a few real null-safety issues, now fixed (texture-view.tstexSize,main.tsroot element,*.scssambient declaration).npm auditis clean (0 vulnerabilities).WebP support
.webpfiles now load and inspect (added to the file-browser allowlist; the engine decodes WebP natively via the browser).static/lib/webp, shared with@playcanvas/splat-transform).Bug fixes
nullxnull/???text in the status bar: the empty document is no longer rendered and the info bar resets to its empty state.Testing
Verified with
npm run build,npm run lint, and in-browser: WebP load (lossy + lossless fixtures) and a lossless export round-trip, PNG export still works, and the close-texture flow returns to a clean blank state.