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

Upgrade react-scripts to latest version (2.1.3) #99

Merged
merged 16 commits into from
Feb 11, 2019
Merged

Conversation

toolness
Copy link
Contributor

@toolness toolness commented Feb 7, 2019

Note: This is a PR against #95, not master! I will re-target it to master once #95 is merged.

This is an attempt to upgrade react-scripts to the latest version--partially just to stay up-to-date, but also because 2.1.0 and higher support Typescript out of the box, which could be useful in sharing code between this app and the tenants app, specifically for #53.

To do

  • Upgrade from 1.0.10 to 2.0.3.
  • Upgrade from 2.0.3 to the latest 2.x release.
  • Fix all new linter warnings.
  • Ensure that at least Node 8 is used in production and on @sraby's dev machine, as 2.x drops support for node 6. Update: see Specify node version in package.json #100 for more details.
  • Add polyfills for IE11 at the very least, since IE polyfills are no longer included by default in 2.x. Then verify that the app still works on IE11.
  • Verify that the app doesn't use require.ensure() (also a breaking change in 2).
  • Ensure dynamic import() follows new semantics in 2 (not an issue, we don't use dynamic import)
  • Ensure testing suite still works (Jest's default environment was changed to jsdom in 2 but we don't have any tests in it yet).
  • Ensure the proxy configuration still works (another breaking change in 2).
  • Ensure we don't use PropTypes in weird ways (another breaking change in 2).

@sraby
Copy link
Member

sraby commented Feb 7, 2019

@toolness I'm currently using node v8.9.1 on my dev machine :)

@toolness toolness changed the base branch from fix-linter-warnings to master February 7, 2019 19:45
@toolness toolness changed the title [WIP] Upgrade react-scripts to latest version Upgrade react-scripts to latest version (2.1.3) Feb 8, 2019
@toolness
Copy link
Contributor Author

toolness commented Feb 8, 2019

@sraby Ok I think this is good to go! I kicked the tires on IE11, Edge, Chrome, Firefox, and iPhone Safari.

@toolness
Copy link
Contributor Author

toolness commented Feb 8, 2019

Er, actually hold on a sec @sraby... @romeboards is investigating whether the current WoW supports IE9 and IE10. If it does, then I will have to add the react polyfill thing for it (and we will have to test those browsers going forward, which is hard even for me on Windows b/c I only have IE11 here, so I guess I will have to use BrowserStack).

@toolness
Copy link
Contributor Author

toolness commented Feb 8, 2019

Ok, Dan says we're only supporting IE11 so I think this is indeed good to go.

@sraby sraby merged commit 32b1bcd into master Feb 11, 2019
@sraby sraby deleted the upgrade-react-scriptrs branch February 11, 2019 17:17
toolness added a commit that referenced this pull request Jul 24, 2020
Looking at Rollbar errors for the latest front-end version made me realize that there were arrow functions in our JS bundles.  Upon further inspection, I realized our `browserslist` specifies `not ie <= 11`, yet our `index.js` imports both `react-app-polyfill/ie11` and `babel-polyfill`.  These contradictory lines were actually all introduced in the same PR, #99, which is very odd.

I think the reason we might not have seen this strange behavior when writing that PR is because apparently [changing `browserslist` requires deleting `node_modules/.cache`][1].  So it's possible that during development, we never truly saw the results of our actions!  (Needless to say, I spent a lot of time in confusion after making this PR's simple code change, until I discovered the root cause.)

This means that even Netlify won't reflect changes to `browserslist` by default (it caches all of `node_modules` between builds), so I've modified its configuration to clear `node_modules/.cache` before building the site too.

[1]: facebook/create-react-app#8197 (comment)
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.

2 participants