)]}'
{
  "commit": "7c1a687d03341b94b4a3c71706c47e3e14927707",
  "tree": "18361873a51cd6217f10650f122b88fabd44ac07",
  "parents": [
    "d4eea221b455e06fe7f897d1e04a8833015e893c"
  ],
  "author": {
    "name": "philip.zeyliger",
    "email": "philip.zeyliger@gmail.com",
    "time": "Mon Jun 16 03:54:37 2025 +0000"
  },
  "committer": {
    "name": "Autoformatter",
    "email": "bot@sketch.dev",
    "time": "Tue Jun 17 04:27:18 2025 +0000"
  },
  "message": "webui: implement Mermaid code splitting with lazy loading\n\nSplit Mermaid library into separate bundle with content-based hashing for\noptimal caching and reduced bundle size in main application components.\n\nImplementation Changes:\n\n1. Lazy Loading Infrastructure (sketch-timeline-message.ts):\n   - Replace direct mermaid import with type-only import\n   - Add loadMermaid() function with Promise-based dynamic loading\n   - Implement __MERMAID_HASH__ constant injection pattern\n   - Add global window.mermaid type declarations\n   - Create mermaid loading promise with singleton pattern\n\n2. Bundle Splitting (esbuild.go):\n   - Add createStandaloneMermaidBundle() function\n   - Generate content-based hash from mermaid package.json\n   - Create mermaid-standalone-{hash}.js as IIFE format bundle\n   - Implement esbuildBundleWithExternals() replacing esbuildBundleWithExternal()\n   - Add --external:mermaid to all TypeScript bundle builds\n   - Inject __MERMAID_HASH__ constant at build time\n\n3. Async Rendering (sketch-timeline-message.ts):\n   - Update renderMermaidDiagrams() to async/await pattern\n   - Load mermaid library only when diagrams are present\n   - Initialize mermaid configuration after dynamic loading\n   - Maintain fallback to code blocks on loading errors\n   - Preserve all existing mermaid functionality and configuration\n\nTechnical Details:\n- Uses content-based hashing for optimal browser caching\n- Mermaid loaded on-demand only when diagrams are present\n- Singleton loading pattern prevents duplicate network requests\n- Maintains existing mermaid initialization options\n- Preserves error handling with code block fallbacks\n- IIFE format enables direct window.mermaid assignment\n\nBenefits:\n- Reduces bundle size for components not using mermaid diagrams\n- Enables browser caching of mermaid library across sessions\n- Maintains existing functionality with lazy loading\n- Improves initial page load performance\n- Provides same user experience with deferred mermaid loading\n\nThis follows the same pattern established for Monaco editor bundling,\nproviding consistent lazy loading architecture for large dependencies.\n\nCo-Authored-By: sketch \u003chello@sketch.dev\u003e\nChange-ID: s0f8a82fcd28add05k\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f8f010d39b1b3427e579acd9b98cff57d23ef3e3",
      "old_mode": 33188,
      "old_path": "webui/esbuild.go",
      "new_id": "1c356ce591a97639ebf9254be5410b559b425e57",
      "new_mode": 33188,
      "new_path": "webui/esbuild.go"
    },
    {
      "type": "modify",
      "old_id": "9ea1cedf05e779dce564330e0adf29f6b87f6dc4",
      "old_mode": 33188,
      "old_path": "webui/src/web-components/sketch-timeline-message.ts",
      "new_id": "9fa5b7ae41232fd4d97d3600bc0ff62616ff0421",
      "new_mode": 33188,
      "new_path": "webui/src/web-components/sketch-timeline-message.ts"
    }
  ]
}
