BitPhinix / slate-yjs

Yjs binding for Slate
https://docs.slate-yjs.dev
MIT License
514 stars 73 forks source link

chore(core): don't autoconnect by default #334

Closed BitPhinix closed 2 years ago

BitPhinix commented 2 years ago

Since auto-connect is a side effect, it should be triggered by a useEffect (otherwise it'll break in strict mode and future versions of react). The current docs encourage the use of auto-connect in react, which should not be the case.

Fixes: #331

changeset-bot[bot] commented 2 years ago

🦋 Changeset detected

Latest commit: 72966fee9e99009f7f0d2d7edb81b96e5ed980bf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | --------------- | ----- | | @slate-yjs/core | Patch |

Not sure what this means? Click here to learn what changesets are.

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

codecov[bot] commented 2 years ago

Codecov Report

Merging #334 (72966fe) into main (01bdd0f) will decrease coverage by 0.01%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #334      +/-   ##
==========================================
- Coverage   71.32%   71.31%   -0.02%     
==========================================
  Files          30       30              
  Lines        2302     2301       -1     
  Branches      297      297              
==========================================
- Hits         1642     1641       -1     
  Misses        660      660              
Impacted Files Coverage Δ
support/fixtures.ts 89.06% <ø> (-0.17%) :arrow_down:
packages/core/src/plugins/withYjs.ts 81.07% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 01bdd0f...72966fe. Read the comment docs.