Skip to content

Conversation

@srubin
Copy link

@srubin srubin commented Sep 22, 2025

  • Use pnpm instead of yarn
  • Use rollup/vite instead of gulp/webpack
  • Upgrade typescript
  • Replace examples directory with an examples target that can be developed alongside the main draft.js code
  • Add support for React 18/19 (afaik, this only requires switching out the old flush function for the new one)
  • DOM tests needed to be updated to work with the latest react/react-dom.

Nearly all of this was done by Claude Code, save for the actual change that we needed to make for proper React 18/19 support (the use of flushSync). I've wanted to update the repo to a more modern toolchain for a while, but was avoiding it while we were still occasionally pulling upstream fixes. But now that the official repo is archived, we can go wild 🥳

The two risks here are (1) the tests are no longer testing the right thing, and (2) there's an issue with the new build process that's breaking something. We'll check these empirically by checking the new package against our large suite of text editor UI tests we have in our private repo, and with manual smoke testing.

  • Confirmed that the package works as expected locally in our private repo when installing it via file:

@srubin srubin self-assigned this Sep 22, 2025
if (flushControlled) {
flushControlled(() => method(this, e));
const flush =
'flushSync' in ReactDOM ? ReactDOM.flushSync : undefined;
Copy link
Author

@srubin srubin Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous unstable method that was being used here was actually already removed before the version of React that we're using, so I'm not going to bother with the fallback for react < 18. facebook/react#26397

@srubin srubin marked this pull request as ready for review September 22, 2025 21:38
@srubin srubin merged commit c56ac03 into main-pojo Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants