Skip to content

[*][lexical-devtools][lexical-playground] Chore: Update flow, hermes, and babel packages to latest#8795

Merged
etrepum merged 4 commits into
facebook:mainfrom
etrepum:claude/flow-hermes-updates-6vohgr
Jul 8, 2026
Merged

[*][lexical-devtools][lexical-playground] Chore: Update flow, hermes, and babel packages to latest#8795
etrepum merged 4 commits into
facebook:mainfrom
etrepum:claude/flow-hermes-updates-6vohgr

Conversation

@etrepum

@etrepum etrepum commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Description

Updates all Flow, Hermes, and Babel tooling to their latest versions and migrates the codebase for the Babel 8 API changes.

Dependencies

  • flow-bin ^0.316.0^0.321.0 (and .flowconfig [version]); removed experimental.allow_variance_keywords, which is default-on and now rejected as of Flow 0.317.
  • @babel/*^8.x (root, lexical-devtools, lexical-playground).
  • eslint ecosystem → latest (eslint ^10.6.0, eslint-plugin-import-x ^4.17.1, typescript-eslint ^8.62.1).
  • flow-typed and the hermes-* packages were already current.

Babel 8 migration (scripts/build.mjs)

  • Removed the dropped allowDeclareFields and the never-supported tsconfig options from @babel/preset-typescript.
  • Babel 8 only elides imports that are explicitly type-only, so type-only imports are now marked import type / inline type (enforced repo-wide with @typescript-eslint/consistent-type-imports) instead of relying on an onlyRemoveTypeImports override. This is the bulk of the diff.
  • Pinned @babel/preset-react development: false so dev builds no longer import react/jsx-dev-runtime, which was crashing the Docusaurus website build with "jsxDEV is not a function".
  • Restored a side-effect import 'prismjs' the import rewrite had merged away (it initialises the global Prism).

Config / CI

  • .flowconfig: added deprecated-type=error (codebase already clean) to keep future contributions on modern Flow syntax.
  • Updated the transform-error-messages script and its unit test for Babel 8's injected-helper output.
  • internal-registry workflow: the dependency-check job now runs only on facebook/lexical, so forks skip it instead of failing with a registry 401.

Test plan

Before

Flow 0.321 refuses to start on the old .flowconfig, and the Babel 8 build fails — allowDeclareFields/tsconfig are rejected, unmarked type-only imports break bundling, and the website SSG throws TypeError: jsxDEV is not a function.

After

The core-tests / integrity sequence passes locally and in CI:

  • pnpm run ci-check (tsc, tsc-scripts, tsc-extension, tsc-website, flow, prettier, lint)
  • pnpm run build, pnpm run build-www, pnpm --filter @lexical/website build, pnpm --filter lexical-playground build-vercel
  • pnpm run test-unit (4388 passed, 1 skipped)

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview Jul 8, 2026 12:48am
lexical-playground Ready Ready Preview Jul 8, 2026 12:48am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 6, 2026
@etrepum etrepum force-pushed the claude/flow-hermes-updates-6vohgr branch from 26e523b to 6a07d65 Compare July 7, 2026 01:52
@etrepum etrepum changed the title [monorepo][lexical-devtools][lexical-playground] Chore: Update flow, hermes, and babel packages to latest [*][lexical-devtools][lexical-playground] Chore: Update flow, hermes, and babel packages to latest Jul 7, 2026
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label Jul 7, 2026
claude added 3 commits July 7, 2026 14:06
…hermes, and babel deps and tooling for Babel 8

First of three commits (config/tooling; the next applies the type-import codemod, the third enables strict type-only elision). Each commit builds and passes CI on its own.

- Bump `flow-bin` `^0.316.0` -> `^0.321.0` and update `.flowconfig`: bump `[version]`, drop the removed `experimental.allow_variance_keywords`, and add `deprecated-type=error` to keep contributions on modern Flow syntax.
- Bump the `@babel/*` suite to `^8.x` (root, `lexical-devtools`, `lexical-playground`) and the eslint ecosystem to latest (`eslint` `^10.6.0`, `eslint-plugin-import-x` `^4.17.1`, `typescript-eslint` `^8.62.1`).
- `scripts/build.mjs` Babel 8 migration: drop the removed `allowDeclareFields` and never-supported `tsconfig` options from `@babel/preset-typescript`, and pin `@babel/preset-react` `development: false` so dev builds don't import `react/jsx-dev-runtime` (which crashed the website SSG with "jsxDEV is not a function"). Keep `onlyRemoveTypeImports: false` for now so the build works before the source is marked; the third commit removes it.
- `scripts/error-codes/transform-error-messages.mjs` + test: reference the injected AST node type via `import('@babel/core').types.CallExpression` and normalise Babel 8's injected helper imports in the test expectations.
- `.github/workflows/internal-registry.yml`: gate the dependency-check job on `github.repository == 'facebook/lexical'` so forks skip it instead of failing with a registry 401.
- Add `scripts/codemod/type-imports.mjs` (`pnpm run codemod-type-imports`): the reproducible, idempotent transform that marks type-only imports and inlines mixed type+value imports. It never touches bare side-effect imports, so it is safe to drop and re-run the next commit on a fresh rebase.
- Add the side-effect-import note to `lexical-code-prism/FacadePrism.ts`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sVuVyxU9nDpn2uBP5eeot
…e-imports codemod

Second of three commits. Mechanical output of `pnpm run codemod-type-imports`
(added in the previous commit): mark type-only imports so Babel 8 elides them —
pure type-only imports become `import type {X}`, and modules imported for both
values and types inline the type specifiers as `import {v, type T}`.

This commit is pure codemod output. If it conflicts on a future rebase, drop it,
rebase the config commit, and re-run `pnpm run codemod-type-imports` to
regenerate it (the transform is idempotent).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sVuVyxU9nDpn2uBP5eeot
…cit type-only imports for Babel 8 elision

Third of three commits. Now that every type-only import is marked (previous
commit), drop the `onlyRemoveTypeImports: false` override from `scripts/build.mjs`
so `@babel/preset-typescript` only elides explicitly type-only imports, and turn
on `@typescript-eslint/consistent-type-imports` (separate-type-imports) so the
convention is enforced going forward.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sVuVyxU9nDpn2uBP5eeot
@etrepum etrepum added this pull request to the merge queue Jul 8, 2026
Merged via the queue into facebook:main with commit a7666ab Jul 8, 2026
42 checks passed
@etrepum etrepum mentioned this pull request Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants