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

ref: Remove references to Webpack 4 #43

Merged
merged 10 commits into from
Jan 4, 2024

Conversation

nicholas-codecov
Copy link
Collaborator

@nicholas-codecov nicholas-codecov commented Jan 3, 2024

Description

This PR removes references to Webpack 4 in the codebase, and moves to using Webpack as a peer dep rather then a direct dependency.

Closes codecov/engineering-team#953

Notable Changes

  • Remove Webpack dep dependency, move to just using as a peer dep
  • Rename import to just webpack

Copy link

codecov bot commented Jan 3, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (48b6e90) 83.52% compared to head (050a42a) 83.52%.

Files Patch % Lines
...ack-bundle-analysis/webpackBundleAnalysisPlugin.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
Components Coverage Δ
Plugin core 96.33% <ø> (ø)
Rollup plugin 7.35% <ø> (ø)
Vite plugin 7.35% <ø> (ø)
Webpack plugin 33.33% <50.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@codecov codecov bot left a comment

Choose a reason for hiding this comment

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

The presented Git diff includes changes in several files, mainly intended to remove dependencies and references to webpack 4 and utilize webpack as a peer dependency instead. Here I have reviewed the changes, and all look fine, but there are some observations and potential improvements.

.changeset/flat-coats-jump.md Outdated Show resolved Hide resolved
packages/webpack-plugin/package.json Show resolved Hide resolved
import { findFilenameFormat } from "./findFileFormat";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore webpack is a peer dep
Copy link

@codecov codecov bot Jan 3, 2024

Choose a reason for hiding this comment

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

Ignoring the type check for webpack import might lead to issues. Ensure types are consistent and correctly recognized for the webpack import.

Copy link
Collaborator

Choose a reason for hiding this comment

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

m: You can add webpack as a dev dep to get around this

pnpm-lock.yaml Outdated Show resolved Hide resolved
Copy link

@codecov codecov bot left a comment

Choose a reason for hiding this comment

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

CodecovAI submitted a new review for c27f128

import { findFilenameFormat } from "./findFileFormat";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore webpack is a peer dep
Copy link
Collaborator

Choose a reason for hiding this comment

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

m: You can add webpack as a dev dep to get around this

Copy link

@codecov codecov bot left a comment

Choose a reason for hiding this comment

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

CodecovAI submitted a new review for 017cc14

packages/webpack-plugin/package.json Show resolved Hide resolved
pnpm-lock.yaml Outdated Show resolved Hide resolved
Copy link

@codecov codecov bot left a comment

Choose a reason for hiding this comment

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

CodecovAI submitted a new review for 7b535ea

@AbhiPrasad
Copy link
Collaborator

Why are we aliasing the webpack dep? Keeping it as webpack for both peer deps and dev deps should be fine.

We can peer dep to 5.x and then pin to specific webpack version for dev dep.

@nicholas-codecov
Copy link
Collaborator Author

Why are we aliasing the webpack dep? Keeping it as webpack for both peer deps and dev deps should be fine.

We can peer dep to 5.x and then pin to specific webpack version for dev dep.

I may just be wanting to be ahead of the curve for adding in V4 support down the road. Adding it as a peer dep broke the build quite badly, it's reading swc types for some reason and causing syntax errors to pop up.

Copy link

@codecov codecov bot left a comment

Choose a reason for hiding this comment

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

CodecovAI submitted a new review for ece39ac

packages/webpack-plugin/package.json Show resolved Hide resolved
pnpm-lock.yaml Show resolved Hide resolved
Copy link

@codecov codecov bot left a comment

Choose a reason for hiding this comment

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

CodecovAI submitted a new review for 050a42a

@@ -42,8 +42,7 @@
"test:unit:ci": "jest --coverage"
},
"dependencies": {
"@codecov/bundler-plugin-core": "workspace:^",
"webpack": "5.89.0"
"@codecov/bundler-plugin-core": "workspace:^"
},
Copy link

Choose a reason for hiding this comment

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

Just to confirm, moving '@codecov/bundler-plugin-core' inside dependencies but moving 'webpack' out of it, into devDependencies could impact runtime if webpack is a runtime dependency. Please ensure that webpack is only needed in development and not in production.

@@ -55,10 +54,11 @@
"msw": "^2.0.9",
"ts-node": "^10.9.1",
"typescript": "^5.3.2",
"unbuild": "^2.0.0"
Copy link

Choose a reason for hiding this comment

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

It's good that you've moved 'webpack' into 'devDependencies', but please make sure that every development environment installs dev dependencies. This may not be the case in certain CI/CD pipelines.

@nicholas-codecov nicholas-codecov merged commit 4f1183e into main Jan 4, 2024
11 of 12 checks passed
@nicholas-codecov nicholas-codecov deleted the gh-eng-953-remove-webpack-4-for-v0 branch January 4, 2024 14:38
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.

[Bundler Plugins] Remove Webpack 4 stuff for V0
2 participants