-
Notifications
You must be signed in to change notification settings - Fork 1k
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
TypeScript strict mode support + docs #5491
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ctmode-gen * 'main' of github.com:redwoodjs/redwood: Update yarn.lock fix(deps): update graphql-tools monorepo (redwoodjs#5487) v1.3.2 Update yarn.lock fix: Run dedupe during upgrade on yarn 3 (redwoodjs#5458) Fix/ts resolvers type (redwoodjs#5437) fix(deps): update dependency graphql to v16.5.0 (redwoodjs#5488) fixed typo of roll to role (redwoodjs#5484) fix(deps): update typescript-eslint monorepo to v5.23.0 (redwoodjs#5489) chore(deps): update dependency cypress to v9.6.1 (redwoodjs#5482) chore(deps): update dependency firebase to v9.8.1 (redwoodjs#5485) fix(deps): update dependency @types/aws-lambda to v8.10.97 (redwoodjs#5486) chore(deps): update dependency @nhost/nhost-js to v1.1.10 (redwoodjs#5479) chore(deps): update dependency @nhost/hasura-auth-js to v1.1.5 (redwoodjs#5478) Fixing type for BrowserOnly children (redwoodjs#5475) fix: Run dedupe during upgrade on yarn 3 (redwoodjs#5458) Fix/ts resolvers type (redwoodjs#5437)
✅ Deploy Preview for redwoodjs-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Closed
Closed
…ctmode-gen * 'main' of github.com:redwoodjs/redwood: (91 commits) Add example usage of useRegister and useErrorStyles (redwoodjs#5692) chore(deps): update dependency @envelop/testing to v4.3.3 (redwoodjs#5690) Update contributing docs (redwoodjs#5685) Fix typos in docs (redwoodjs#5694) Fix typo in ArticleCell code snippet of Tutorial 2 docs (redwoodjs#5695) fix(deps): update dependency core-js to v3.22.8 (redwoodjs#5683) fix(deps): update dependency webpack-dev-server to v4.9.1 (redwoodjs#5684) Fix typo (redwoodjs#5686) Add warning box for missing roles in authorization doc (redwoodjs#5611) Fix dbAuth on AWS Lambda (redwoodjs#5474) fix(deps): update dependency @types/jest to v27.5.2 (redwoodjs#5681) fix(deps): update dependency vscode-languageserver-textdocument to v1.0.5 (redwoodjs#5679) chore(deps): update dependency @nhost/hasura-auth-js to v1.1.12 (redwoodjs#5677) fix(deps): update dependency systeminformation to v5.11.16 (redwoodjs#5676) fix(deps): update dependency @types/node to v16.11.38 (redwoodjs#5674) fix(deps): update dependency @apollo/client to v3.6.6 (redwoodjs#5671) chore(deps): update dependency @nhost/hasura-auth-js to v1.1.11 (redwoodjs#5669) fix(deps): update dependency react-hook-form to v7.31.3 (redwoodjs#5666) chore(deps): update dependency firebase to v9.8.2 (redwoodjs#5665) docs: Details for TS generics when mocking queries (redwoodjs#5645) ...
dthyresson
reviewed
Jun 7, 2022
packages/cli/src/commands/generate/cell/__tests__/__snapshots__/cell.test.js.snap
Show resolved
Hide resolved
jtoar
approved these changes
Jul 23, 2022
…ctmode-gen * 'main' of github.com:redwoodjs/redwood: (chore): Fix rebuild fixture (redwoodjs#6033)
1 task
Philzen
added a commit
to Philzen/redwood
that referenced
this pull request
Aug 8, 2022
…ord page Adds to / completes redwoodjs#5491
Philzen
added a commit
to Philzen/redwood
that referenced
this pull request
Aug 8, 2022
…ord page Adds to / completes redwoodjs#5491
Philzen
added a commit
to Philzen/redwood
that referenced
this pull request
Aug 9, 2022
…ord page Adds to / completes redwoodjs#5491
Philzen
added a commit
to Philzen/redwood
that referenced
this pull request
Aug 9, 2022
…ord page Adds to / completes redwoodjs#5491
Philzen
added a commit
to Philzen/redwood
that referenced
this pull request
Aug 10, 2022
…ord page Adds to / completes redwoodjs#5491
Philzen
added a commit
to Philzen/redwood
that referenced
this pull request
Aug 10, 2022
…ord page Adds to / completes redwoodjs#5491
Philzen
added a commit
to Philzen/redwood
that referenced
this pull request
Aug 10, 2022
…ord page Adds to / completes redwoodjs#5491
1 task
Tobbe
added a commit
that referenced
this pull request
Apr 27, 2023
…6061) * Exclude unused variable `userAttributes` from ESLint checks * Add all dependencies to dependency array of effect hook which validates the token * Fix typescript strict mode warning (implicit type any) on reset password page Adds to / completes #5491 * Update test fixture * Ensure all eslint `no-used-vars` ignores are compatible with JS Adds to / completes 3fe7dca * Update test snapshots * Update test fixture --------- Co-authored-by: Tobbe Lundberg <[email protected]> Co-authored-by: David Price <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
If you turn on TypeScript strict mode, (modify tsconfig.json)
{ "compilerOptions": { "noEmit": true, "allowJs": true, + "strict": true,
Redwood projects currently have a bunch of errors, with no clear path to a solution.
This PR is a combination of documentation, exporting and adding more types so that users opting-in to strict mode can have an error free project. Note that we are not enabling strict mode by default.
Changes in this PR
Generate stricter Resolver definitions in strict mode
src/lib/auth.ts
Add types for getCurrentUser for non-dbAuth- this really is too hairydbAuth
DbAuthOptions
andDbAuthSession
available for users to import in their project.Add a line to setup auth dbAuth output on "using dbAuth with TS"generator output is already too verboseRelation resolvers
When you have a model with a relation, and you generate the sdl or service with the
--crud
flag, relational resolvers are generated.gqlArgs
.Reasoning:
a) Although these are resolvers, they can be used outside the graphql context - where gqlArgs aren't passed.
b) The alternative is to ask users to modify all their service tests. Its ugly and confusing and unnecessary.
Prisma vs Graphql null types
dnull
in this sectionAvoid optional resolvers types
This is a codegen config change (see graphqlCodegen.ts)
Improve return type of Scenarios
ScenarioData
type that lets you define exactly what the output of a scenario isService tests with chained calls
Prisma
findUnique
return types❌ No solution, just have to document
Closes #5481
Closes #5463
Closes #5261