Skip to content

feat: rework the samples for alphaTab 1.9 and its bundler plugins - #4

Open
Danielku15 wants to merge 5 commits into
mainfrom
feature/bundler-plugins
Open

Danielku15 wants to merge 5 commits into
mainfrom
feature/bundler-plugins

Conversation

@Danielku15

Copy link
Copy Markdown
Member

Note

AI-authored disclosure (alphatab-ai-authored-v1)

Portions of this content were authored by an AI agent. The agent has read
AGENTS.md and the human submitter accepts responsibility for
compliance with the rules in that document.

Issues

Companion to CoderLine/alphaTab#2998 (bundler integration rework for 1.9).

Proposed changes

Why: The samples should show verified setups for every supported major of the common bundlers and frameworks, using the proper plugin packages. Several old samples were outdated (Angular 17, Vite 6, Next.js workarounds) or relied on the @coderline/alphatab/webpack|vite re-exports.

  • 31 samples:
    • without a bundler: browser ESM/UMD, Node;
    • with the plugins: webpack 5, Rspack 1/2, Rsbuild 2, Vite 6/7/8;
    • with the /core + /worker + /worklet recipe: esbuild, Rollup, Parcel;
    • frameworks: React, Next.js 15/16 (webpack and Turbopack), Vue, Nuxt 3/4, Angular 20/21/22 (application builder) and 22 (webpack), Svelte, SvelteKit, Solid.
  • Every sample plays "Iron Waltz", exercising the rendering worker, the synthesizer worker and the audio worklet. Each README explains the setup and why.
  • New top-level readme: stack, integration method and core-copy count per sample, the rules every setup needs, and what isn't supported.
  • Removed (superseded): vite-react, vite-vue, webpack-plain, webpack-angular-17, webpack-nextjs-15, webpack-nextjs-16.

Checklist

  • Changes are implemented
  • Verified in headless Chromium against the alphaTab build from the linked PR, in production and dev. Every sample renders, plays with audio, loads its workers and worklet, and logs no errors.

AI authorship disclosure

  • No AI agent authored any part of this PR
  • An AI agent contributed to this PR. The AI-authored disclosure block
    (alphatab-ai-authored-v1) is present at the top of this body, and I have
    personally reviewed every change and can explain each one

Further details

  • Samples depend on ^1.9.0-alpha.1965. No lockfiles are committed yet: they should be generated once the next 1.9 alpha with the new plugins is published. Merge after that.

Samples for every supported framework major and bundler, named
<framework>-<major>-<bundler> and bundler-<name>-<major>, each with a README
describing the alphaTab-specific setup and its limits. The plugin-based samples
use @coderline/alphatab-webpack and @coderline/alphatab-vite; esbuild, Rollup
and Parcel use the core, worker and worklet entries. Superseded samples and
the per-sample lockfiles are removed.
…sample

alphaTab detects Turbopack, so the sample imports @coderline/alphatab, drops
its own worker entry and initialization, and points core.scriptFile to the
copied ES module for the Audio Worklet.
Next.js applies basePath to its routes and bundles, so the workers Turbopack bundles load from the sub-path, but not to the URLs the client builds for files in public/. The config exposes basePath as NEXT_PUBLIC_BASE_PATH and ScoreViewer prefixes the score, font directory, worklet script file and SoundFont with it.
The minified entry files now import alphaTab.core.min.mjs and start the
minified worker and worklet, so the samples copy and import-map
alphaTab.min.mjs, alphaTab.core.min.mjs, alphaTab.worker.min.mjs and
alphaTab.worklet.min.mjs. The READMEs describe the minified set and how
to switch to the unminified one for debugging.
@Danielku15 Danielku15 self-assigned this Oct 31, 2026
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.

1 participant