pmndrs / react-spring

✌️ A spring physics based React animation library
http://www.react-spring.dev/
MIT License
27.73k stars 1.18k forks source link

Remove Optional Chaining Operator #2281

Closed crazyair closed 1 month ago

crazyair commented 1 month ago

Why

Optional chains may cause errors in some lower version environments

What

Checklist

changeset-bot[bot] commented 1 month ago

⚠️ No Changeset found

Latest commit: e1c497e8278c0b650d51315085aead0804d44e36

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
react-spring ✅ Ready (Inspect) Visit Preview May 25, 2024 3:42am
crazyair commented 1 month ago

The problem is that this brought in https://github.com/pmndrs/react-spring/compare/v9.6.1...v9.7.0

joshuaellis commented 1 month ago

Optional chaining is accessible in 94% of browsers – https://caniuse.com/?search=optional%20chaining I don't think we need to omit it, you should transpile your code to the correct target should you need to target a browser that does not support it.

crazyair commented 1 month ago

Optional chaining is accessible in 94% of browsers – https://caniuse.com/?search=optional%20chaining I don't think we need to omit it, you should transpile your code to the correct target should you need to target a browser that does not support it.

But it was good before 9.6.1.

crazyair commented 1 month ago

https://npmmirror.com/package/@react-spring/core/files/dist/react-spring-core.cjs.dev.js?version=9.6.1#L157

image

https://npmmirror.com/package/@react-spring/core/files/dist/react-spring_core.modern.development.mjs?version=9.7.3#L124 image

crazyair commented 1 month ago

source: https://github.com/ant-design/ant-design/blob/master/components/affix/index.tsx#L151 image

https://npmmirror.com/package/antd/files/es/affix/index.js?version=5.17.3#L88-L89 image

crazyair commented 1 month ago

@joshuaellis Modify the compiled script?