feat: upgrade to Excalidraw 0.18.0 with legacy file compatibility #489
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Closes #423
This PR upgrades the embedded Excalidraw library from 0.17.x to 0.18.0, bringing the latest features and improvements while maintaining full backward compatibility with existing
.excalidrawfiles.Motivation
Excalidraw 0.18.0 includes significant improvements including new fonts, better rendering, and various bug fixes. However, the upgrade introduced breaking changes in the element data format that caused issues with files created in older versions.
Changes
Build System Migration (addresses CRA incompatibility from #423)
moduleResolution: "bundler")index.htmlto project root (Vite convention)config-overrides.jswithvite.config.ts"type": "module"in package.json for ESM supportExcalidraw 0.18.0 Compatibility
@excalidraw/excalidrawto 0.18.0@excalidraw/excalidraw/index.css)window.EXCALIDRAW_ASSET_PATH = "/"for proper font loading (self-hosted fonts)Legacy File Support
Implemented preprocessing for files created with older Excalidraw versions to fix:
lineHeightautoResizetrueboundElements: null[]frameIdnullfocus/gap)mode/fixedPoint)Loading Strategy
loadFromBlobAPI instead of directupdateScenecallsOther Changes
.woff2font files inSchemeHandlerFactoryChecklist from #423
"type": "module")moduleResolutionupdated to"bundler"excalidraw-assetsfolder handling (now usingfonts/path)EXCALIDRAW_ASSET_PATHupdateSceneAPI changes handledTesting
.excalidraw,.excalidraw.svg,.excalidraw.pngBreaking Changes
None for end users. Existing files continue to work without modification.