Skip to content
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

Migrate from create-react-app-typescript to official CRA #191

Merged
merged 3 commits into from Dec 11, 2019

Conversation

Glitched
Copy link
Member

@Glitched Glitched commented Dec 9, 2019

Replace create-react-app-typescript with the official create-react-app. Create-react-app-typescript is deprecated and no longer receiving updates in favor of official typescript support.

Inside This PR

  • Replace react-scripts-ts with react-scripts
  • Update code to work with stricter linter

Notes

Moving away is essential for the long term health of the project and I figured I would do it was I was here because I've spent more time fighting with Typescript than most and some of the changes were non-obvious.

I fixed all the breaking errors, but this created a bunch of warnings (where we were doing bad stuff). We should probably get around to fixing all of them at some point, but I think an incremental adoption strategy would work best.

Future work involves moving from the deprecated TSLint to ESLint. Then we should improve our linting for accessibility, code format, and code safety.

Breaking Changes

  • Database schema change (anything that changes Postgres)
  • I updated existing types in /src/components/types/
  • Other change that could cause problems (Detailed in notes)

Checklist:

  • My code follows the code style of this project.
  • My changes requires a change to the documentation.
  • I have updated the documentation accordingly.
  • My PR adds a @ts-ignore
  • I tested affected functionality
  • I resolved any merge conflicts
  • My PR is ready for review

@Glitched Glitched changed the title [WIP] Migrate from create-react-app-typescript to office CRA [WIP] Migrate from create-react-app-typescript to official CRA Dec 9, 2019
@Glitched Glitched changed the title [WIP] Migrate from create-react-app-typescript to official CRA Migrate from create-react-app-typescript to official CRA Dec 9, 2019
Copy link
Contributor

@SamChou19815 SamChou19815 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I left some suggestions that could be done later.

@@ -15,7 +15,7 @@ import ProfessorPeopleView from './pages/ProfessorPeopleView';
import { Analytics } from './includes/Analytics';
import { Loader } from 'semantic-ui-react';
import { userUpload } from '../firebasefunctions';
import { useMyCourseUser } from 'src/firehooks';
import { useMyCourseUser } from '../firehooks';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest CRA can actually support it. You can set the baseUrl in tsconfig. Not push blocking.

Comment on lines 13 to +14
export class Analytics extends React.Component {
props: AnalyticsProps;
props!: AnalyticsProps;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably

export class Analytics extends React.Component<AnalyticsProps> {}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I just did this to get it to compile. If I have time, I'd love to make it a hooks component

@Glitched Glitched merged commit 14f2866 into rms/prof-oh-view Dec 11, 2019
@Glitched Glitched deleted the rms/new-cra branch December 11, 2019 22:05
SamChou19815 added a commit that referenced this pull request Feb 1, 2020
* Refactor ProfOHInfo

* Progress

* More Progress

* Remove unused packages

* Remove unused imports

* Fix comparisons

* I wish moment had types

* Fix broken TA dropdown

* Migrate from create-react-app-typescript to official CRA (#191)

* Migrate to create-react-app

* Fix crashes

* var -> let

* Check in safe API key

This key is designed to be public

Co-authored-by: Ryan Slama <Glitched@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants