[Feature Request]: support create specificated service to make code tree shakable #1044
Open
4 tasks done
Labels
type: community enhancement
feature request not on Twilio's roadmap
Preflight Checklist
Problem Description
Most time, developer only use a little part of the lib, for example, one is developing a sms sender will only use messaging api.
In this case tree shake can remove useless part to reduce the bundle size.
Currently twilio sdk provide a single entrypoint twilioSdk which include all service in it, which make bundler cannot recognize which part is not used, so all the code is include in the bundle.
I do see twilio sdk also export instanceClass like MessageInstance
but the type of paramter is confusing like V2010 need an ApiBase as paramter
and ApiBase use an any
make it hard to use
Proposed Solution
Provide a way to create single service for example:
Alternatives Considered
Other way it to make a breaking change to the implementation of entry, remove all service from it, only use it as meta configuration, pass it to service function when send request, like
Additional Information
No response
The text was updated successfully, but these errors were encountered: