@hanzo/cal-atoms
v2.11.0
Published
Cal.com scheduling components (Booker, CalProvider, availability), Hanzo-owned fork. Correct sideEffects so the dayjs plugin extends survive tree-shaking in any bundler.
Downloads
76
Readme
@hanzo/cal-atoms
Hanzo-owned fork of Cal.com's scheduling components — the Booker, CalProvider,
availability, and related UI. Used under Cal.com's MIT grant (see NOTICE).
This is a vendored prebuilt distribution: the JavaScript, types, and styles
are shipped as-is. There is no build step. Consumers get the components plus
globals.min.css.
import { Booker, CalProvider } from "@hanzo/cal-atoms";
import "@hanzo/cal-atoms/globals.min.css";In this repo the SPA never imports this package directly — it imports
@hanzo/cal, the thin Hanzo booking surface. This package is the
foundation @hanzo/cal builds on.
Why a fork (two upstream defects fixed here)
dayjs extends were tree-shaken. Upstream ships
"sideEffects": false, so a bundler is free to drop the vendoreddayjs.extend(utc); dayjs.extend(timezone); …side-effect. Once dropped,dayjs.tzisundefinedand the Booker crashes at bootstrap ondayjs.tz.guess(). Fixed by declaring the dayjs vendor modules side-effectful:"sideEffects": ["**/vendor/dayjs/**", "**/vendor/timezone-constants.js"]The atoms need zustand 4, not 5. These atoms were built and tested against zustand 4 (upstream's own
devDependencypins4.5.2), but the peer range^4.0.0 || ^5.0.0lets a package manager install zustand 5. Under zustand 5 the Booker breaks two ways: itsuseSyncExternalStoresemantics changed, so the stores infinite-loop (Maximum update depth exceeded/ "getSnapshot should be cached"); and zustand 5 demoteduse-sync-external-storeto an optional peer, so thezustand/traditionalselector shim goes missing anduseSyncExternalStoreWithSelectorresolves toundefined(... is not a function). zustand 4 carries that shim as a regular dependency and matches the atoms' selector code, so the fork narrows the peer to^4.0.0. Pin zustand4.5.2to match exactly what upstream tested.
These fixes live in the package metadata, not in a downstream patch — any consumer's bundler gets correct behavior with no extra configuration.
Maintenance runbook (tracking upstream)
The vendored bytes track @calcom/atoms@<version>. To advance to a new upstream:
# 1. Fetch the pristine upstream package.
npm pack @calcom/atoms@<new-version>
tar -xzf calcom-atoms-<new-version>.tgz # -> package/
# 2. Replace the vendored files (everything except our own manifest/NOTICE/README).
rsync -a --delete \
--exclude package.json --exclude README.md --exclude NOTICE \
package/ packages/cal-atoms/
# 3. Bump "version" in packages/cal-atoms/package.json to the new upstream
# version, keeping the two fixes above (sideEffects + use-sync-external-store).
# Re-diff the upstream package.json for any new dependencies/exports to mirror.
# 4. Rebuild and verify the artifact gates (see repo LLM.md). The prod bundle is
# minified, so grep the assignment form, not a `function <name>` declaration:
pnpm build
# grep -c '\.extend(' <bundle> # ~14 (dayjs plugins preserved, not 3)
# grep -c 'useSyncExternalStoreWithSelector=function' <bundle> # >0 (selector shim present)
# 5. Publish (patch/minor/major per the upstream change).
cd packages/cal-atoms && npm publishNever re-introduce a pnpm patch on the upstream package: the whole point of this
fork is that the fix is owned here, in one place.
