Re: Please don't depreciate cursor and session

1013 0
Showing results for 
Search instead for 
Did you mean: 
7 - App Architect
7 - App Architect

Hey there,

The state management and reactivity of all of our airtable apps is based on mobx and mobx-react-lite and not on hooks. This allows use to write code that is object oriented and therefore cleaner, more robust and faster and easier to develop and maintain (at least for us).

We specifically wrapped your cursor and session objects as mobx based classes and are observing changes by calling the watch methods of those objects and updating class members that are mobx observables.

I saw here that you plan to deprecate the cursor and session objects.

Please don’t and allow people to decide which state management paradigm and library to use and don’t force them to use react hooks.


1 Reply 1
Airtable Employee
Airtable Employee

Hi Ronen!

We (unfortunately) didn’t provide reasoning on why we marked cursor and session objects as deprecated in the changelog. The underlying reason is so that the blocks-testing framework can inject cursor and session objects.

What you can do is use the hook at the root of the application and then pass them down (Or put the hooks in a component that captures the value and makes it available globally if you don’t want your main application re-rendering on cursor/session updates). It’s not ideal, but it would allow you to take advantage of the blocks-testing package if you wanted!

Otherwise I wouldn’t worry too much about the global versions of session / cursor objects disappearing anytime soon. We just don’t want to encourage new uses due to the blocks-testing incompatibility. :grinning_face_with_smiling_eyes: