Why deprecate expo-permissions?

The most recent SDK deprecated expo-permissions which as far as I am aware is the only sub-package that exposed hooks.

This sub-package was a great and elegant way to manage permissions in a developer-friendly way. Why was this package deprecated in SDK 41?

Hey @mentor, we mention the main reasoning behind this decision in our blog, “There shouldn’t be two ways to do an identical thing in a single SDK, and so we picked our preferred approach and are consolidating around it.”

Cheers,
Adam

Uhm why? React has class-state and state hooks for a reason. Different code bases like to structure things different ways.

It’s the same reason many libraries support both doThing( result => {} ) and doThing().then().

I believe the biggest reason is to specifically separate actions into distinct scopes.

in favor of module-specific permissions methods

I believe this decision is due to iOS modifications, and for now to prevent possible changes in the future without conflicting with projects that have no correlation.

Why need a permission if that library doing the action won’t be used?
Just import the needed.

I got a APP from 120MB (expo build) to 17MB (eas build), in SDK 40.

Like I said previously, it’s about preferred code structure. The libraries do not expose useHooks for example.

I understand your words, but not your meaning.

I don’t see the relation to this thread.

I think if the only need is to expose hooks, to this permissions.
Then you can go to Feature Requests | Expo and add a new request.
I think this request will be helpful, since I’m gonna use in a project when done.

You can create your own hook style, see this example for camera permission

There have been significant changes in the form of permissions.
There is a tendency for each module to have only the code for that feature.
Camera, GPS, Documents, Wifi, etc…
So, if you need to change something in the module gps, it has no impact with camera, wifi. etc…

The size diff was just to make a point, about why they are doing it, and the benefits.

In few words.

If you have two modules that do something, when you need to change a feature, you will need to change both modules.

That’s duplicate work.

If you look for the new documentation, you will see that the GPS permission now has a different reply, due to the modifications that have been made for the new needs.

In the code

You can copy and change, according with your needs.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.