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

switch from browserify to webpack #1140

Merged
merged 5 commits into from
Feb 4, 2023
Merged

switch from browserify to webpack #1140

merged 5 commits into from
Feb 4, 2023

Conversation

hipstersmoothie
Copy link
Collaborator

@hipstersmoothie hipstersmoothie commented Feb 4, 2023

closes #1139
closes #1132

📦 Published PR as canary version: 0.17.9--canary.1140.e3ff49d.0

✨ Test out this PR locally via:

npm install @jimp/cli@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/core@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/custom@0.17.9--canary.1140.e3ff49d.0
npm install jimp@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-blit@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-blur@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-circle@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-color@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-contain@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-cover@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-crop@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-displace@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-dither@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-fisheye@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-flip@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-gaussian@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-invert@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-mask@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-normalize@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-print@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-resize@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-rotate@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-scale@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-shadow@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugin-threshold@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/plugins@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/test-utils@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/bmp@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/gif@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/jpeg@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/png@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/tiff@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/types@0.17.9--canary.1140.e3ff49d.0
npm install @jimp/utils@0.17.9--canary.1140.e3ff49d.0
# or 
yarn add @jimp/cli@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/core@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/custom@0.17.9--canary.1140.e3ff49d.0
yarn add jimp@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-blit@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-blur@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-circle@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-color@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-contain@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-cover@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-crop@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-displace@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-dither@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-fisheye@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-flip@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-gaussian@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-invert@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-mask@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-normalize@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-print@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-resize@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-rotate@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-scale@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-shadow@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugin-threshold@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/plugins@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/test-utils@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/bmp@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/gif@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/jpeg@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/png@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/tiff@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/types@0.17.9--canary.1140.e3ff49d.0
yarn add @jimp/utils@0.17.9--canary.1140.e3ff49d.0

Release Notes

This PR can be considered a breaking change as it remove the jimp.min.js file.

Instead there is now only the jimp.js file and we ship source maps for it.

We also configured the browser field so jimp will be automatically bundled better

@@ -10,5 +10,7 @@ runs:
path: |
node_modules
packages/*/dist
packages/*/es
packages/jimp/browser/lib
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We weren't caching all the build files so that's why they weren't there

@@ -77,21 +77,6 @@ If you're using a web bundles (webpack, rollup, parcel) you can benefit from usi
import Jimp from "jimp/es";
```

### WebPack

If you're using webpack you can set `process.browser` to true and your build of jimp will exclude certain parts, making it load faster.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This isn't a problem anymore and was always a misunderstanding on how to make a browser bundle 😓

"typesVersions": {
">=3.1.0-0": {
"*": [
"types/ts3.1/index.d.ts"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not interested in supporting ancient TS versions

const isProd = process.env.NODE_ENV === "production";

export default {
mode: isProd ? "production" : "development",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Webpack is sooooo much simpler than a custom browserify scrip

@@ -24,7 +24,7 @@
},
"dependencies": {
"@babel/runtime": "^7.7.2",
"pngjs": "^3.3.3"
"pngjs": "^6.0.0"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Upgraded pngjs along the way too

@hipstersmoothie hipstersmoothie merged commit ecdd71e into master Feb 4, 2023
@hipstersmoothie hipstersmoothie deleted the mandrew/repo branch February 4, 2023 18:47
@hipstersmoothie hipstersmoothie added the major Increment the major version when merged label Feb 4, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2023

🚀 PR was released in v0.20.0 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Increment the major version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

browser/lib/jimp[.min].js no longer included since release v0.16.3 Bundle with webpack
1 participant