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

Chore/update dependencies #346

Merged
merged 12 commits into from
Sep 9, 2021
Merged

Conversation

simenko
Copy link
Contributor

@simenko simenko commented Sep 6, 2021

Types of Changes

Prerequisites

Please make sure you can check the following two boxes:

  • I have read the CONTRIBUTING document
  • My code follows the code style of this project

Contribution Type

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue, please reference the issue id)
  • New feature (non-breaking change which adds functionality, make sure to open an associated issue first)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Styled-components updated from v4 to v5
  • React-datepicker updated from v2 to v4
  • Lots of minor changes everywhere can cause unexpected issues, thorough integration testing is needed.
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Description

This is another attempt to upgrade Precise UI dependencies. Lots of our dependencies including such major ones as Typescript, Webpack, Styleguidist, or React are one or many major versions behind. There were 3 unfinished attempts to update some or all of them during the last year:

This attempt is not based on any of them directly, but I used them for reference. My primary goal was to update Typescript to version 4. Most of the other updates are cascading changes needed to fix issues with the main upgrade. There are still many dependencies that have to be updated, but the PR is already huge. Here are some points I want to highlight:

Text snapshot changes

During the upgrade, I had to update some snapshots. There are 3 main reasons for the changes:

  1. Some components now have meaningful names instead of just (example)
  2. Some CSS selectors are sorted differently (example)
  3. Components are missing additional wrapper with metadata (example)

Some of these changes may potentially cause problems. I ran the visual tests before committing them, and they were OK, so I hope I have not broken anything. I am not an expert in frontend and not closely familiar with Precise UI, so please check the changes thoroughly.

Visual snapshot changes

I have updated Puppeteer and Chromium. There was a bunch of broken snapshots but the difference mostly was not noticeable visually. I guess it was caused by the rendering engine changes in Chromium.

I have attached the visual diff files for your convenience. Please take a look, as some of the changes were more significant, like the ones in StackPanel_3-diff.png, TagBuilder_15-diff.png, and Flyout_11-diff.png

Bundle size

The bundle size has increased from 650 to 726 Kb. I did not try to do anything with it as I am not an expert in this field and optimizing the bundle was not my primary goal. Maybe there is a way to decrease it, but I am not capable of doing it myself.

There is still lots of work to do, including updates of Jest, Webpack, some other packages, but I believe we should move forward with smaller steps, so I have stopped here.

The tests with context were failing with the error: "Invariant
Violation: Hooks can only be called inside the body of a function
component".

The root cause is somwhere between styled-components v5+ which started
using React hooks and enzyme renderer. The cleanest workaround I have
found is enzymejs/enzyme#2176 (comment)
@CLAassistant
Copy link

CLAassistant commented Sep 6, 2021

CLA assistant check
All committers have signed the CLA.

@boromo boromo merged commit 1c53fcf into ZEISS:main Sep 9, 2021
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.

3 participants