{"action":"created","issue":{"url":"https://api.github.com/repos/ckeditor/ckeditor5-core/issues/42","repository_url":"https://api.github.com/repos/ckeditor/ckeditor5-core","labels_url":"https://api.github.com/repos/ckeditor/ckeditor5-core/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/ckeditor/ckeditor5-core/issues/42/comments","events_url":"https://api.github.com/repos/ckeditor/ckeditor5-core/issues/42/events","html_url":"https://github.com/ckeditor/ckeditor5-core/issues/42","id":190087669,"number":42,"title":"Plugins can not set data, a.k.a. editor.instanceReady","user":{"login":"pjasiun","id":1166967,"avatar_url":"https://avatars.githubusercontent.com/u/1166967?v=3","gravatar_id":"","url":"https://api.github.com/users/pjasiun","html_url":"https://github.com/pjasiun","followers_url":"https://api.github.com/users/pjasiun/followers","following_url":"https://api.github.com/users/pjasiun/following{/other_user}","gists_url":"https://api.github.com/users/pjasiun/gists{/gist_id}","starred_url":"https://api.github.com/users/pjasiun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjasiun/subscriptions","organizations_url":"https://api.github.com/users/pjasiun/orgs","repos_url":"https://api.github.com/users/pjasiun/repos","events_url":"https://api.github.com/users/pjasiun/events{/privacy}","received_events_url":"https://api.github.com/users/pjasiun/received_events","type":"User","site_admin":false},"labels":[{"id":416120714,"url":"https://api.github.com/repos/ckeditor/ckeditor5-core/labels/status:confirmed","name":"status:confirmed","color":"e6e6e6","default":false},{"id":416120716,"url":"https://api.github.com/repos/ckeditor/ckeditor5-core/labels/status:inprogress","name":"status:inprogress","color":"ededed","default":false},{"id":416120742,"url":"https://api.github.com/repos/ckeditor/ckeditor5-core/labels/type:enhancement","name":"type:enhancement","color":"84b6eb","default":false}],"state":"open","locked":false,"assignee":{"login":"Reinmar","id":156149,"avatar_url":"https://avatars.githubusercontent.com/u/156149?v=3","gravatar_id":"","url":"https://api.github.com/users/Reinmar","html_url":"https://github.com/Reinmar","followers_url":"https://api.github.com/users/Reinmar/followers","following_url":"https://api.github.com/users/Reinmar/following{/other_user}","gists_url":"https://api.github.com/users/Reinmar/gists{/gist_id}","starred_url":"https://api.github.com/users/Reinmar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Reinmar/subscriptions","organizations_url":"https://api.github.com/users/Reinmar/orgs","repos_url":"https://api.github.com/users/Reinmar/repos","events_url":"https://api.github.com/users/Reinmar/events{/privacy}","received_events_url":"https://api.github.com/users/Reinmar/received_events","type":"User","site_admin":false},"assignees":[{"login":"Reinmar","id":156149,"avatar_url":"https://avatars.githubusercontent.com/u/156149?v=3","gravatar_id":"","url":"https://api.github.com/users/Reinmar","html_url":"https://github.com/Reinmar","followers_url":"https://api.github.com/users/Reinmar/followers","following_url":"https://api.github.com/users/Reinmar/following{/other_user}","gists_url":"https://api.github.com/users/Reinmar/gists{/gist_id}","starred_url":"https://api.github.com/users/Reinmar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Reinmar/subscriptions","organizations_url":"https://api.github.com/users/Reinmar/orgs","repos_url":"https://api.github.com/users/Reinmar/repos","events_url":"https://api.github.com/users/Reinmar/events{/privacy}","received_events_url":"https://api.github.com/users/Reinmar/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/ckeditor/ckeditor5-core/milestones/5","html_url":"https://github.com/ckeditor/ckeditor5-core/milestones/iteration%206","labels_url":"https://api.github.com/repos/ckeditor/ckeditor5-core/milestones/5/labels","id":2160540,"number":5,"title":"iteration 6","description":"","creator":{"login":"Reinmar","id":156149,"avatar_url":"https://avatars.githubusercontent.com/u/156149?v=3","gravatar_id":"","url":"https://api.github.com/users/Reinmar","html_url":"https://github.com/Reinmar","followers_url":"https://api.github.com/users/Reinmar/followers","following_url":"https://api.github.com/users/Reinmar/following{/other_user}","gists_url":"https://api.github.com/users/Reinmar/gists{/gist_id}","starred_url":"https://api.github.com/users/Reinmar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Reinmar/subscriptions","organizations_url":"https://api.github.com/users/Reinmar/orgs","repos_url":"https://api.github.com/users/Reinmar/repos","events_url":"https://api.github.com/users/Reinmar/events{/privacy}","received_events_url":"https://api.github.com/users/Reinmar/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2016-11-28T10:26:19Z","updated_at":"2016-11-29T10:08:12Z","due_on":"2016-12-23T00:00:00Z","closed_at":null},"comments":4,"created_at":"2016-11-17T16:00:51Z","updated_at":"2016-11-29T10:20:28Z","closed_at":null,"body":"Now, the order of initialization is:\r\n\r\n```js\r\neditor.initPlugins()\r\n   .then( () => editor._elementReplacer.replace( element, editor.ui.element ) )\r\n   .then( () => editor.ui.init() )\r\n   .then( () => editor.editing.view.attachDomRoot( editor.ui.editableElement ) )\r\n   .then( () => editor.loadDataFromEditorElement() )\r\n   .then( () => editor )\r\n```\r\n\r\nIt means that plugins are `init` before the `loadDataFromEditorElement`, which calls `setData`. What if a plugin wants to `setData`?\r\n\r\nBut wait, there is more! What if a plugin wants to modify initial data or just read them? Plugins are also initialized before the `ui` is initialized. What if a plugin wants to use the UI?\r\n\r\nSo there could be an event that... the instance is ready, so plugins can execute some actions on it.\r\n\r\nAlternatively, there could be a second method in plugins called when editor is ready. Thanks to it plugins could return a promise in this method what is not possible in events.\r\n\r\nAnother solution is to check if there is not data already loaded before calling  `loadDataFromEditorElement`. It would solve only the fist problem, but it is my favorite solution because is the least intrusive and seems to be the most correct behavior (hacks-less)."},"comment":{"url":"https://api.github.com/repos/ckeditor/ckeditor5-core/issues/comments/263531794","html_url":"https://github.com/ckeditor/ckeditor5-core/issues/42#issuecomment-263531794","issue_url":"https://api.github.com/repos/ckeditor/ckeditor5-core/issues/42","id":263531794,"user":{"login":"Reinmar","id":156149,"avatar_url":"https://avatars.githubusercontent.com/u/156149?v=3","gravatar_id":"","url":"https://api.github.com/users/Reinmar","html_url":"https://github.com/Reinmar","followers_url":"https://api.github.com/users/Reinmar/followers","following_url":"https://api.github.com/users/Reinmar/following{/other_user}","gists_url":"https://api.github.com/users/Reinmar/gists{/gist_id}","starred_url":"https://api.github.com/users/Reinmar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Reinmar/subscriptions","organizations_url":"https://api.github.com/users/Reinmar/orgs","repos_url":"https://api.github.com/users/Reinmar/repos","events_url":"https://api.github.com/users/Reinmar/events{/privacy}","received_events_url":"https://api.github.com/users/Reinmar/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T10:20:28Z","updated_at":"2016-11-29T10:20:28Z","body":"This feature is required for https://github.com/ckeditor/ckeditor5-heading/issues/40. And will require small changes in the classic creator."}}
{"actor":{"display_login":"Reinmar"}}