-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Support strict type checking #177
Support strict type checking #177
Conversation
Also, regarding the "nasty hackery" in the client-side tests: Jest supports a jsdom environment, which we could use to get a real window object without hacking. Only requirement: Server and client tests have to be in separate files, since the Jest environment can only be set on a per-file basis. What do you think? |
Another unrelated (and rather unimportant) thing I noticed: ESLint seems to ignore the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good job! The only issue is the props part.
Technically since the repo is managed by ESLint, not prettier, you should not run any pure prettier plugins. I'm pushing a fix to make eslint to use prettier config more explicitly. Looks like something changed over time. |
No objections. I'm pushing this now too. You will have to rebase your fork due to conflict. |
Thanks to @jest-environment doc annotations; fixes coverage reports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good job, thank you. Please rebase your fork since there are changes in fix-ts-typings
that you are re-implementing.
Also I think we need to update readme with TS-friendly examples. We can do it in separate PR though.
I will release a new major version once we're done here.
Ok, I will create a separate readme PR after this, also tackling #170. Thanks for your time! |
... to ReduxWrapperAppProps. Also: * Remove legacy `AppProps` and `OriginalAppProps` alias * Base `ReduxWrapperAppProps` directly on Next.js `AppProps`
Merged. Thank you for your contribution. I will polish things here and there and release a new version soon. And separate kudos for answering questions in issues. |
You're welcome! |
Fix #165 * TypeScript NextPageContext augmentation * Fixed prettier * JSDom tests in separate file * Support strict type checking (#177) * use strict type checking * fix redux-related type annotations in demo * Use single jest config * Thanks to @jest-environment doc annotations; fixes coverage reports * add ReduxWrappedAppProps interface * Rename ReduxWrappedAppProps to ReduxWrapperAppProps * Remove legacy `AppProps` and `OriginalAppProps` alias * Base `ReduxWrapperAppProps` directly on Next.js `AppProps` * Remove deprecated Container from example _app Co-authored-by: bjoluc <mail@bjoluc.de>
* Add motivation section (#170) * Add TypeScript examples (#176, #177) * Make installation code blocks expandable * Migrate connected Page components to functional components * Group tips and examples in a Tips and Tricks section * Some grammar & style improvements * Remove outdated typings reference in Resources section
I transitioned the whole project to
strict
type checking includingnoImplicitAny
, which made me aware of a problem: TheWrappedApp
's constructor didn't pass thectx
toinitStore
. In fact,ctx
was declared optional forinitStore
, but required by theMakeStoreOptions
definition. This is now fixed.Other notable changes:
app.tsx
to drop the deprecatedNextJSAppProps
@types/react-test-renderer
dev dependency