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

build(js): upgrade babel and webpack toolchains #4959

Merged
merged 5 commits into from
Feb 21, 2020
Merged

Conversation

mcous
Copy link
Contributor

@mcous mcous commented Feb 10, 2020

overview

This PR upgrades the following portions of our JS build:

  • Babel
    • Now with nullish coalescing!
    • Now with support for explicit inexact Flow objects ({ ... })
  • Webpack
    • Felt like a thing to do
    • Webpack v5 is currently in beta, so want to make sure we're up to date on v4 to minimize future upgrade pain
  • React Hot Loader
    • Now with hooks support
  • Jest
    • Because babel was upgraded

review requests

Smoke tests require for all front end apps:

  • Protocol designer
  • App
  • Labware Library
  • Protocol Library Kludge (deckmap)

@mcous mcous requested review from a team, Kadee80, IanLondon, iansolano and amitlissack and removed request for a team February 10, 2020 19:56
@mcous mcous added chore WIP JS Tech Debt DO NOT MERGE Indicates a PR should not be merged, even if there's a shiny green merge button available labels Feb 10, 2020
labware-library/package.json Outdated Show resolved Hide resolved
"react-router-dom": "^5.0.1",
"yup": "^0.27.0"
},
"devDependencies": {
"react-snap": "^1.23.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All devDependencies go in monorepo package.json, where this entry already exists

"ajv": "^6.10.2",
"aws-sdk": "^2.493.0",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-eslint": "^11.0.0-beta.2",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Beta release required for flow inexact object syntax; keep an eye on this

Copy link
Member

Choose a reason for hiding this comment

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

That's annoying — let's def keep an eye out

package.json Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Feb 10, 2020

Codecov Report

Merging #4959 into edge will decrease coverage by 0.05%.
The diff coverage is 26.38%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge    #4959      +/-   ##
==========================================
- Coverage   68.74%   68.69%   -0.06%     
==========================================
  Files        1076     1076              
  Lines       35871    35916      +45     
==========================================
+ Hits        24660    24672      +12     
- Misses      11211    11244      +33
Impacted Files Coverage Δ
app/src/robot/reducer/index.js 100% <ø> (ø) ⬆️
...mponents/AppSettings/UpdateApp/UpdateAppMessage.js 0% <ø> (ø) ⬆️
...p/src/components/AppSettings/AddManualIp/IpItem.js 0% <ø> (ø) ⬆️
app/src/logger.js 0% <ø> (ø) ⬆️
...p/src/components/TipProbe/InstrumentMovingPanel.js 0% <ø> (ø) ⬆️
discovery-client/src/mdns-browser.js 33.33% <ø> (ø) ⬆️
app/src/components/MenuPanel/index.js 0% <ø> (ø) ⬆️
app/src/components/FileInfo/MissingItemWarning.js 0% <ø> (ø) ⬆️
app/src/discovery/reducer.js 100% <ø> (ø) ⬆️
app/src/components/nav-bar/index.js 0% <ø> (ø) ⬆️
... and 179 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e7fa264...95ae8c2. Read the comment docs.

@mcous mcous removed the DO NOT MERGE Indicates a PR should not be merged, even if there's a shiny green merge button available label Feb 11, 2020
@mcous mcous marked this pull request as ready for review February 18, 2020 18:52
@mcous mcous requested review from a team as code owners February 18, 2020 18:52
@mcous mcous added this to the CPX Sprint 3 milestone Feb 18, 2020
@mcous mcous added DO NOT MERGE Indicates a PR should not be merged, even if there's a shiny green merge button available and removed DO NOT MERGE Indicates a PR should not be merged, even if there's a shiny green merge button available ready for review labels Feb 19, 2020
Copy link
Contributor

@iansolano iansolano left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@shlokamin shlokamin left a comment

Choose a reason for hiding this comment

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

Not sure what's going on with the image source tags in PD, but they're being resolved to src="[object Module]" which is causing this:

Screen Shot 2020-02-20 at 10 30 28 AM

Screen Shot 2020-02-20 at 10 30 48 AM

Any idea why this might be?

"react-dom": "^16.8.6",
"react-hot-loader": "^3.0.0-beta.7",
"react": "16.8.6",
"react-dom": "16.8.6",
Copy link
Member

Choose a reason for hiding this comment

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

Just curious — why is it that we were previously using semantic versioning for react and not we're not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Judgement call and a safety thing:

  • In order for hooks support of react-hot-loader, we have to swap out react-dom with @hot-loader/react-dom
  • The version of @hot-loader/react-dom needs to match react-dom
  • We're already locking our dependencies implicitly via the lock file, so locking them down explicitly here felt like the safest thing to do

Longer term, I think we should probably lock all of our production dependencies explicitely (I'm generally good keeping dev deps on semver). That being said, I'd rather not mess with all our app deps in this PR

@@ -17,7 +17,7 @@
"peerDependencies": {
"classnames": "^2.2.5",
"lodash": "^4.17.4",
"react": "^16.8.6",
"react": "16.8.6",
"react-router-dom": "^5.0.1"
Copy link
Member

Choose a reason for hiding this comment

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

Same question about semantic versioning here

Copy link
Contributor

@IanLondon IanLondon left a comment

Choose a reason for hiding this comment

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

On top of what Shlok said: animations for Transfer step paths (popover on Path field buttons) also broken, probably other images as well. There's a lot of requires for images in PD...

Hot reloading seems to work the same as before. PD has an issue with React-DnD not playing well with hot reloads so if you're hot reloading on the "DESIGN" tab, you only get one hot reload before it crashes, that's the same as on edge and obvs out of scope of this PR.

--

Besides PD, I tested protocol-library-kludge -- all good there!

@mcous mcous requested review from IanLondon and shlokamin February 20, 2020 17:33
@mcous
Copy link
Contributor Author

mcous commented Feb 20, 2020

Sorry about the image thing, forgot to read the changelog of file-loader after bumping it from v4 to v5. Pushed the short-term fix to the webpack config with the longer-term fix in a TODO comment

Copy link
Member

@shlokamin shlokamin left a comment

Choose a reason for hiding this comment

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

LGTM — image tags + animations seem to be working now!

Copy link
Contributor

@IanLondon IanLondon left a comment

Choose a reason for hiding this comment

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

LL, LC, and PD looking good image-wise

@mcous mcous merged commit ec0645a into edge Feb 21, 2020
@mcous mcous deleted the chore_upgrade-js-tools branch February 21, 2020 18:11
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.

4 participants