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

Remove optional chaining for backwards compatibility #303

Closed
wants to merge 1 commit into from
Closed

Remove optional chaining for backwards compatibility #303

wants to merge 1 commit into from

Conversation

Syphini
Copy link

@Syphini Syphini commented Aug 30, 2023

This PR would refactor the only 2 parts of optional chaining to help older browsers make use of the package (namely Safari < v13)

@dcastil
Copy link
Owner

dcastil commented Aug 30, 2023

Hey @Syphini! 👋

Thanks for the PR, I appreciate that! 🙏

I'm currently working on a v2 release of tailwind-merge that will transpile to a more modern version of JS, so the removal of optional chaining will not be enough to support Safari <13 anymore. But I'm also adding an ES5-compatible build that will work in Safari <13 (optional chaining gets transpiled away there). You can read about that in the migration guide from v1 to v2.

I think I'll release v2 in about 3 weeks (I'm traveling in between, so can't release sooner unfortunately). I suggest closing this PR and use the ES5-compatible bundle in v2.

If you can't wait until v2, you could also install tailwind-merge@1.14.0-dev.31dcd2966ebb0e6901602609db1759403f05b251 which is the latest commit on the main branch which is essentially v2. I don't plan any more changes in code for v2, only some docs are missing (you can check out the v2 roadmap). But keep in mind that those dev versions are unstable between releases, so I'd be cautious using those in high stakes production apps.

@Syphini
Copy link
Author

Syphini commented Aug 30, 2023

Sounds good I'll be happy to wait for v2.
Noticed that there wasn't any transpiling for this while testing so I put through a PR but if you're all over it then no worries.

Thanks for the response!

@Syphini Syphini closed this Aug 30, 2023
@dcastil dcastil added context-v1 Related to tailwind-merge v1 context-v2 Related to tailwind-merge v2 labels Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context-v1 Related to tailwind-merge v1 context-v2 Related to tailwind-merge v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants