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

feat: update react-scripts #721

Merged
merged 6 commits into from
Jun 21, 2022
Merged

feat: update react-scripts #721

merged 6 commits into from
Jun 21, 2022

Conversation

ismay
Copy link
Member

@ismay ismay commented Jun 20, 2022

See: https://dhis2.atlassian.net/browse/CLI-73.

After the upgrade I was running into this issue: facebook/create-react-app#12177. I've rebuilt the lockfile, that has addressed it. It does mean that everything has been updated to latest though (within the package.json version ranges). If all updated packages properly followed semver that should be fine, but we should double check to make sure. There might also be less drastic ways of addressing the issue.

I've disabled the import extensions rule for now. Besides that I've clarified the logic in the shell eslint config to what made it a little easier to read for me. In that config I also removed the react plugin for the local linting, because that plugin is already present in the cli style config, which caused eslint to fail with a warning.

Changelog for the move from 4 to 5: https://github.com/facebook/create-react-app/blob/main/CHANGELOG.md#500-2021-12-14

@ismay ismay marked this pull request as ready for review June 20, 2022 13:30
@ismay ismay requested review from a team, amcgee and jenniferarnesen June 20, 2022 13:31
Copy link
Contributor

@Mohammer5 Mohammer5 left a comment

Choose a reason for hiding this comment

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

I've disabled the import extensions rule for now

What was the reason for this?

shell/.eslintrc.js Show resolved Hide resolved
const isDevelopment = !isRunningHere && hasRootConfig

// Use local config for developing this library, react-app preset for linting app code
const extendsList = isDevelopment ? rootConfigPath : 'react-app'
Copy link
Contributor

Choose a reason for hiding this comment

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

This was called extendsList before, but it could be a string, too. So mabye just rename it to extends? Then it matches the exported value's name

Copy link
Member Author

@ismay ismay Jun 20, 2022

Choose a reason for hiding this comment

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

That would be cleaner yeah, but it's a reserved word. So I kept the original name. We could rename it to something else though. Or just put the ternary in the exported object directly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, makes sense that it's a reserved word. How about:

module.exports = {
  // Use local config for developing this library, react-app preset for linting app code
  ignorePatterns: isDevelopment ? [] : ['src/D2App/*'],
  // Use local config for developing this library, react-app preset for linting app code
  extends: isDevelopment ? rootConfigPath : 'react-app',
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah that looks simpler, changed it in 86bd3f9.

@ismay
Copy link
Member Author

ismay commented Jun 20, 2022

I've disabled the import extensions rule for now

What was the reason for this?

For speed. It would be a lot of work to address this. I could, but I'd have to postpone a couple other tasks (again).

Copy link
Contributor

@Mohammer5 Mohammer5 left a comment

Choose a reason for hiding this comment

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

For speed. It would be a lot of work to address this. I could, but I'd have to postpone a couple other tasks (again).

I don't think I'm the right person to judge whether this is the right call or not. I'll approve, is there a way to address adding back the plugin? And if not, how do we document this / prioritize this?

@ismay
Copy link
Member Author

ismay commented Jun 20, 2022

For speed. It would be a lot of work to address this. I could, but I'd have to postpone a couple other tasks (again).

I don't think I'm the right person to judge whether this is the right call or not. I'll approve, is there a way to address adding back the plugin? And if not, how do we document this / prioritize this?

I think there's a misunderstanding. So the plugin I removed (eslint react preset) was removed because it was duplicated. Effectively it's still there, just not twice like before. So we don't have to add that back.

The import rule is just disabled. Eventually it should be enabled and the violations should be addressed. Currently it doesn't really affect anything though. The import extensions rule is there for compliance with the es module spec that does not allow omitting the extension. This is not currently a thing for our tooling.

Comment on lines +8 to +10
rules: {
'import/extensions': 'off',
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Was wondering why we need that. Typescript?

Copy link
Member Author

Choose a reason for hiding this comment

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

#721 (comment)

I can take care of it after we've dealt with the functional part of these changes. Having it not block these changes makes it a little easier for me to integrate it with other tasks.

Copy link
Contributor

@HendrikThePendric HendrikThePendric left a comment

Choose a reason for hiding this comment

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

LGTM. Releasing a beta first and seems sensible. Could you also capture the follow-up work reg. the linting in a separate issue? (And post a link to this issue in this PR)

@ismay ismay changed the base branch from master to beta June 21, 2022 13:28
@ismay ismay merged commit dc1c5cb into beta Jun 21, 2022
@ismay ismay deleted the update-react-scripts branch June 21, 2022 13:41
dhis2-bot added a commit that referenced this pull request Jun 21, 2022
# [9.1.0-beta.1](v9.0.2-beta.1...v9.1.0-beta.1) (2022-06-21)

### Features

* update react-scripts ([#721](#721)) ([dc1c5cb](dc1c5cb))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 9.1.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ismay
Copy link
Member Author

ismay commented Jun 22, 2022

dhis2-bot added a commit that referenced this pull request Jul 26, 2022
# [10.0.0](v9.0.1...v10.0.0) (2022-07-26)

### Bug Fixes

* remove engines field from pwa and adapter ([c3878f2](c3878f2))
* remove lint step from publish step requirements ([#695](#695)) ([a04f8f7](a04f8f7))

### chore

* drop support for node 12 ([937e5e2](937e5e2))

### Features

* update react-scripts ([#721](#721)) ([dc1c5cb](dc1c5cb))

### BREAKING CHANGES

* dropped support for node 12. The platform now requires node 14+.
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 10.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

5 participants