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

Make Vite the default bundler #8301

Merged
merged 61 commits into from
May 30, 2023
Merged

Conversation

dac09
Copy link
Contributor

@dac09 dac09 commented May 12, 2023

This PR does the following:

  • makes Vite the default bundler
  • updates CRWA TS template to have Vite setup
  • updates CRWA JS template to have Vite setup
  • rebuilds the fixture Vite preconfigured
  • Vite specific files are now accessible via getPaths in rw/project-config
  • ⚠️ breaks SVG handling, so it now works in the default Vite way instead of using svg components (which is fragile and confusing to users, see [RFC]: Univerzal image component #8291)

Todo

  • Unable to use the vite dev server in Gitpod for reviewing PRs
    This probably is just a small config tweak, but not sure what it is.

  • Failing Windows smoke test with Playwright
    This is likely the same issue, accessing the port via Playwright.

dac09 added 9 commits May 10, 2023 11:39
* 'main' of github.com:redwoodjs/redwood:
  fix(deps): update dependency @heroicons/react to v2.0.18 (redwoodjs#8277)
  chore(release): publish in two steps for lock file
  chore(deps): update dependency glob to v10.2.3 (redwoodjs#8275)
  chore(deps): update dependency nx to v16.1.4 (redwoodjs#8276)
  Fix --rebuildFixture (redwoodjs#8273)
  chore(release): update command for crwa templates
  chore(crwa test, release process): handle yarn.lock
  chore(Nx): change @nrwl/nx-cloud to nx-cloud (redwoodjs#8272)
  fix(graphql-server): Display correct plugin name in error message (redwoodjs#8271)
  chore(cli): Consistent use of util functions within experimental commands (redwoodjs#8268)
  Draw only at start and end when dealing with non-tty (redwoodjs#8265)
  fix(deps): update prisma monorepo to v4.14.0 (redwoodjs#8269)
  fix(deps): update dependency webpack-cli to v5.1.1 (redwoodjs#8266)
…te-default

* 'main' of github.com:redwoodjs/redwood: (23 commits)
  fix: remove react 17/18 warning (redwoodjs#8300)
  chore(release): tolerate lerna publish faliure
  Recover lost connection (redwoodjs#8284)
  chore(deps): update dependency @faker-js/faker to v8 (redwoodjs#8296)
  chore(release): better git commits during release
  feat: experimental - Studio Overview and Performance Widgets (redwoodjs#8292)
  fix(forms): disable webpack-dev-server overlay (redwoodjs#8298)
  Fix studio lint warning (redwoodjs#8297)
  Fastify server: Default to localhost (redwoodjs#8019)
  Fix GraphQL proxy in dev environments without IPv6 (redwoodjs#8233)
  fix(deps): update dependency @graphiql/plugin-explorer to v0.1.18 (redwoodjs#8290)
  chore(deps): update dependency supertokens-auth-react to v0.32.3 (redwoodjs#8289)
  Add `setup sentry` command (redwoodjs#7790)
  chore: readme update core team and all contributors (redwoodjs#8288)
  fix(deps): update nivo monorepo to ^0.83.0 (redwoodjs#8286)
  fix(deps): update dependency babel-plugin-polyfill-corejs3 to v0.8.1 (redwoodjs#8281)
  chore(deps): update dependency @replayio/playwright to v0.3.30 (redwoodjs#8282)
  fix(deps): update dependency webpack to v5.82.1 (redwoodjs#8283)
  Add epilogue to builders (redwoodjs#8285)
  feat(studio): v2 studio (redwoodjs#8173)
  ...
Add transform and load for jsx
@dac09 dac09 added the release:breaking This PR is a breaking change label May 12, 2023
@replay-io
Copy link

replay-io bot commented May 12, 2023

@dac09 dac09 marked this pull request as ready for review May 17, 2023 10:26
@@ -23,9 +23,10 @@ tasks:
cd /workspace/redwood
yarn install
yarn run build:test-project ../rw-test-app --typescript --link --verbose
cd /workspace/rw-test-app && sed -i "s/\(open *= *\).*/\1false/" redwood.toml
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The open flag does not work in Gitpod

dac09 added 4 commits May 17, 2023 17:31
…te-default

* 'main' of github.com:redwoodjs/redwood: (30 commits)
  fix(deps): update dependency @vscode/ripgrep to v1.15.3 (redwoodjs#8341)
  fix(deps): update typescript-eslint monorepo to v5.59.6 (redwoodjs#8335)
  chore(deps): update dependency vite to v4.3.7 (redwoodjs#8340)
  fix(deps): update dependency qs to v6.11.2 (redwoodjs#8331)
  fix(deps): update dependency @tremor/react to v2.6.2 (redwoodjs#8337)
  chore(deps): update dependency vite to v4.3.6 (redwoodjs#8328)
  chore(deps): update dependency glob to v10.2.4 (redwoodjs#8326)
  fix: add back api server for yarn rw dev (redwoodjs#8336)
  chore(deps): update dependency @faker-js/faker to v8.0.1 (redwoodjs#8330)
  Disable plugin by default (redwoodjs#8334)
  fix(deps): update docusaurus monorepo to v2.4.1 (redwoodjs#8329)
  fix(deps): update dependency react-toastify to v9.1.3 (redwoodjs#8321)
  chore(deps): update dependency @supabase/supabase-js to v2.22.0 (redwoodjs#8323)
  fix(deps): update dependency @tremor/react to v2.6.1 (redwoodjs#8320)
  fix(deps): update dependency listr2 to v6.5.0 (redwoodjs#8317)
  fix(deps): update dependency semver to v7.5.1 (redwoodjs#8307)
  fix(deps): update dependency @tremor/react to v2.5.0 (redwoodjs#8306)
  chore(deps): update dependency @testing-library/dom to v9.3.0 (redwoodjs#8303)
  chore(deps): update dependency esbuild to v0.17.19 (redwoodjs#8312)
  chore(deps): update dependency dependency-cruiser to v12.12.2 (redwoodjs#8310)
  ...
…o feat/make-vite-default

* 'feat/make-vite-default' of github.com:dac09/redwood:
  Modify sed command
@@ -11,9 +12,25 @@ const startDevServer = async () => {
throw new Error('Could not locate your web/vite.config.{js,ts} file')
}

// Tries to maintain the same options as vite's dev cli
// See here: https://github.com/vitejs/vite/blob/main/packages/vite/src/node/cli.ts#L103
// e.g. yarn rw dev web --fwd="--force"
Copy link
Contributor Author

@dac09 dac09 May 17, 2023

Choose a reason for hiding this comment

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

Thoughts on whether --fwd still makes sense? It's mainly useful for passing force, tbh!

When we run yarn rw dev it runs both, so maybe the flag should be webFwd?

@dac09
Copy link
Contributor Author

dac09 commented May 29, 2023

Thank you for your help with this @jtoar - no way I would've solved it without your help 🤾

Comment on lines 8 to 14
// const test_project_path = path.join(
// os.tmpdir(),
// 'test-project',
// // ":" is problematic with paths
// new Date().toISOString().split(':').join('-')
// )

Copy link
Member

Choose a reason for hiding this comment

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

Remove commented code

@dac09 dac09 enabled auto-merge (squash) May 30, 2023 05:25
@dac09 dac09 merged commit 6585d4d into redwoodjs:main May 30, 2023
@redwoodjs-bot redwoodjs-bot bot added this to the next-release milestone May 30, 2023
@dac09 dac09 deleted the feat/make-vite-default branch May 31, 2023 03:02
@jtoar jtoar modified the milestones: next-release, v6.0.0 Jun 1, 2023
@jtoar jtoar mentioned this pull request Jun 10, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:breaking This PR is a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants