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

Remove deprecated cache-loader #6634

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

nVitius
Copy link

@nVitius nVitius commented Aug 13, 2021

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Underlying tools
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Other information:
The cache-loader library is deprecated. It still runs on webpack 5, but it has a peerDependency on webpack 4 which breaks the installation of vue-cli with npm@7 (npm installs peerDependencies by default now).

This PR removes the dependency on cache-loader and adds webpack's new filesystem cache instead.

@nVitius
Copy link
Author

nVitius commented Aug 13, 2021

I started testing this locally today and haven't run into any issues.

@nVitius nVitius force-pushed the fix/cache-loader-dependency branch from e0d3d7e to 9f6ebb1 Compare August 17, 2021 22:00
@nVitius
Copy link
Author

nVitius commented Aug 17, 2021

Not sure why the core and plugins tests are failing. It looks like some regex isn't matching on the built files. I don't think anything I changed would have affected that though.

The cli-ui and e2e tests are failing because vue-cli-plugin-apollo uses cache-loader. I'll open an issue over there, but it doesn't look like the repo is being actively maintained.

@nVitius
Copy link
Author

nVitius commented Aug 19, 2021

@sodatea
Pinging you as you're the OP of the CLI v5 issue.

Can I get your feedback on this PR?

@@ -18,6 +18,9 @@ module.exports = (api, options) => {
.rule('esm')
.test(/\.m?jsx?$/)
.resolve.set('fullySpecified', false)

webpackConfig
.cache({ type: 'filesystem' })
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the feedback! I appreciate it.

It's not explicitly stated in the documentation, but the spec for caching in webpack 5 states:

Each build with a different webpack configuration should store a unique copy of its cache versus another webpack configuration. E.g. A development build and a production build must have distinct caches due to them having different options set.

The spec for it is here: webpack/webpack#6527

I'm not sure how the --mode option works in vue-cli, but it does look like those specific tests did not fail for this PR. You can see the reports for those here: https://app.circleci.com/pipelines/github/vuejs/vue-cli/1124/workflows/10aeafe8-27a2-486a-9609-2111481209be/jobs/27240

The only two tests that failed do not seem to be related to the changes I made.

Copy link
Member

Choose a reason for hiding this comment

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

The link points to another PR that I'm working on.
The tests are not written yet, therefore it's not in the pipeline.

Copy link
Member

Choose a reason for hiding this comment

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

The only two tests that failed do not seem to be related to the changes I made.

I'm afraid they're related. Looks like the build process for modern mode reused the cache from the legacy mode.

@719media
Copy link

Is this issue going to be solved prior to v5 final release? Given that it's currently in RC status (v5.0.0-rc.1), I hope it is something that gets resolved prior to release.

@Icacls
Copy link

Icacls commented Dec 13, 2021

any update on this issiue?

@yoyo837
Copy link

yoyo837 commented Sep 7, 2022

Any update on this issue? Again.

@bodograumann
Copy link
Contributor

vue-cli is now in maintenance mode, so don't hold your breath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants