Next.js setup
The grid renders on the client and uses a Web Worker. Since the worker is compiled into the package, there is now exactly one step.
Render client-side
The grid touches browser APIs, so load it without SSR:
'use client';
import dynamic from 'next/dynamic';
const Grid = dynamic(() => import('./MyGrid'), { ssr: false });
That is the whole setup:
<BasePivotGrid gridId="demo" data={data} initialFields={fields} />
What happened to the copy-worker step?
It is gone. Next's bundler cannot statically resolve a worker URL inside
node_modules, so this page used to ask you to copy pivot.worker.js into
public/ and pass workerUrl. The worker is now embedded in the package and
started from a Blob URL, which no bundler has to resolve — so the script, the
predev/prebuild hook and the prop all disappear.
Existing workerUrl code keeps working and still wins when it is set: it is the
right answer for a Content-Security-Policy without worker-src blob:, or when
you would rather serve the worker from a CDN. See
Installation.
See it working in the playground.