Update dependencies to use versions supporting ES modules#4098
Update dependencies to use versions supporting ES modules#4098tdonohue merged 2 commits intoDSpace:mainfrom
Conversation
|
Submitting a draft version of the PR to update some dependencies to newer versions supporting ES modules. I would appreciate some help if anyone has ideas about, or time to work on, the TODO dependencies. Also, I want to see if the existing dependencies I've updated break anything in CI. |
cc17907 to
37e3634
Compare
|
Hi @alanorth, |
Newer releases support ES modules. Also remove unneccessary eslint skip hint.
|
The remaining dependencies require code changes to implement and I don't have time to look into those. I suggest reviewing and merging the proposed changes for two dependencies so we can get rid of those two warnings. |
|
@alanorth , should we better replace |
|
I've cherry-picked the proposed changes. The warnings regarding |
lodash-es supports ES modules.
@saschaszott oh yes! I didn't even think to look for types. I've updated the types for lodash-es. Thanks. |
References
Add references/links to any related issues or PRs. These may include:
Description
Several dependencies are imported as CommonJS modules, which do not support tree shaking by bundlers like Webpack. This leads to warnings like this during build:
In theory this should allow Webpack to create smaller bundles due to removing unused code.
Instructions for Reviewers
Please add a more detailed description of the changes made by your PR. At a minimum, providing a bulleted list of changes in your PR is helpful to reviewers.
List of changes in this PR:
filesizedependency to version that supports ES moduleslodash-esinstead oflodash, which supports ES modulesTODO (help wanted), which will require code changes:
js-cookieto v3.0.0, requires code changesorejimeto v3.0.0, requires code changesdate-fns-tzwith@date-fns/tzor@date-fns/utcfrom thedate-fnsproject, requires code changesInclude guidance for how to test or review your PR.
To test this PR, run
npm run buildafter applying the patch and make sure the warnings for filesize and lodash are gone.Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.