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

fix: #3840 Rollup config #4622

Merged
merged 1 commit into from
Mar 20, 2024
Merged

Conversation

yuki0410-dev
Copy link
Contributor

@yuki0410-dev yuki0410-dev commented Mar 20, 2024

Description

Linked issue: close #3840

Problem
See issue #3840

Changes

  • Add banner as copyright to build results
  • Add inline sourcemap to output files other than .min.js
  • Change compression target to min.js only

Screenshots

To reviewers

In the issue, it was mentioned that it would be useful to have uncompressed code, but for debug purposes, we thought it would be better to add a source map as well, so we set it up.

In the case of cjs,ems, basically, compression is done in the production build of the module bundler on the user's side, so we do not think that compression on the library side is mandatory. (I assume the source map will also be removed at this time.)
(I am a little confused as to whether to compress just min.js or everything.)

I would be glad to hear your comments on the above two points.

Contribution checklist

  • I have followed the contributing guidelines.
  • I have added sufficient test coverage for my changes.
  • I have formatted my code with Prettier and checked for linting issues with ESLint for code readability.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

⚠️ This pull request was not sent to the PullRequest network because the pull request is a draft.

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.96%. Comparing base (f7048fa) to head (026b9a1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4622   +/-   ##
=======================================
  Coverage   96.96%   96.96%           
=======================================
  Files          28       28           
  Lines        2601     2601           
  Branches     1095     1095           
=======================================
  Hits         2522     2522           
  Misses         79       79           

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

},
{
file: "dist/react-datepicker.js",
file: pkg.browser.replace(".min.js", ".js"),
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 resulting string will be the same

Copy link

Choose a reason for hiding this comment

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

Will be the same as what?

Image of Simon Simon

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I meant that the resulting string would be the same as the string before the modification.

@yuki0410-dev
Copy link
Contributor Author

before
https://github.com/Hacker0x01/react-datepicker/actions/runs/8349744819/job/22854593372

┌───────────────────────────────────────────────┐
│                                               │
│   Destination: dist/react-datepicker.min.js   │
│   Bundle Size:  106.74 KB                     │
│   Minified Size:  106.61 KB                   │
│   Gzipped Size:  22.34 KB                     │
│                                               │
└───────────────────────────────────────────────┘
┌───────────────────────────────────────────┐
│                                           │
│   Destination: dist/react-datepicker.js   │
│   Bundle Size:  106.74 KB                 │
│   Minified Size:  106.61 KB               │
│   Gzipped Size:  22.34 KB                 │
│                                           │
└───────────────────────────────────────────┘
┌────────────────────────────────┐
│                                │
│   Destination: dist/index.js   │
│   Bundle Size:  104.46 KB      │
│   Minified Size:  104.34 KB    │
│   Gzipped Size:  22.15 KB      │
│                                │
└────────────────────────────────┘
┌───────────────────────────────────┐
│                                   │
│   Destination: dist/es/index.js   │
│   Bundle Size:  101.3 KB          │
│   Minified Size:  101.18 KB       │
│   Gzipped Size:  21.93 KB         │
│                                   │
└───────────────────────────────────┘

this PR result

┌───────────────────────────────────────────────┐
│                                               │
│   Destination: dist/react-datepicker.min.js   │
│   Bundle Size:  106.85 KB                     │
│   Minified Size:  106.72 KB                   │
│   Gzipped Size:  22.42 KB                     │
│                                               │
└───────────────────────────────────────────────┘
┌───────────────────────────────────────────┐
│                                           │
│   Destination: dist/react-datepicker.js   │
│   Bundle Size:  803.26 KB                 │
│   Minified Size:  106.84 KB               │
│   Gzipped Size:  22.48 KB                 │
│                                           │
└───────────────────────────────────────────┘
┌────────────────────────────────┐
│                                │
│   Destination: dist/index.js   │
│   Bundle Size:  791.23 KB      │
│   Minified Size:  119.83 KB    │
│   Gzipped Size:  23.31 KB      │
│                                │
└────────────────────────────────┘
┌───────────────────────────────────┐
│                                   │
│   Destination: dist/es/index.js   │
│   Bundle Size:  785.31 KB         │
│   Minified Size:  114.42 KB       │
│   Gzipped Size:  22.89 KB         │
│                                   │
└───────────────────────────────────┘

https://github.com/Hacker0x01/react-datepicker/actions/runs/8352735857/job/22863286969?pr=4622

@yuki0410-dev yuki0410-dev marked this pull request as ready for review March 20, 2024 02:04
Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

✅ This pull request was sent to the PullRequest network.


@yuki0410-dev you can click here to see the review status or cancel the code review job.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

PullRequest Breakdown

Reviewable lines of change

+ 17
- 2

100% JavaScript

Type of change

Fix - These changes are likely to be fixing a bug or issue.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

This looks fine to me. I see no issues here.

Image of Simon Simon


Reviewed with ❤️ by PullRequest

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

Looks good. Definitely recommend having source maps and un-minimized code for open-source JS projects.

Image of Luciano C Luciano C


Reviewed with ❤️ by PullRequest

@martijnrusschen martijnrusschen merged commit 262f38c into Hacker0x01:main Mar 20, 2024
6 checks passed
@yuki0410-dev yuki0410-dev deleted the fix/3840 branch March 20, 2024 22:25
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.

No unminified code available
2 participants