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

[changes] deprecate deleteCharBackward and forward APIs #2073

Closed
wants to merge 1 commit into from
Closed

[changes] deprecate deleteCharBackward and forward APIs #2073

wants to merge 1 commit into from

Conversation

davidchang
Copy link
Contributor

Is this adding or improving a feature or fixing a bug?

An Improvement, by deprecating extra APIs

What's the new behavior?

Removing deleteCharBackward and deleteCharForward in their entirety, since users can just use deleteBackward and deleteForward to achieve the same behavior.

How does this change work?

Wasn't sure if the issue that was opened was wanting to remove in their entirety, or just add a logger.deprecate into the functions. But if it's a major, breaking change, with a simple migration path (find/replace), I think it's okay just to remove in its entirety.

Have you checked that...?

  • The new code matches the existing patterns and styles.
  • The tests pass with yarn test.
  • The linter passes with yarn lint. (Fix errors with yarn prettier.)
  • The relevant examples still work. (Run examples with yarn watch.)

Does this fix any issues or need any specific reviewers?

Fixes: #2043
Reviewers: @ianstormtaylor

@codecov
Copy link

codecov bot commented Aug 11, 2018

Codecov Report

Merging #2073 into master will decrease coverage by 0.24%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2073      +/-   ##
==========================================
- Coverage   66.86%   66.62%   -0.25%     
==========================================
  Files          68       68              
  Lines        5635     5615      -20     
==========================================
- Hits         3768     3741      -27     
- Misses       1867     1874       +7
Impacted Files Coverage Δ
packages/slate/src/changes/at-range.js 93.58% <ø> (-0.19%) ⬇️
packages/slate/src/changes/at-current-range.js 95.86% <ø> (ø) ⬆️
packages/slate-react/src/plugins/after.js 5.34% <0%> (ø) ⬆️
packages/slate/src/utils/text-utils.js 71.11% <0%> (-15.56%) ⬇️

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 dc95ad6...88fcb7a. Read the comment docs.

@ianstormtaylor
Copy link
Owner

Hey @davidchang thanks for taking this on! We'll actually want to add deprecations, to make migrating to the new version easier for people. And we'd want to preserve the existing tests to ensure that the current behaviors of the *Char* methods is preserved.

I think the one issue is that the *Char* methods are the only place that it was looking at the actual text to determine the distance to delete (emojis have length greater than 1 sometimes), so we'd need that logic to be preserved in deleteBackward/Forward still.

@ianstormtaylor
Copy link
Owner

Fixed by #3093.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deprecate deleteCharBackward/Forward
2 participants