{"action":"closed","issue":{"url":"https://api.github.com/repos/facebook/nuclide/issues/1198","repository_url":"https://api.github.com/repos/facebook/nuclide","labels_url":"https://api.github.com/repos/facebook/nuclide/issues/1198/labels{/name}","comments_url":"https://api.github.com/repos/facebook/nuclide/issues/1198/comments","events_url":"https://api.github.com/repos/facebook/nuclide/issues/1198/events","html_url":"https://github.com/facebook/nuclide/issues/1198","id":236021187,"number":1198,"title":"Changes required due to TextBuffer.save becoming async in Atom 1.19","user":{"login":"maxbrunsfeld","id":326587,"avatar_url":"https://avatars3.githubusercontent.com/u/326587?v=4","gravatar_id":"","url":"https://api.github.com/users/maxbrunsfeld","html_url":"https://github.com/maxbrunsfeld","followers_url":"https://api.github.com/users/maxbrunsfeld/followers","following_url":"https://api.github.com/users/maxbrunsfeld/following{/other_user}","gists_url":"https://api.github.com/users/maxbrunsfeld/gists{/gist_id}","starred_url":"https://api.github.com/users/maxbrunsfeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxbrunsfeld/subscriptions","organizations_url":"https://api.github.com/users/maxbrunsfeld/orgs","repos_url":"https://api.github.com/users/maxbrunsfeld/repos","events_url":"https://api.github.com/users/maxbrunsfeld/events{/privacy}","received_events_url":"https://api.github.com/users/maxbrunsfeld/received_events","type":"User","site_admin":true},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-06-14T21:56:41Z","updated_at":"2017-07-26T01:38:57Z","closed_at":"2017-07-26T01:38:57Z","body":"Hey Nuclide team!\r\n\r\nAs I've mentioned to some of you, in Atom v1.19, we will release a [major change](https://github.com/atom/atom/pull/14435) to Atom's core text buffer data structure. As part of this change, we have made `TextBuffer.save` asynchronous; rather than blocking until the save is complete, it now immediately returns a `Promise` that *resolves* when the save is complete. Because of this, a few other Atom APIs that *use* `save` have similarly become async:\r\n\r\n* `Pane.close`\r\n* `TextBuffer.save`\r\n* `TextEditor.save`\r\n* `Pane.saveItem`\r\n* `Pane.saveItemAs`\r\n* `Pane.saveActiveItem`\r\n* `Pane.saveActiveItemAs`\r\n* `Pane.saveItems`\r\n* `Workspace.saveActivePaneItem`\r\n* `Workspace.saveActivePaneItemAs`\r\n\r\n#### Effects on this package\r\n\r\nWe think this package could be impacted by this upgrade because it calls the changed methods in the following places:\r\n\r\n* `TextBuffer.save`\r\n  * [here](https://github.com/facebook/nuclide/tree/master/pkg/nuclide-remote-connection/lib/remote-text-buffer.js#L93)\r\n  * [here](https://github.com/facebook/nuclide/tree/master/pkg/nuclide-remote-connection/lib/remote-text-buffer.js#L95)\r\n* `TextEditor.save`\r\n  * [here](https://github.com/facebook/nuclide/tree/master/pkg/nuclide-patch-editor/lib/main.js#L127)\r\n  * [here](https://github.com/facebook/nuclide/tree/master/pkg/nuclide-patch-editor/lib/main.js#L180)\r\n  * [here](https://github.com/facebook/nuclide/tree/master/pkg/nuclide-patch-editor/lib/main.js#L191)\r\n  * [here](https://github.com/facebook/nuclide/tree/master/resources/benchmarker/benchmarks/archived/open-edit-save-by-package.js#L76)\r\n  * [here](https://github.com/facebook/nuclide/tree/master/resources/benchmarker/benchmarks/open-edit-save-by-size.js#L60)\r\n\r\nWe found these calls using a regex search, so this list might be incomplete, and it might contain some false positives.\r\n\r\n#### What to do about the change\r\n\r\nIt should be pretty easy to adjust your package code and/or tests to work with the new async behavior, and to simultaneously keep it working with older versions of Atom. Here are some examples of pull requests we opened on our bundled packages to cope with the change:\r\n\r\n* https://github.com/atom/autocomplete-plus/pull/852\r\n* https://github.com/atom/whitespace/pull/155\r\n* https://github.com/atom/symbols-view/pull/222\r\n* https://github.com/atom/status-bar/pull/193\r\n* https://github.com/atom/tabs/pull/448\r\n\r\nLet me know if you have any questions. I'd be happy to help!"}}
{"actor":{"display_login":"hansonw"}}