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

Versions that go bump in the night: Bump versions across a few different core dependencies #3415

Merged
merged 12 commits into from
Aug 31, 2023

Conversation

Shadowfiend
Copy link
Contributor

@Shadowfiend Shadowfiend commented May 27, 2023

This brings us up to latest Ethers 5-series, React, and @reduxjs/toolkit.

We'll eventually want to poke at Ethers 6, but that will have to wait as it has breaking API changes.

Most of the resulting code changes were typing-related, and the outcome here is real nice—background async thunks have fully functional typing!

Leaving this as draft until we're ready to test rather heavily for the release.

Latest build: extension-builds-3415 (as of Wed, 30 Aug 2023 15:18:14 GMT).

@Shadowfiend Shadowfiend force-pushed the versions-that-go-bump-in-the-night branch 2 times, most recently from cc2fa26 to 50aee8d Compare May 27, 2023 19:15
@Shadowfiend Shadowfiend mentioned this pull request Jun 5, 2023
@Shadowfiend Shadowfiend mentioned this pull request Jun 27, 2023
10 tasks
jagodarybacka added a commit that referenced this pull request Jul 4, 2023
Resolves #3470

### What

Let's use Argon2 instead of PBKDF2 🔑 

What was already done:

- [x] added required packages
- [x] configured webpack config to work with webAssembly following
[example from the
docs](https://github.com/antelle/argon2-browser/tree/master/examples/webpack)
- [x] add necessary config to `content_security_policy` to allow
webAssembly - without `'wasm-eval'` we are not able to use argon
implementation in the extension
- [x] migration from old vaults to new vaults
- [x] handling errors during migration and allowing users to continue
with old implementation if needed
- [x] added one time analytics event after successful migration 
- [x] updated Jest to allow unit tests to work with WebAssembly, updated
Typescript as this was necessary to make new version of Jest work
correctly and fixed a bunch of Typescript issues - most fixes are copied
from #3415

### Testing

- [x] test migration from main - install extension on `main`, add some
HD wallets, checkout this branch, reload and unlock the wallet, make
sure you don't see the error about failed migration in the background
console, check if analytics event has been emitted, lock and unlock more
than one time
- [x] install extension on this branch, test locking and unlocking the
wallet
- [x] try to make webassembly part break (throw Error
[here](https://github.com/tahowallet/extension/blob/migrate-to-argon/background/services/internal-signer/encryption.ts#L118))
and make sure user is able to continue with old vaults

Latest build:
[extension-builds-3502](https://github.com/tahowallet/extension/suites/14011994578/artifacts/782054890)
(as of Sun, 02 Jul 2023 21:28:25 GMT).
1.9.4 brings a few useful things for forward dev:

- Better typing.
- The ability to customize the selector memoization config, including
  setting different equality semantics for inputs and outputs of
  selectors and a cache for inputs that is > 1.
- An autoBatchEnhancer middleware that could be used to batch store
  updates in some cases.

A few typing changes were needed; most notably, background async thunks
are now correctly typed in the UI frontend, and the `BackgroundDispatch`
type carries this information. To manage this,
`createBackgroundAsyncThunk` sprouts some new return type configuration,
which is then used to properly infer return types for these thunks when
`useBackgroundDispatch` is invoked.

Additionally, a few selectors had to be massaged to properly support the
updated types from redux; they should behave effectively the same.
Some light typing tweaks were needed, but otherwise this was a clean
upgrade with fairly minimal non-version-bump dependency changes to boot.
The biggest one was a renaming of apollo-* packages to @apollo/.
Bumping to 6.x remains on the docket.
A few adjustments to test mocking had to be made due to the various
version bumps, including forcing certain packages to skip the Jest
transformation strategy due to using ESM.
A few of the underlying dependencies now require a Node engine in the 16
series that is above 16.10, and this bump feels safe. Bumping to the
current LTS (18) needs to happen, but can wait.
Make one associated tweak to types in window-provider and one to
ui/utils/swap as well.
@Shadowfiend Shadowfiend force-pushed the versions-that-go-bump-in-the-night branch from 50aee8d to e28e336 Compare August 26, 2023 19:11
@Shadowfiend
Copy link
Contributor Author

Shadowfiend commented Aug 26, 2023

Draft until thesis/eslint-config#11 and the next release of @typescript-eslint with support for TypeScript 5.2 (due at 1pm Eastern or so on August 28th) both land, after which we need:

  • A bump to the @thesis-co/eslint-config dependency version here (it's currently commit-pinned, should be 0.6.0) (amended on 9d8b29e).
  • A bump to the @typescript-eslint package dependency to the latest (amended on 9d8b29e).
  • A bump to the typescript package dependency to 5.2.2 (amended on 9d8b29e).
  • An update to the last commit to update the ignored commit hash for blames.

This brings us to Prettier 3, and aligns the eslint parser to support
latest TypeScript (including the `satisfies` keyword).
The main difference is the bump to prettier 3, which switches
`trailingComma` to `all` by default. This hits on the order of 3000
lines by adding trailing commas to all function invocations and param
lists.
@Shadowfiend Shadowfiend force-pushed the versions-that-go-bump-in-the-night branch from e28e336 to 0947b60 Compare August 28, 2023 21:20
@Shadowfiend Shadowfiend marked this pull request as ready for review August 28, 2023 21:40
@Shadowfiend Shadowfiend requested review from a team as code owners August 28, 2023 21:40
The first parameters were using an arrow function expression without
braces, so the internal expression's return value was being used, and
wasn't a cleanup function for useEffect. This commit should cover all
misuses.
@Shadowfiend Shadowfiend merged commit 217138f into main Aug 31, 2023
6 checks passed
@Shadowfiend Shadowfiend deleted the versions-that-go-bump-in-the-night branch August 31, 2023 16:07
@Shadowfiend Shadowfiend mentioned this pull request Aug 31, 2023
Shadowfiend added a commit that referenced this pull request Sep 2, 2023
## What's Changed
* Create E2E tests for verified/unverified tokens by @michalinacienciala
in #3472
* v0.47.0 by @Shadowfiend in
#3601
* Versions that go bump in the night: Bump versions across a few
different core dependencies by @Shadowfiend in
#3415


**Full Changelog**:
v0.47.0...v0.48.0

Latest build:
[extension-builds-3610](https://github.com/tahowallet/extension/suites/15695499704/artifacts/896067135)
(as of Thu, 31 Aug 2023 16:31:16 GMT).
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.

1 participant