Refactor search to remove legacy web3js dependency #275
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors the search bar to remove the client-side legacy web3js dependency. This means that the core app layout, shared by every page, no longer pulls in legacy web3js
getDomainInfo
is replaced with a GET request to a new API/api/domain-info/[domain]
getDomainInfo
and returns the response as JSON. This function and everything else inutils/name-service
that can be run on the server are extracted to a newutils/domain-info
. This is necessary becauseutils/domain-info
hasuse client
(needed for its client-side hooks)utils/tx
to a newutils/programs
. I've removed the legacy web3js dependency, which was just used to pull in program public keysThe result of this is that some pages load ~100kb less JS. I'm not exactly sure how some of these numbers work though, eg the homepage is already not including web3js despite including the search bar.
We can also inspect the bundle before and after this change, this is the app/layout endpoint. On master we have the legacy web3js
After we've stripped many of these dependencies out:
Mostly it shows that we should stop including that token list though... #201