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

chore: bump query-string to ^8.1.0 and update jest config #2319

Merged
merged 5 commits into from Jan 28, 2024

Conversation

dxsun97
Copy link
Contributor

@dxsun97 dxsun97 commented Sep 10, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other: upgrade query-string dependency to latest version: 8.1.0 and fix test issues

🔗 Related issue link

close: #2155

💡 Background and solution

Upgrade query-string

As the issue above revealed, the ?. operator syntax in query-string and its related deps should be transformed. Without introducing additional deps, like babel-loader, there is a workaround as webpack/webpack#10227 mentioned, just upgrade Webpack to version 5 could fix it. ⚠️ This has an impact on build assets, maybe a breaking change? 🤔️

Update jest config

Since the latest query-string only provide ESM, so it should be transformed by jest. And there is a problem with the current configuration, according to the ts-jest docs, should set allowJs to true in tsconfig.json file when preset set to ts-jest/presets/js-with-ts. It works same as this PR: #1816, but more resonable.

Also bump ts-jest to latest version to support TypeScript 5.x, and suppress warnings.

📝 Changelog

Language Changelog
🇺🇸 English chore: upgrade query-string to ^8.1.0
🇨🇳 Chinese chore: 升级 query-string 到 ^8.1.0

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@CLAassistant
Copy link

CLAassistant commented Sep 10, 2023

CLA assistant check
All committers have signed the CLA.

@liuyib
Copy link
Collaborator

liuyib commented Sep 13, 2023

Thank you for your contribution and explain the "Background and solution" 👍

@liuyib
Copy link
Collaborator

liuyib commented Sep 13, 2023

⚠️ This has an impact on build assets, maybe a breaking change? 🤔️

The different between old bundles and new bundles:

License comment:
image

(new bundles)The license infomation will be placed to a single file:
image

/es/ bundle:
image

/lib/ bundle:

+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

+ var _queryString = _interopRequireDefault(require("query-string"));
- var _queryString = require("query-string");
image image

So I think the build assets have no breaking changes. 🎉

@liuyib liuyib self-requested a review September 13, 2023 12:43
@crazylxr crazylxr merged commit 7843f02 into alibaba:master Jan 28, 2024
8 checks passed
@dxsun97 dxsun97 deleted the chore/qs-deps-upgrade branch January 29, 2024 07:35
byethewind pushed a commit to byethewind/hooks that referenced this pull request Feb 26, 2024
* chore: upgrade query-string to ^8.1.0

* chore: update jest config

* style: update import

* style: update

---------

Co-authored-by: liuyib <1656081615@qq.com>
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.

Update query-string dependency in useStateUrl
4 participants