Changes between Initial Version and Version 1 of Ticket #12859


Ignore:
Timestamp:
Jan 26, 2015, 12:50:52 PM (4 years ago)
Author:
Piotrek Koszuliński
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12859

    • Property Status changed from new to confirmed
  • Ticket #12859 – Description

    initial v1  
    11Why CKEditor fails when I try to call some methods one after another?
    22
    3 ```
     3{{{
    44editor.setData( someData );
    55// somewhere later...
    66editor.destroy();
    7 ```
     7}}}
    88
    99The answer, unfortunately, isn't simple. Otherwise we'd have this fixed a long time ago. This is a mix of history, backwards compatibility, architectural limitations and lack of good solutions.
     
    1919The last thing, and actually the most unfortunate, is that throwing errors is not that good solution. It may tell you that you're doing something wrong, but it won't tell you when you can do it.
    2020
    21 ```
     21{{{
    2222try {
    2323        editor.setData( ... );
     
    3636        }
    3737}
    38 ```
     38}}}
    3939
    4040Isn't it ugly? I think it's a terrible developer experience. A more useful approach would to be cache method calls and execute them when the editor reaches the correct state. But this would mean that for instance `editor.destroy`, which is currently a synchronous method, would become an asynchronous one because it can't be executed while editor is not ready. Moreover, to make all this possible to implement we would need to do serious changes not only in the API, but in the editor internals as well. Even the highly unsatisfactory solution with throwing errors requires significant effort to and may lead to ugly compatibility issues.
    4141
    42 To sum up. I don't want say that fixing this in CKEditor 4.x is impossible, but for now we didn't have enough resources and well... courage, to attempt that. I would also risk a statement that it's late in CKEditor 4.x for such changes. But most importantly, we are aware of these problems and will definitely [design CKEditor 5](https://github.com/ckeditor/ckeditor5-design)'s API differently.
     42To sum up. I don't want say that fixing this in CKEditor 4.x is impossible, but for now we didn't have enough resources and well... courage, to attempt that. I would also risk a statement that it's late in CKEditor 4.x for such changes. But most importantly, we are aware of these problems and will definitely [https://github.com/ckeditor/ckeditor5-design design CKEditor 5]'s API differently.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy