-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Breaking Change: Remove SyncTasks from reactxp core and prefer ES6 promises #1129
Conversation
Usage of ES6 promises is more standardized, using SyncTasks by default doesn't provide many consumers a large benefit. If they need SyncTasks promises, they can wrap in SyncTasks.fromThenable at the use site
@erictraut @deregtd, looking for feedback here. ES6 promises are commonplace now. The custom error behaviour that we build into SyncTasks isn't overly valuable to consumers if they expect ES6 behaviour. We're also just wrapping ES6 promises in all the React Native callbacks. |
I'm fine with this. It's time to accept that people like swallowing errors in their code and deal with it. We still need to figure out what to do about simplerestclients, whether we add optional cancellation tokens or whatnot. |
Is it worth altering the TodoList sample as well (it uses SyncTasks in ServiceManager as it starts services)? https://github.com/microsoft/reactxp/blob/master/samples/TodoList/src/ts/services/ServiceManager.ts#L55 I ask because I built my app on that sample (:pray: thank you guys) and it has served me well so far, and might be the basis for future people |
@mikehardy - you're right. All the extensions would need to be updated too. I was just trying to make a single surgical change as an example, especially if others weren't onboard with this change :) |
This is a good idea, Brent. Let’s push this through the entire source base. |
I left the usage of SyncTasks in ImageList sample and TodoSample because the first relies on GenericRestClient (which still uses SyncTasks) and the latter relies on NoSqlProvider (same thing) Note: RXPTest will fail to compile unless the latest dist of reactxp is coped in (due to changed typings) |
@berickson1 This looks ready to merge. Any complaints? |
Selfishly - my project is in between releases now so this would be a low-pressure time for me to integrate the breaking change. So I'd love to see an rc.2 with this in it. With this change and maybe more breaking changes it might be a help to developers to mention in the release notes that focused breaking changes are happening, and are contemplated for the rc series so integrators should take care |
@berickson1 I was just looking to see if I could purge SyncTasks completely from my project and I am stuck on the NoSqlProvider. It appears to me that NoSqlProvider will need them forever based on this wording?
For GenericRestClient is the goal to eliminate SyncTasks where ever not needed (thus a PR there would be interesting) or will it sit as well? |
An internal team here is slowly working through removing synctasks from nosqlprovider. Basically, all modern browsers have fixed that limitation that caused us to originally need to use it, so it's not needed for IE11+ and like every other vaguely modern browser. GenericRestClient uses synctasks for cancellation. We'll need to figure out a new way to do cancellation on there for us to be able to eliminate synctasks, so don't worry about that for now. |
Oh great - I'll spend no time in this area then but now I know the direction, thanks for the speedy reply. |
Usage of ES6 promises is more standardized, using SyncTasks by default doesn't provide many consumers a large benefit. If they need SyncTasks promises, they can wrap in SyncTasks.fromThenable at the use site