Update reader conversations tests to typeScript#101915
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
|
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
mehmoodak
left a comment
There was a problem hiding this comment.
Thanks for refactoring the code to TypeScript.
| } from 'calypso/state/reader/conversations/actions'; | ||
| import { CONVERSATION_FOLLOW_STATUS } from 'calypso/state/reader/conversations/follow-status'; | ||
|
|
||
| type Dispatch = jest.Mock< any, any >; |
There was a problem hiding this comment.
Can we use this from
import { Dispatch } from 'redux';
There was a problem hiding this comment.
That wouldn't be a mock function would it? That would just be the standard redux dispatch?
There was a problem hiding this comment.
You're right. VSCode doesn't give any error to me when I used it, maybe it was waiting on Intellisense.
There was a problem hiding this comment.
Yeah, I feel like the more we use TS here the slower intellisense becomes. 😢
There was a problem hiding this comment.
Looking forward to TS go-compiler with 10x improvement 🤞
There was a problem hiding this comment.
That would be awesome.
| import { CONVERSATION_FOLLOW_STATUS } from 'calypso/state/reader/conversations/follow-status'; | ||
|
|
||
| type Dispatch = jest.Mock< any, any >; | ||
| type GetState = () => Record< string, unknown >; |
There was a problem hiding this comment.
Better if we can add an interface for the state. Not a blocker.
|
This was WSOD'ing the reader due to the init file not properly initializing the reader store after being converted to typescript. I tried a couple things that I thought would resolve the issue but I keep running into errors. Im going to leave init.js the way it is. It doesn't seem very beneficial to change to typescript anyways. |
Related to # #101792 - in reviewing this @mehmoodak noted the opportunity to convert a couple of these files to typescript.
Proposed Changes
Updates a couple reader files to typescript.
Why are these changes being made?
Testing Instructions
Pre-merge Checklist