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

chore(esm/cjs): Build rwjs/web to cjs with new build system #10826

Merged
merged 24 commits into from
Jun 22, 2024

Conversation

dac09
Copy link
Collaborator

@dac09 dac09 commented Jun 17, 2024

This PR swaps the babel build process for esbuild, as a first step of converting the web package to ESM/CJS.

In order to get this to work I had to manually import React in all of the source files with JSX, as it was being autoimported by a babel plugin. I think this is better than just adding another plugin to our build step (keep it vanilla!)

Tested with auth
✅ legacy
✅ ssr-streaming

Tested with kitchen sink
✅ RSC

Note:
I had to change the "remove from bundle" plugin. It took a lot of experimentation, but switching to esm syntax seems to fix it in all cases.

dac09 added 11 commits June 7, 2024 16:48
Rename files without JSX files to just ts
…ckage-cjsonly-new-build

* 'main' of github.com:redwoodjs/redwood: (66 commits)
  chore(testing dbAuth): Add "yes" prompt testing for WebAuthn (redwoodjs#10823)
  chore(testing dbAuth): Mock console.log to silence test output (redwoodjs#10821)
  chore(testing dbAuth): Remove duplicated tests (redwoodjs#10822)
  chore(testing dbAuth): Remove outdated code (redwoodjs#10820)
  chore(testing dbAuth): Consistent naming and fix blue squiggles (redwoodjs#10819)
  chore(testing dbAuth): provide mock implementations (redwoodjs#10818)
  feat(dbAuth): Only suggest dbAuth setup if needed (redwoodjs#10793)
  chore(dbAuth): Fix test for webauthn prompt in `g dbAuth` (redwoodjs#10814)
  fix(dbAuth): Print the correct "post message" after generation (redwoodjs#10813)
  fix(dbauth): Fix spacing issue in task titles (redwoodjs#10811)
  deps(docs): update braces package (redwoodjs#10809)
  chore(deps): bump braces from 3.0.2 to 3.0.3 in /tasks/check (redwoodjs#10808)
  chore(deps): update yarn to v4.3.0 (redwoodjs#10801)
  chore(deps): update dependency tsx to v4.15.2 (redwoodjs#10800)
  chore(deps): update dependency @clerk/types to v3.65.2 (redwoodjs#10795)
  chore(deps): update dependency firebase to v10.12.2 (redwoodjs#10802)
  chore(deps): update dependency rollup to v4.18.0 (redwoodjs#10799)
  chore(deps): update dependency jsdom to v24.1.0 (redwoodjs#10798)
  chore(deps): update dependency @types/vscode to v1.90.0 (redwoodjs#10796)
  chore(deps): update dependency @clerk/clerk-react to v4.32.2 (redwoodjs#10794)
  ...
@dac09 dac09 added the release:chore This PR is a chore (means nothing for users) label Jun 17, 2024
@dac09 dac09 added this to the RSC milestone Jun 17, 2024
@dac09 dac09 added the changesets-ok Override the changesets check label Jun 17, 2024
Copy link
Collaborator

@Josh-Walker-GM Josh-Walker-GM left a comment

Choose a reason for hiding this comment

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

Nice, looks good to me. There appear to be 4 files deleted from the dist but there are all test files which should never have been there to start with. CI being green is confidence enough for me with the dist having the same files. Looking forward to moving more of our code over and then to esm.

@dac09 dac09 enabled auto-merge (squash) June 19, 2024 06:07
@dac09 dac09 merged commit 3c53ba2 into redwoodjs:main Jun 22, 2024
51 checks passed
dac09 added a commit to dac09/redwood that referenced this pull request Jun 24, 2024
…-esm

* 'main' of github.com:redwoodjs/redwood:
  fix(deps): update dependency prettier to v3.3.2 (redwoodjs#10852)
  fix(deps): update dependency vite to v5.3.1 (redwoodjs#10854)
  chore(esm/cjs): Build rwjs/web to cjs with new build system (redwoodjs#10826)
  feat(dbAuth): Automatically create User model in fresh projects (redwoodjs#10871)
  feat(dbAuth): Prompt to generate dbAuth pages (redwoodjs#10865)
@dac09 dac09 deleted the chore/web-package-cjsonly-new-build branch June 24, 2024 10:52
@Josh-Walker-GM Josh-Walker-GM modified the milestones: RSC, v8.0.0 Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changesets-ok Override the changesets check release:chore This PR is a chore (means nothing for users)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants