supertokens / supertokens-web-js

SuperTokens SDK for vanilla JS for all recipes
Other
58 stars 10 forks source link

fix: Fix error thrown by Recipe methods when ST is not initialized #104

Closed prateek3255 closed 9 months ago

prateek3255 commented 9 months ago

Summary of change

Fix "MultiTenancy not initialized" error being thrown instead of "SuperTokens not initialized" when calling recipe methods directly without initializing SuperTokens first.

Related issues

N/A

Test Plan

Documentation changes

N/A

Checklist for important updates

Remaining TODOs for this PR

N/A

github-actions[bot] commented 9 months ago

size-limit report 📦

Path Size
lib/build/index.js 24.93 KB (+0.1% 🔺)
recipe/emailverification/index.js 25.2 KB (+0.09% 🔺)
recipe/emailpassword/index.js 25.11 KB (+0.13% 🔺)
recipe/thirdparty/index.js 26.16 KB (+0.14% 🔺)
recipe/thirdpartyemailpassword/index.js 28.1 KB (+0.14% 🔺)
recipe/session/index.js 22.07 KB (+0.09% 🔺)
recipe/passwordless/index.js 26.42 KB (+0.11% 🔺)
recipe/thirdpartypasswordless/index.js 28.64 KB (+0.16% 🔺)
recipe/userroles/index.js 22.32 KB (+0.09% 🔺)
recipe/multitenancy/index.js 24.58 KB (+0.15% 🔺)
prateek3255 commented 9 months ago

The size check seems to be failing on the base branch itself, have updated the size accordingly to accommodate for it

rishabhpoddar commented 9 months ago

@prateek3255 the PR size check is also failing. Some of the size increases are massive.. why? Maybe you should not import from supertokens in all the recipes and change your approach. Please rethink.

prateek3255 commented 9 months ago

the PR size check is also failing. Some of the size increases are massive.. why? Maybe you should not import from supertokens in all the recipes and change your approach. Please rethink.

The size check is actually failing because of the base branch itself as I mentioned here https://github.com/supertokens/supertokens-web-js/pull/104#issuecomment-1895709755. Although yeah the size increase is large will think of some other way to accommodate the check

prateek3255 commented 9 months ago

@prateek3255 the PR size check is also failing. Some of the size increases are massive.. why? Maybe you should not import from supertokens in all the recipes and change your approach. Please rethink.

@rishabhpoddar For this created a separate small singleton that keeps track of SuperTokens init and is used by all recipes, this not only helps with very minimal size gains but also prevents cyclic dependencies in certain recipes.