Skip to content

Update dependencies, add WebP support, and fix export & viewport bugs#41

Merged
slimbuck merged 5 commits into
mainfrom
dev-dev
Jun 15, 2026
Merged

Update dependencies, add WebP support, and fix export & viewport bugs#41
slimbuck merged 5 commits into
mainfrom
dev-dev

Conversation

@slimbuck

Copy link
Copy Markdown
Member

Brings the project up to date after a long gap, adds WebP input/output, and fixes several latent bugs found along the way.

Dependencies

  • Updated all dependencies to their latest compatible versions, including major bumps: @playcanvas/pcui 5→6, typescript 5→6, concurrently 9→10, plus playcanvas 2.15→2.19, rollup, @typescript-eslint/*, and others.
  • Held back where required: @rollup/plugin-typescript stays at 12.1.4 (12.3.0 breaks the build with an outDir/Rollup dir error — already excluded in Renovate), eslint stays on 9.x (9.39.4) because @playcanvas/eslint-config's bundled eslint-plugin-import has no eslint 10 support yet, and rollup-plugin-sass stays at 1.15.3 (its only newer release is a pre-release RC).
  • tsconfig.json: removed the unused baseUrl and switched moduleResolution to bundler to clear TypeScript 6 deprecation warnings. The stricter resolution surfaced a few real null-safety issues, now fixed (texture-view.ts texSize, main.ts root element, *.scss ambient declaration).
  • npm audit is clean (0 vulnerabilities).

WebP support

  • Input: .webp files now load and inspect (added to the file-browser allowlist; the engine decodes WebP natively via the browser).
  • Output: new "Export to WebP" button producing lossless WebP, backed by libwebp compiled to WebAssembly (static/lib/webp, shared with @playcanvas/splat-transform).

Bug fixes

  • PNG export could hang forever on a worker failure: the encode promise had no reject path and the worker had no error handling. It now reports errors back, rejects properly, and the worker blob URL is revoked.
  • A failed or hung export left the Export panel permanently disabled with the button stuck on "BUSY...": the export flow is now wrapped in try/finally so UI state always restores.
  • Closing a texture left a grey square in the viewport and stale 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.

@slimbuck slimbuck requested a review from Copilot June 15, 2026 17:54
@slimbuck slimbuck self-assigned this Jun 15, 2026
@slimbuck slimbuck added the enhancement New feature or request label Jun 15, 2026

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.

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 unused baseUrl).
  • Added WebP support end-to-end: .webp allowlist, new WebP exporter backed by static/lib/webp WASM 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.

Comment thread package.json
@slimbuck slimbuck merged commit 09e2c29 into main Jun 15, 2026
2 checks passed
@slimbuck slimbuck deleted the dev-dev branch June 15, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants