-
Notifications
You must be signed in to change notification settings - Fork 81
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
Code review changes #15
Code review changes #15
Conversation
Changes not done, but to discuss
|
No need for those since the
and When I first ran npm run test, a lof of the tests threw CONNECTION REFUSED for localhost:3031 error.. then I ran testApp.sh --wait, and then I reran npm run test, but then it said react not found. Then I did npm i -d, and then reran npm run test. Then it worked. And then I stopped the testApp, and then npm run test worked again.. Not sure what's happening here.. I wrote a README specifically for the test app (in my next branch), explaining all about installing The setup is not ideal at the moment though. Basically the dev dependencies from the
I think you got it right, there is a difference between getRoutingComponent algorithm (which returns the right component directly) and the algorithm for react-router-dom which returns the Route containing a component (which handles the route too but based on query params).
Oh interesting, i didn't think of that. I found it more efficient for development purposes but I you are right.
Question
The code looks good! Thanks for the PR. |
btw, some of the changes you made (Logo, types to emailpassword) I have made in my next branch, so I should have pushed everything to that branch anyway. Now is time to resolve some conflicts 😄 |
Because when you get the string directly, you need to realise that it's up to you to make sure any manipulation of that string should also be normalised. Ideally any checks, manipulation etc.. should be done by the class itself to guarantee that paths / domains are always normalised within the program.
To your PR.
Thanks! |
c3c439a
to
8d5ed19
Compare
I started to have conflicts after squashing my commits into one. |
Changes done in this PR
^
from all import statements. We do not want to risk the functioning of our package on someone else making an error while releasing their code. In reference to Peer dependency versions #14index.ts
,index.js
,index.d.ts
at the root of this project so that importing viasupertokens-auth-react
is possible.index
files used to import from this project. You were exporting just the class, and not the methods.Commit
logoFullURL
from appInfo as per this comment. The tests for this are still there in this commit, but are removed in the next one.EmailPasswordConfig
into its owntypes.ts
inside therecipe/emailpassword
folder, since this type is specific to this recipe.Commit
removePendingSlashFromPath
when we havenormaliseURLPathOrThrowError
NormalisedURLDomain
andNormalisedURLPath
so that we enforce normalisation whenever dealing with paths / domains. I intend to use these on the backend SDK as well.SuperTokensUrl
useNormalisedURLPath
./
and sometimes you didn't. Using this class sorted those issues out.NormalisedURLPath
andNormalisedURLDomain
(except for user input types)mocha
todevDependencies
so that unit tests can be runnpm run build
command was not generating.d.ts
files. I changed thenpm run build
command to make typescript generate.d.ts
files, and make.js
files using babel.npm i -d
inreact-test-app
during project setup. Otherwisenpm run test
doesn't work.features
map to be normalised paths.Commit
appInfo
in the base class of recipes. This is done by converting the function() => RecipeModule
to(appInfo: AppInfo) => RecipeModule
pathWithoutWebsiteBasePath
and its associated function (in the classSuperTokensUrl
)Commit
getInstanceIfDefined
togetInstanceOrThrowError
since it's more accurate.