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

refactor: necromancy to restore MV2 build #1054

Merged
merged 8 commits into from
Nov 22, 2022
Merged

refactor: necromancy to restore MV2 build #1054

merged 8 commits into from
Nov 22, 2022

Conversation

lidel
Copy link
Member

@lidel lidel commented Feb 19, 2022

This PR:

  • removes a lot of unused functionality (windows.ipfs proxy logic) which has been deprecated and disabled for years, which in turn removed a bunch of deps
  • removes yarn (Node we now has npm ci and package-lock.json which should be good enough)

TODO

  • remove yarn and all the hackery around transitive dependency overrides
  • bump all dependencies
  • switch to ipfs-core for fewer deps
  • remove unused deps
  • Firefox manifest fix to pass latest webext lint
  • remove remaining window.ipfs code that was pulling dead dependencies
    (Remove legacy window.ipfs examples in-web-browsers#172)
  • ensure Snyk fix fa54db963893c35faaaa0144bf2d51a9 #1070 is ported (if still relevant)
  • fix tests (they fail due to ESM error)
    • 👉 TBD, but we may need to refactor things to ESM and just call it a day anyway
  • docker builds (bump to latest nodejs)
  • browserAction icon (it is always "inactive" now) – fixed in 4e17043
  • something about is-ipfs (update?)
  • quick import with js-ipfs works was broken in main – can be fixed in separate PR (or removed)
  • confirm import of an image via context menu works (addFromURL)
  • confirm webui preload logic works (should check if CID is in datastore and preload only if it is) – closes go-ipfs 0.12 interop #1059 closes Switch precache to better locality check #878
  • cleanup: remove any left-overs from window.ipfs logic – done in 830ae1f, see Meta: window.ipfs v2 #589 (comment)
  • confirm Brave onboarding works
  • update client so swarm.peers don't fail on webtransport – a96cf20
  • fix the way debug is initialized, so namespaces are applied before companion is initialized – a96cf20
  • work and require latest Node LTS

- removed yarn and all the hackery around transitive dependency overrides
- bumped all dependencies
- switched to ipfs-core for less deps
- removed unused deps
- Firefox manifest fix to pass latest webext lint
- removed remaining window.ipfs code that was pulling dead dependencies
  (ipfs/in-web-browsers#172)

TODO:
- fix tests
- docker builds
- browserAction icon
@lidel
Copy link
Member Author

lidel commented Sep 26, 2022

cc @meandavejustice @SgtPooki @whizzzkid (just FYI – no immediate action needed)

This PR includes a cleanup which I did not finish (mostly works, but tests do not run due to ESM).

If any of you ever starts updating dependencies in this project, this PR will be useful prior art to see which dependencies and deprecated code blocks can be removed to reduce maintenance cost going forward.

@tinytb
Copy link

tinytb commented Oct 20, 2022

2022-10-20 chat with lidel

  • Let's land this PR and then make a release.
  • This creates a clean slate so that new contributors don't need to worry about as much dead code that needs to be removed.
  • Nishant can help with landing this -- lidel hasn't look at this in a month.
  • Bump dependencies, see that it builds, and make sure the tests pass.
  • Should do this before the end of the year; the sooner, the better.
  • Ensures that when we are ready with ManifestV3, we can make a release.
  • Have a working version that we can revert to, if there's an issue with the ManifestV3 upgrade.

@lidel
Copy link
Member Author

lidel commented Oct 21, 2022

Late thought: if fixing mocha tests is a lot of work we can consider removing it and replacing it with @playwright/test runner like we did in ipfs/ipfs-webui#1983

@whizzzkid
Copy link
Contributor

@lidel #1101 fixes most of the issues, the only problem I'm facing is mozilla/webextension-polyfill#236

Which doesn't seem to be working. Will be spending some more time on this.

whizzzkid and others added 7 commits November 21, 2022 19:54
* Adding esm config

* Moving to import/export - it builds

* Fixed tests

* Fixing Test

* typo

* fixing breaking is-ip changes

* Fixing coverage reporting

* adding missing webExt config

* Fixing test

* Passing abort-controller as dep

* Fixing Lint

* chore: remove window.ipfs ACL tests

* chore: bump terser deps

* chore: pin all dependency versions

#1101 (comment)

Co-authored-by: Marcin Rataj <lidel@lidel.org>
@lidel
Copy link
Member Author

lidel commented Nov 22, 2022

Thanks to @whizzzkid's help in #1101 I managed to focus on closing remaining cleanup ❤️

Historical issues I was able to identify are resolved.
Merging so we can plan making a new release before EOY.

@lidel lidel marked this pull request as ready for review November 22, 2022 02:31
@lidel lidel requested review from meandavejustice and a team as code owners November 22, 2022 02:31
@lidel lidel merged commit efad33f into main Nov 22, 2022
@lidel lidel deleted the refactor/necromancy branch November 22, 2022 02:33
lidel added a commit that referenced this pull request Nov 24, 2022
this sync cleans up
proxy / window.ipfs keys that were removed from english source in
#1054
This pull request was closed.
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.

go-ipfs 0.12 interop Switch precache to better locality check
3 participants