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

breaking: remove webpack #10867

Merged
merged 73 commits into from
Jul 19, 2024
Merged

breaking: remove webpack #10867

merged 73 commits into from
Jul 19, 2024

Conversation

Josh-Walker-GM
Copy link
Collaborator

@Josh-Walker-GM Josh-Walker-GM commented Jun 21, 2024

This PR is a first attempt at removing webpack from the framework. I started with just removing the bundler config option and kept pulling the threads until it got to this stage. This will have touched a lot of files and could in theory be broken down into smaller PRs if we find the need to.

This will be a breaking change. The follow are the breaking changes I have identified:

  1. prebuildWebFile is function no longer exported from @redwoodjs/babel-config package
  2. @redwoodjs/cli-storybook has been removed
  3. yarn rw build no longer accepts the --stats flag
  4. yarn rw dev no longer accepts the --watchNodeModules flag
  5. yarn rw setup custom-web-index command has been removed
  6. yarn rw setup webpack has been removed
  7. @redwoodjs/core no longer provides @redwoodjs/core/config/* files
  8. The web.bundler TOML config option has been removed
  9. @redwoodjs/testing no longer provides storybook config files
  10. @redwoodjs/testing no longer provides a StorybookProvider
  11. The webpack bin has been removed from @redwoodjs/web

WIP

  • Fix rw test web command
  • Fix storybook smoke test (move over to storybook-vite)
  • Update docs
  • Create changeset entry
  • Go through the TODO(jgmw) and address them:
    • packages/babel-config/src/api.ts
    • packages/babel-config/src/plugins/babel-plugin-redwood-routes-auto-loader.ts
    • packages/cli/src/commands/dev.js
    • packages/prerender/src/babelPlugins/babel-plugin-redwood-prerender-media-imports.ts
    • packages/project-config/src/paths.ts
    • packages/testing/src/web/fileMock.ts
    • packages/vite/src/build/__tests__/nestedPages.test.ts
    • packages/vite/src/lib/envVarDefinitions.ts
    • packages/vite/src/lib/registerFwGlobalsAndShims.ts
    • packages/web/src/assetImports.ts
    • packages/web/src/config.ts
  • Edit required checks on the repo settings

Follow up items

  1. Update storybook documentation

docs/docs/builds.md Outdated Show resolved Hide resolved
@Josh-Walker-GM Josh-Walker-GM marked this pull request as ready for review June 26, 2024 00:01
@Josh-Walker-GM Josh-Walker-GM requested a review from dac09 June 26, 2024 00:02
@Josh-Walker-GM
Copy link
Collaborator Author

I'll update the required CI checks once we've approved this.

@dac09
Copy link
Contributor

dac09 commented Jul 12, 2024

@Josh-Walker-GM shall we find a time to go through the routes autoloader? It seems fine but I wanted to discuss/understand why the style of import statements changed!

@Tobbe
Copy link
Member

Tobbe commented Jul 12, 2024

@Josh-Walker-GM @dac09 I'd like to be part of that discussion too. I want to make sure I'm up-to-date on how the router works.

@Josh-Walker-GM Josh-Walker-GM merged commit 111c6ef into main Jul 19, 2024
46 checks passed
@Josh-Walker-GM Josh-Walker-GM deleted the jgmw/remove-webpack branch July 19, 2024 16:24
Josh-Walker-GM added a commit that referenced this pull request Sep 6, 2024
…ojects (#11458)

Fixes #11457 

In #10867 I removed the presets by default and they are only included in
specific cases - for jest, for prerender. It looks like I forgot to
consider the case of linting javascript projects. I therefore re-enable
these presets in that specific case.

It's already on my medium term wish list to simplify and rip out as much
of our babel config/reliance as we can. It would be better if this was
all just simpler and didn't have as many branches.

I also introduced a copy of `isTypeScriptProject` into
`@redwoodjs/project-config`. It doesn't add any dependencies to that
package and it relies on the functionality already provided in it. I
will make a note to refactor our existing usage to use this one. I think
that would be better.
Josh-Walker-GM added a commit that referenced this pull request Sep 6, 2024
…ojects (#11458)

Fixes #11457 

In #10867 I removed the presets by default and they are only included in
specific cases - for jest, for prerender. It looks like I forgot to
consider the case of linting javascript projects. I therefore re-enable
these presets in that specific case.

It's already on my medium term wish list to simplify and rip out as much
of our babel config/reliance as we can. It would be better if this was
all just simpler and didn't have as many branches.

I also introduced a copy of `isTypeScriptProject` into
`@redwoodjs/project-config`. It doesn't add any dependencies to that
package and it relies on the functionality already provided in it. I
will make a note to refactor our existing usage to use this one. I think
that would be better.
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
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants