-
Notifications
You must be signed in to change notification settings - Fork 51
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 typescript to 4.9.5 and jest to 29.7.0 (and related packages) #1884
Upgrade typescript to 4.9.5 and jest to 29.7.0 (and related packages) #1884
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! I'm actually blocked on getting TypeScript updated for my existing PR, so getting this in would be great.
src/Explorer/Notebook/NotebookComponent/NotebookComponentBootstrapper.tsx
Show resolved
Hide resolved
I'm not sure why the "self serve" Playwright test failed, it only seems to have failed in webkit and seems like it might be a transient issue. I wonder if this test is worth keeping? |
The issue seems to be persisting: the dropdown doesn't seem to open after a click according to the test snapshot. The error message displayed by playwright seems to suggest that there's a |
This seems reasonable to me. Not something we should get used to doing, but this seems like a fairly clear edge-case and I'd rather disable the test than have it continue to cause problems. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Would love to get this in as soon as we can (after RBAC stuff lands and is stable), to unblock some other work.
I also really appreciate the detailed justification for the skipped test 👍🏻 👍🏻
Preview this branch
This change is driven by the upgrade of
@fluentui/react-components
to9.54.2
which wouldn't compile anymore with our current version of typescript (4.3.5
). For reference, the error was a new syntax for defining atype
within anexport
on one of fluent UI dependent package: an easy fix would have been to patch that file, but I felt that upgrading typescript was eventually inevitable. I picked the highest version of typescript 4, avoiding more work probably required for an upgrade to typescript 5 and also because fluent UI appears to be using4.9.5
.Changes related to typescript upgrade from
4.3.5
to4.9.5
(most of the upgrades were required to compile)@phosphor/virtualdom
(used by notebooks) does not compile anymore and isn't actively maintained:MediaStreamErrorEvent
has been removed in typescript4.4
. Added a patch to useEvent
instead.react-i18next
which doesn't support thewait
config option anymore since v8.3.3. See warning in code and release notes.typedoc
The typescript upgrade requires upgrading jest (I took the latest version)
html-loader
to latestroot
option to specify where/image_filename_here
path doesn't exist anymore inwebpack.config.js
. Adding aresolve.roots
entry for images breaks the other paths, so I fixed the image paths in our.html
files.options
fields goes awaytestingEnvironment
isnode
by default, so we must switch tojsdom
(to get thewindow
object, etc) which doesn't ship with jest by default. (I tried mocking thewindow
object inglobals
jest config, but couldn't figure out how to mockwindow.Date
). I installedjest-environment-dom
which doesn't like the hack that we put in forcanvas
, so I replaced it with the propercanvas
package.jest-circus
) in the latest version. For reference, there a way to configure jest to still use jasmine by setting test environment tojasmine2
, but instead I migrated the handful of tests to jest test.html-loader-jest
withjest-html-loader
uuid
package (required by our sdk (among other dependencies)).babel
packages used by jestObject
anymore, same forArray
for arrays.import "@testing-library/jest-dom/extend-expect";
is now be called asimport "@testing-library/jest-dom";
test/sql/selfServeExample.spec.ts
).Various related changes
@fluentui/react
(v8) to latestNotes
libdom 4.4
,window.navigator.MSFileSaver
is no longer supported: this is for downloading files. I kept the code with an ambient declaration, because apparently, some browsers (other than old IE and Edge) still support it.