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

Make Upcast and Downcast writers more consistent #4409

Closed
f1ames opened this issue Aug 31, 2018 · 2 comments · Fixed by ckeditor/ckeditor5-engine#1536
Closed

Make Upcast and Downcast writers more consistent #4409

f1ames opened this issue Aug 31, 2018 · 2 comments · Fixed by ckeditor/ckeditor5-engine#1536
Assignees
Milestone

Comments

@f1ames
Copy link
Contributor

f1ames commented Aug 31, 2018

Extracted from ckeditor/ckeditor5-engine#1503.

When working on UpcastWriter we made it as much consistent as possible with DowncastWriter. However, DowncastWriter has some inconsistencies itself which could be fixed:

remove() is inconsistent only because downcastWriter takes a range only. TBH, I'd change downcastWriter to accept both range and element and simply check if element is passed, if so, create a range on it (Range.createOn()). When this is done, the methods are consistent enough to get a thumbs up from me.

rename() is available in DowncastWriter and has wrong order. I'd change the order there.

@f1ames f1ames self-assigned this Aug 31, 2018
@f1ames
Copy link
Contributor Author

f1ames commented Sep 10, 2018

The only thing which makes me sad about this change is that after it the DowncastWriter.rename() method signature will be inconsistent with the model/writer.rename() method signature. However, since those writers does not have so much in common as Upcast and Downcast writers I think it is acceptable.
Still it may bring some confusion for developers who use both model and view writers frequently.

@f1ames f1ames assigned f1ames and unassigned f1ames Sep 10, 2018
@scofalik
Copy link
Contributor

It makes me sad too. Could you please create a follow-up ticket for that?

scofalik referenced this issue in ckeditor/ckeditor5-engine Sep 12, 2018
Other: Swapped parameters order in the `DowncastWriter#rename()` method. The `DowncastWriter#remove()` method now accepts range or item. Closes #1521.

BREAKING CHANGE: Swapped parameters order in the `DowncastWriter` (former `engine\view\writer`) `rename()`  method. See #1521.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added this to the iteration 20 milestone Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants