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.
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
Upgrade typescript to ^4.2.0 and fix lint issues #1156
Upgrade typescript to ^4.2.0 and fix lint issues #1156
Changes from 16 commits
77f84d2
910476d
13ab6ad
03c181a
be76f0b
6630820
fd5550d
004d7c7
d38ceab
9d12d67
e2042d9
5b77f29
3fb7cb7
947941c
fab6a17
4521533
118f7b8
3f38210
86e5457
b58f604
789ea7f
d85a8fd
4d1fcc2
eed4309
797c68f
d8ea5e4
5be0e06
b82a166
814fc2b
9efe6bb
5a86df1
2c584be
9f15760
6942aa2
598605c
6464dba
a3fd8df
a74703b
8499773
e461755
f055aea
2e23eb9
d31dc68
497bcec
5c58dcd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
i feel like some of these workbox plugins aren't used, are they?
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.
Indeed it seems like this. I've copied all of them from the template created with
yarn create react-app my-app --template cra-template-pwa-typescript
and they are not used there eitherI've removed them for now and we can check if they work
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.
After removing them service worker is not being registered. I'll revert this change
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.
Oh, it is actually not working after reverting. I think it may be related to the change about PUBLIC_URL:
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.
I've ended up changing the
if
statement toif (process.env.PUBLIC_URL === undefined) {
and removed these workbox pluginsBtw.
process.env.PUBLIC_URL
is set to an empty string onrex-web.herokuapp.com
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.
I've moved it to
src/service-worker.ts
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.
Why did you make this change?
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.
react-hooks/exhaustive-deps
error in useEffect belowThere 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.
why is the any needed for this?
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.
It is because
animationEvent
is returningCustomEvent
instead ofEvent
. I'll update the function instead usingany
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.
why is this necessary?
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.
I guess this didn't change recently but now it is an error so it should be okay to just use
any
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.
you could cast to
Location
instead, maybeLocation<undefined>
, or combine it with{state: {}}
if state is requiredThere 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.
I'll change it to
new URL('https://localhost') as any as State
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.
if url legitimately doesn't have a field that state requires, it would probably be better to add that field by doing
or whatever
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.
same deal with the location/url situation
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.
It's a fix for
The operand of a 'delete' operator must be optional.
. Is it something we want to intentionally ignore?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.
I think so
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.
how is it possible that these values would be null?
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.
it more about ts not being able to recognize that we are exporting
routes
from each of these routes so when we want to use it it throws:I've used
assertNonNullableArray
name because I've also usedNonNullable
forexport type AnyRoute = NonNullable<typeof routes[number]>;
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.
what is actually causing that undefined to be in the type? is it one of the modules in particular that has it?
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.
it is because of
: /* istanbul ignore next */ {}
inif I change it to:
or to:
then it works, so I guess this is a typescript problem
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.
is it because of the ternary? that is very odd
it would be safe to cast the ternary result to
typeof developer.routes
if that helpsThere 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.
this isn't necessary anymore right?