Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !9907
An error occurred while fetching the assigned milestone of the selected merge_request.

feat: remove remaining React imports

  • Review changes

  • Download
  • Email patches
  • Plain diff
Nick McCurdy requested to merge github/fork/nickmccurdy/feature/remove-remaining-react-imports into main 4 years ago
  • Overview 10
  • Commits 7
  • Pipelines 0
  • Changes 122

Follows up on #9853 and removes remaining React imports, as React 17 is supported and #9734 has been merged.

Loading
Loading

Activity


  • Nick McCurdy requested review from @root 4 years ago

    requested review from @root

  • Nick McCurdy requested review from @root 4 years ago

    requested review from @root

  • Nick McCurdy requested review from @root 4 years ago

    requested review from @root

  • Nick McCurdy requested review from @root 4 years ago

    requested review from @root

  • Administrator added CLA Signed label 4 years ago

    added CLA Signed label

  • Nick McCurdy
    Nick McCurdy @nickmccurdy · 4 years ago
    Author

    A smoke test has the ESLint error 'React' is not defined react/jsx-no-undef in src/index.tsx. It seems like this is only an issue with TypeScript. Should we disable react/jsx-no-undef with TS like we already do with no-undef?

    https://dev.azure.com/facebook/create-react-app/_build/results?buildId=2072&view=logs&j=2a983690-2011-537a-f1b1-93b016d28b7e&t=6a887007-3b70-5b2f-836b-0f0b425fc73a

  • Administrator
    Administrator @root · 4 years ago
    Contributor

    Created by: MichaelDeBoey

    Shouldn't this be handled automatically by eslint-plugin-react when React 17 is detected? :thinking:

    CC: @yannickcr

  • Administrator
    Administrator @root · 4 years ago
    Contributor

    Created by: yannickcr

    @MichaelDeBoey For eslint-plugsin-react and React 17 you only have to disable the react/jsx-uses-react and react/react-in-jsx-scope rules: https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#eslint

    For this case I'd say the React import should not be removed from here http://metis.lti.cs.cmu.edu:8023/facebook/create-react-app/-/merge_requests/9907/files#diff-64c681ba8886069f7e1af46ff0db7eb161244eb14a4a7c780d83eaae6c126cbf since it is still used for React.StrictMode

  • Administrator
    Administrator @root · 4 years ago
    Contributor

    Created by: n3tr

    The current version of TypeScript (4.0.x) doesn't support the new JSX transform (introducing in 4.1).

    Removing import React from the typescript template might break the app unless the user installs typescript@4.1.0-beta.

    There is code checking the ts version and switch to use new jsx configuration

    • https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js#L148-L158
  • Nick McCurdy
    Nick McCurdy @nickmccurdy · 4 years ago
    Author

    @MichaelDeBoey @yannickcr Is it safe to remove those rules from eslint-config-react-app? It could cause confusion for any external users that still aren't using the new JSX transform, but CRA 4 users should be fine either way.

    @n3tr There is an issue with TS 4.1 beta support in CRA 4 (#9868 (closed)) that makes upgrading tricky anyway, and by the time that fix is published TS 4.1 may already be stable.

  • Nick McCurdy
    Nick McCurdy @nickmccurdy · 4 years ago
    Author

    TypeScript 4.1 is stable and #9868 (closed) has been closed, so this should be ready to merge once the review suggestions are resolved.

  • Administrator
    Administrator @root · 4 years ago
    Contributor

    Created by: stale[bot]

    This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

  • Administrator added stale label 4 years ago

    added stale label

  • Nick McCurdy
    Nick McCurdy @nickmccurdy · 4 years ago
    Author

    I have an unresolved question:

    Is it safe to remove those rules from eslint-config-react-app? It could cause confusion for any external users that still aren't using the new JSX transform, but CRA 4 users should be fine either way.

  • Administrator removed stale label 4 years ago

    removed stale label

  • Administrator mentioned in merge request !10774 (closed) 4 years ago

    mentioned in merge request !10774 (closed)

  • Administrator mentioned in merge request !10299 (closed) 4 years ago

    mentioned in merge request !10299 (closed)

  • Administrator
    Administrator @root · 3 years ago
    Contributor

    Created by: stale[bot]

    This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

  • Administrator added stale label 3 years ago

    added stale label

  • Administrator
    Administrator @root · 3 years ago
    Contributor

    Created by: MichaelDeBoey

    We should still merge this one

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 participant
Administrator
Reference:
Source branch: github/fork/nickmccurdy/feature/remove-remaining-react-imports

Menu

Explore Projects Groups Snippets