Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intl-tel-input consumes 80% of bundle size of library in case of passwordless is enabled #660

Open
komarovalexander opened this issue Feb 18, 2023 · 5 comments
Assignees

Comments

@komarovalexander
Copy link

komarovalexander commented Feb 18, 2023

hi team intl tel input has size 423kb, which is more than 80% of size the whole library. In my case we do not need phone authorization
image

is there a way not to include intl-tel-input? or make it as lazy component?
thanks!

@komarovalexander komarovalexander changed the title decrease size of library intl-tel-input consumes 80% of bundle size of library Feb 18, 2023
@rishabhpoddar
Copy link
Contributor

Hey @komarovalexander which version of the SDK are you using? The passwordless recipe is not 105kb (for production builds). The size was reduced in version >= 0.30.0.

@komarovalexander
Copy link
Author

komarovalexander commented Feb 20, 2023

Hi @rishabhpoddar
I use all recipes of "supertokens-auth-react": "^0.31.1",
"supertokens-web-js": "^0.5.0",

I have create-react-app
build it
analyze it using source-map-explorer

I found that passwordless is the reason of big size:
If I include into recipeList

import Passwordless from 'supertokens-auth-react/recipe/passwordless';
//.....
   Passwordless.init({
				contactMethod: 'EMAIL',
				signInUpFeature: {
					disableDefaultUI: true,
				},
				useShadowDom: false,
				style: resetPassStyle,
			}),

I have
image

If I remove passwordless I have:
image

as I have contactMethod: 'EMAIL', is there a way not to include intl-tel-input to the main bundle of my app? as you can see it consumes 423kb

@komarovalexander komarovalexander changed the title intl-tel-input consumes 80% of bundle size of library intl-tel-input consumes 80% of bundle size of library in case of passwordless is enabled Feb 20, 2023
@rishabhpoddar
Copy link
Contributor

Right i see. There is no way to remove that library at the moment, unless you fork and remove it yourself and use that instead. I'll keep this issue open until we can come up with a better fix.

@kartojal
Copy link

is there any solution for this? supertokens-auth-react is taking 80% of my bundle size

@rishabhpoddar
Copy link
Contributor

@kartojal which version of the supertokens-auth-react SDK are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants