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
  • !9645
An error occurred while fetching the assigned milestone of the selected merge_request.

Use new JSX transform with React 17

  • Review changes

  • Download
  • Email patches
  • Plain diff
Administrator requested to merge github/fork/iansu/new-jsx-transform into master 4 years ago
  • Overview 13
  • Commits 2
  • Pipelines 0
  • Changes 2

Created by: iansu

Closes #9553 (closed)

Loading
Loading

Activity


  • Administrator requested review from @root 4 years ago

    requested review from @root

  • Administrator requested review from @root 4 years ago

    requested review from @root

  • Administrator requested review from @root 4 years ago

    requested review from @root

  • Administrator added CLA Signed label 4 years ago

    added CLA Signed label

  • Administrator added tag: enhancement label 4 years ago

    added tag: enhancement label

  • Administrator changed milestone to %4.0 4 years ago

    changed milestone to %4.0

  • Administrator
    Administrator @root · 4 years ago
    Author Contributor

    Merged by: iansu at 2020-09-16 17:46:36 UTC

  • Administrator closed 4 years ago

    closed

  • Administrator
    Administrator @root · 4 years ago
    Author Contributor

    Created by: pluma

    At some point between 4.0.0-next.77 and the release after it react-scripts build has started giving me syntax errors in tsx files on TypeScript syntax. Could this be related to this PR?

  • Administrator mentioned in issue #9682 4 years ago

    mentioned in issue #9682

  • Administrator
    Administrator @root · 4 years ago
    Author Contributor

    Created by: radiosilence

    Despite using react scripts next.98, react 17, typescript 4.1, having EXTEND_ESLINT=1 in my .env, and this in my .eslintrc:

        "react/jsx-uses-react": 0,
        "react/react-in-jsx-scope": 0,

    I am still getting:

    Line 5:5: 'React' must be in scope when using JSX react/react-in-jsx-scope

    Am I missing something?

    Edit: I had to upgrade @typescript-eslint/parser to 4.2! Leaving this up for anyone else who had a problem

    Edit 2: Wait no, still seems flakey.

    Edit 3: EXTEND_ESLINT=true needed to be true not 1. :face_palm:‍♀️

    Edit 4: Oh wait, no, it's broken again.

  • Administrator
    Administrator @root · 4 years ago
    Author Contributor

    Created by: mrmckeb

    This should be fixed properly with http://metis.lti.cs.cmu.edu:8023/facebook/create-react-app/-/merge_requests/9683 @radiosilence :) Sorry for the inconvenience.

    @iansu also found a Jest issue that we're investigating, but we aim to ship v4 with this fully working.

  • Administrator
    Administrator @root · 4 years ago
    Author Contributor

    Created by: pluma

    @mrmckeb FWIW my problem was different: ESLint would seemingly treat TSX files as JSX rather than TypeScript and complain about TypeScript syntax and keywords existing in my TSX files. I'm not sure if there are any tests for TS compatibility in react-scripts?

  • Administrator
    Administrator @root · 4 years ago
    Author Contributor

    Created by: mrmckeb

    @pluma that's likely to be an ESLint issue... do you have a custom ESLint config?

  • Administrator
    Administrator @root · 4 years ago
    Author Contributor

    Created by: pluma

    @mrmckeb nope, just a tsconfig.json. I had problems getting custom ESLint configs to work with CRA before, so I don't use one. Also everything works fine in 4.0.0-next.77 and the current 3.x release.

    AFAICT it doesn't complain about all TS syntax (e.g. it didn't complain about a type definition earlier in the same file) but it did complain about the as keyword and ! suffix, both of which are perfectly valid parts of TS syntax.

  • Administrator
    Administrator @root · 4 years ago
    Author Contributor

    Created by: alexeyraspopov

    Does Jest use a different config for Babel? I was able to update my project to react-scripts@4.0.0-next.98 and react@17.0.0-rc.2. The app works fine, even though I needed to override react/react-in-jsx-scope, but tests failing because of ReferenceError: React is not defined. Shall open a separate issue?

  • Administrator
    Administrator @root · 4 years ago
    Author Contributor

    Created by: mrmckeb

    @alexeyraspopov we're aware if those issue when using the new transform, and you're right - that is the cause. We just need to fix it :thumbsup:

    @iansu from what I can see, the issue is that we tell the Babel config what to do from the Webpack config - which is never used in tests. The fix may be to just move all of the logic to the preset. I can make that change if there are no concerns or objections?

  • Administrator mentioned in issue #9772 (closed) 4 years ago

    mentioned in issue #9772 (closed)

  • Administrator
    Administrator @root · 4 years ago
    Author Contributor

    Created by: gaearon

    http://metis.lti.cs.cmu.edu:8023/facebook/create-react-app/-/issues/9772

  • Administrator mentioned in merge request !9788 (merged) 4 years ago

    mentioned in merge request !9788 (merged)

  • Administrator
    Administrator @root · 4 years ago
    Author Contributor

    Created by: hoo88

    What the fuck is this

    On Fri, Oct 2, 2020, 4:31 AM Brody McKee notifications@github.com wrote:

    @alexeyraspopov https://github.com/alexeyraspopov we're aware if those issue when using the new transform, and you're right - that is the cause. We just need to fix it :thumbsup:

    @iansu https://github.com/iansu from what I can see, the issue is that we tell the Babel config what to do from the Webpack config - which is never used in tests. The fix may be to just move all of the logic to the preset. I can make that change if there are no concerns or objections?

    — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub http://metis.lti.cs.cmu.edu:8023/facebook/create-react-app/-/merge_requests/9645#issuecomment-702598801, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARGDFCHA7KPYSWRYS3S4QVTSIWFX5ANCNFSM4RMQEWYA .

  • Administrator
    Administrator @root · 4 years ago
    Author Contributor

    Created by: pluma

    @ho88 language.

  • Administrator
    Administrator @root · 4 years ago
    Author Contributor

    Created by: max-programming

    I noticed a problem. When I updated react-scripts to 4.0.0-next.98, it gave me an error about serviceWorker that it can't find the file. You can see the error on this address. https://5f8fb5ed83ef4c0008113607--maxtodos.netlify.app/

    Then I switched back to 3.4.x, and imported React everywhere, but then it gave the warnings about not using React. Could you please do something regarding this?

  • Administrator mentioned in merge request !12378 (closed) 3 years ago

    mentioned in merge request !12378 (closed)

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
0
0 participants
Reference:
Source branch: github/fork/iansu/new-jsx-transform

Menu

Explore Projects Groups Snippets