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 for Flexible Sync Configuration #4562

Merged
merged 4 commits into from
May 10, 2022
Merged

Fix for Flexible Sync Configuration #4562

merged 4 commits into from
May 10, 2022

Conversation

takameyer
Copy link
Contributor

@takameyer takameyer commented May 6, 2022

What, How & Why?

This makes the flexible boolean incompatible with paritionValue,
without setting tsconfig to false. It does however not allow,
flexible to be false, but that's a better tradeoff in the end.

This closes #4552

☑️ ToDos

  • 📝 Changelog entry
  • 📝 Compatibility label is updated or copied from previous entry
  • 🚦 Tests
  • 📱 Check the React Native/other sample apps work if necessary
  • 📝 Public documentation PR created or is not necessary
  • 💥 Breaking label has been applied or is not necessary

If this PR adds or changes public API's:

  • typescript definitions file is updated
  • jsdoc files updated
  • Chrome debug API is updated if API is available on React Native

@cla-bot cla-bot bot added the cla: yes label May 6, 2022
This makes the flexible boolean incompatible with paritionValue,
without setting tsconfig to false.  It does however allow,
flexible to be false, but thats a better tradeoff in the end.
@takameyer takameyer force-pushed the andrew/fix-flx-types branch from 834586a to d0d87d1 Compare May 6, 2022 11:50
This makes the flexible boolean incompatible with paritionValue,
without setting tsconfig to false.  It does however allow,
flexible to be false, but thats a better tradeoff in the end.
@takameyer
Copy link
Contributor Author

Just for a little more background on these changes, I found that instead of trying to make a type that supports {flexible: false, partitionValue: "something"}, we could just make {flexible: false} completely incompatible and only support {flexible: true, partitionValue: never} and {flexible: never, partitionValue: "something"}.
This has the advantage of fixing the type errors we were having with strict: false.
I think this is a good tradeoff, as I do not really see the use case for flexible: false.

integration-tests/tests/src/tests/sync/flexible.ts Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
types/index.d.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@tomduncalf tomduncalf left a comment

Choose a reason for hiding this comment

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

👍 Thanks for finding this workaround! I've only made minor suggestions which you can choose to ignore if preferred

@takameyer takameyer force-pushed the andrew/fix-flx-types branch from 525a553 to 156504a Compare May 10, 2022 08:21
@takameyer takameyer merged commit 0b88c72 into master May 10, 2022
@takameyer takameyer deleted the andrew/fix-flx-types branch May 10, 2022 08:30
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flexible sync type definitions require strictNullChecks to be enabled
4 participants