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

[Frontend] Remove react imports in agency dashboard #111

Merged
merged 2 commits into from
Oct 31, 2022

Conversation

terryttsai
Copy link
Contributor

@terryttsai terryttsai commented Oct 24, 2022

Description of the change

As of React 17, there's no need to import React in every tsx file. See https://www.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#eslint

Will follow this up with removing React imports in Publisher and common, might have to update something or change a config to support that!

Type of change

All pull requests must have at least one of the following labels applied (otherwise the PR will fail):

Label Description
Type: Bug non-breaking change that fixes an issue
Type: Feature non-breaking change that adds functionality
Type: Breaking Change fix or feature that would cause existing functionality to not work as expected
Type: Non-breaking refactor change addresses some tech debt item or prepares for a later change, but does not change functionality
Type: Configuration Change adjusts configuration to achieve some end related to functionality, development, performance, or security
Type: Dependency Upgrade upgrades a project dependency - these changes are not included in release notes

Related issues

Closes #XXXX

Checklists

Development

This box MUST be checked by the submitter prior to merging:

  • Double- and triple-checked that there is no Personally Identifiable Information (PII) being mistakenly added in this pull request

These boxes should be checked by the submitter prior to merging:

  • Tests have been written to cover the code changed/added as part of this pull request

Code review

These boxes should be checked by reviewers prior to merging:

  • This pull request has a descriptive title and information useful to a reviewer
  • This pull request has been moved out of a Draft state, has no "Work In Progress" label, and has assigned reviewers
  • Potential security implications or infrastructural changes have been considered, if relevant

@mxosman
Copy link
Contributor

mxosman commented Oct 25, 2022

You can leave publisher for me if you want - I don't mind cleaning that up after the settings feature.

@@ -3,5 +3,7 @@ module.exports = {
plugins: ["header"],
rules: {
"header/header": [2, "../license-header.js"],
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just set once here, right? No need to update publisher's eslintrc or will we have to do that as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both apps read off the same eslintrc!

@@ -18,7 +18,7 @@
"web-vitals": "^2.1.4"
},
"scripts": {
"dev": "react-app-rewired start",
"dev": "PORT=3001 react-app-rewired start",
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh cool - didn't know you could set a port in a start script like that!

@lilidworkin
Copy link
Collaborator

Cool! Curious, what's the benefit of this? Performance improvement?

@mxosman I think it's okay for you to leave the Publisher parts to @terryttsai as well, though thanks for offering! You have enough on your plate with playtesting and the refactor after :)

@terryttsai terryttsai force-pushed the terry/remove-react-import-requirement branch from ed1c219 to bcc12b9 Compare October 27, 2022 23:52
@lilidworkin
Copy link
Collaborator

@terryttsai what's the status of this PR?

@terryttsai
Copy link
Contributor Author

Should be good to go for agency-dashboard, so maybe I can get this PR merged in for now? I ran into lint errors trying to remove React imports in the publisher app and hadn't had the chance to figure out the issue

@terryttsai terryttsai marked this pull request as ready for review October 31, 2022 21:14
@terryttsai terryttsai changed the title [Frontend] Remove react imports [Frontend] Remove react imports in agency dashboard Oct 31, 2022
@terryttsai terryttsai requested a review from mxosman October 31, 2022 21:15
@terryttsai terryttsai merged commit 861c95a into main Oct 31, 2022
@terryttsai terryttsai deleted the terry/remove-react-import-requirement branch October 31, 2022 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants