Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node fork modules & moduleResolution bundler #5774

Merged
merged 15 commits into from
Apr 1, 2024

Conversation

etrepum
Copy link
Collaborator

@etrepum etrepum commented Mar 28, 2024

Create a separate set of esm fork modules specifically for node that use top-level await. These should work with node >= 14.8 (for SSR) but not cause problems for bundlers that can't handle them.

The reason to do this would be to save a bit of startup time and memory when running Lexical directly in a Node.js environment (SSR, headless, etc.). Otherwise, since tree-shaking isn't done when executing directly, both dev and prod get loaded.

Closes #5716 (those commits are cherry-picked into here)
Fixes #5710 via #5716
Fixes #5117 via #5716
Fixes #4160 via #5716
Fixes #5783 (removes inter-package monorepo peerDependencies)

Copy link

vercel bot commented Mar 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 1, 2024 7:13pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 1, 2024 7:13pm

@facebook-github-bot facebook-github-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 Mar 28, 2024
@2wheeh

This comment was marked as resolved.

@etrepum

This comment was marked as outdated.

@etrepum

This comment was marked as resolved.

@etrepum etrepum force-pushed the node-fork-modules branch from 314077d to cc6c3fe Compare March 28, 2024 19:22
@etrepum etrepum changed the title Node fork modules Node fork modules & moduleResolution bundler Mar 28, 2024
@2wheeh
Copy link
Contributor

2wheeh commented Mar 29, 2024

I closed #5716 !

btw, commits from #5716 have never got successful with e2e-collab-windows (18.18.0, firefox).
I know some e2e-collab tests are flaky sometimes but it seems unusual... It always ends up being timed out.

maybe due to updating y-websocket ?

@etrepum
Copy link
Collaborator Author

etrepum commented Mar 29, 2024

@2wheeh I'll take a look at that test, but not sure how successful I will be at reproducing it since I'm on macOS

@2wheeh
Copy link
Contributor

2wheeh commented Mar 29, 2024

@etrepum Thanks. I was not able to reproduce for the same reason as well...
I was told @acywatson would double check this before merging anyways.

@etrepum
Copy link
Collaborator Author

etrepum commented Mar 29, 2024

I suspect these are just bad e2e tests that are failing because something about firefox is slower (maybe due to y-websocket!), I did manage to fire up an old gaming pc and install node to run these tests and they fail locally but the chromium ones succeed. This sort of test code looks particularly suspicious:

  test('Can autocomplete a word', async ({page, isPlainText}) => {
    await focusEditor(page);
    await page.keyboard.type('Sort by alpha');
    await sleep(500);
    await assertHTML(...);

Copy link
Collaborator

@ivailop7 ivailop7 left a comment

Choose a reason for hiding this comment

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

These are quite pervasive changes, need @acywatson @zurfyx @fantactuka as well, especially for the y-websocket ones. The plan is still to potentially merge before end of next week, since I'm planning on doing another release next friday.

@etrepum
Copy link
Collaborator Author

etrepum commented Mar 31, 2024

I think that #5788 should address the problems with the collab tests 🤞

@ivailop7 ivailop7 merged commit edae3d3 into facebook:main Apr 1, 2024
45 checks passed
@etrepum etrepum deleted the node-fork-modules branch May 11, 2024 06:46
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.
Projects
None yet
4 participants