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

connect: remove bowser dependency #7844

Merged
merged 6 commits into from
Mar 23, 2023
Merged

connect: remove bowser dependency #7844

merged 6 commits into from
Mar 23, 2023

Conversation

mroz22
Copy link
Contributor

@mroz22 mroz22 commented Mar 14, 2023

ok, stay Awhile and listen.

in #6509 I would like to use scheduleAction util which internally uses AbortController which does not work very well in our tests, for example coinjoin package needs to use jsdom testEnvironment where it miraculously works, but it is actually not right, we want to test such package in node env.

My problem is similar, after doing this change in transport, all the tests in connect start to fail and I cannot really do any workarounds here. So what are my options? I could somehow tweak our jest configs, but since we are still on version 25 or which one and the latest one is 29 it feels like a waste of time to study outdated docs. So it only makes sense to update jest and see if it does not fix the problem (it does).

It is not the best situation we can have - having 2 different versions of jest in dependencies but I believe this is the only way how to update it, package per package. Last time I tried to do it globally I gave up after few horus because it comes with many problems. cc @tomasklim

You may also notice that I have created a new package called @trezor/connect-browser-utils. There are still couple of references to browser specifics in @trezor/connect and it shouldn't be like this. That package should be pure node.js. Adding this package and doing some refactoring I was able to completly get rid of bowser dependency from @trezor/connect which is good I believe. Originally, my motivation was to be able to switch testEnvironment for @trezor/connect unit tests to 'node' but I did not succeed doing this. There are still some window references elswhere...

related #5319
resolve #5324
related #6025

@mroz22 mroz22 force-pushed the connect-browser-utils branch 4 times, most recently from f28d327 to 61e6cc9 Compare March 15, 2023 14:30
@mroz22 mroz22 changed the title Connect browser utils connect: remove bowser dependency Mar 15, 2023
@mroz22 mroz22 force-pushed the connect-browser-utils branch from 61e6cc9 to ea63aa5 Compare March 15, 2023 14:55
@mroz22
Copy link
Contributor Author

mroz22 commented Mar 15, 2023

update

based on discussion with @szymonlesisz and also on commit of his f28d327 which I shamelessly took and squashed we can achieve basically the same but we dont need to use @trezor/connect-browser-utils check commits, I hope they are self-explanatory :D

@mroz22 mroz22 force-pushed the connect-browser-utils branch 8 times, most recently from 993ff60 to 4e5d60e Compare March 20, 2023 21:53
@mroz22 mroz22 mentioned this pull request Mar 21, 2023
11 tasks
@mroz22 mroz22 force-pushed the connect-browser-utils branch 3 times, most recently from efc66e5 to badd4d1 Compare March 22, 2023 14:11
@mroz22 mroz22 force-pushed the connect-browser-utils branch from 5c04f23 to f67ace1 Compare March 22, 2023 14:39
@mroz22
Copy link
Contributor Author

mroz22 commented Mar 22, 2023

/rebase

@github-actions
Copy link

@github-actions
Copy link

@trezor-ci trezor-ci force-pushed the connect-browser-utils branch from f67ace1 to c4ede0d Compare March 22, 2023 15:09
@mroz22 mroz22 force-pushed the connect-browser-utils branch from c4ede0d to 8176d24 Compare March 22, 2023 20:43
@mroz22 mroz22 merged commit 123e53a into develop Mar 23, 2023
@mroz22 mroz22 deleted the connect-browser-utils branch March 23, 2023 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

@trezor/connect-popup: share browser detection code with suite
2 participants