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

feat: support for more assets #434

Merged
merged 12 commits into from
Jan 25, 2023
Merged

feat: support for more assets #434

merged 12 commits into from
Jan 25, 2023

Conversation

alecdwm
Copy link
Member

@alecdwm alecdwm commented Jan 11, 2023

  • Test that deploying the new squid won't break the existing live build (due to adding new tokens which the live build doesn't support)
  • Deploy the new squid

@alecdwm alecdwm marked this pull request as draft January 11, 2023 07:04
@alecdwm alecdwm self-assigned this Jan 11, 2023
@alecdwm alecdwm added the Assets / Chain maintenance Add / remove / modify assets label Jan 11, 2023
@alecdwm alecdwm force-pushed the feat/support-for-more-assets branch from ad2a4cb to 95820d0 Compare January 11, 2023 23:37
@alecdwm alecdwm marked this pull request as ready for review January 13, 2023 09:43
@alecdwm alecdwm force-pushed the feat/support-for-more-assets branch 3 times, most recently from 1685a6f to 3fae1b2 Compare January 16, 2023 15:59
@alecdwm alecdwm force-pushed the feat/support-for-more-assets branch from 3fae1b2 to f6c9f39 Compare January 16, 2023 16:10
@alecdwm alecdwm force-pushed the feat/support-for-more-assets branch from 8dfec82 to a327f27 Compare January 16, 2023 16:55
it breaks the resolution of dependencies-of-dependencies in downstream projects
e.g. for @talismn/web -> @talismn/balances-react -> @talismn/balances
@talismn/balances resolves to the version with a git hash beginning with
the lowest letter of the alphabet, rather than the most recently published
Copy link
Contributor

@chidg chidg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple comments
Too complex to review in detail but let's do some testing

metadata.__kind === "V12" ||
metadata.__kind === "V13"
) {
// we can't parse metadata < v14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance you could put a link to some docs or a GH issue on this so future devs can understand why v14 is different?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!
I'll link to this pr. Before v14 the client had to know the chain types ahead of time, whereas with v14 it's now possible to fetch them from the chain RPC.


suppressPortableRegistryConsoleWarnings()

const importDynamic = new Function("modulePath", "return import(modulePath)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this will be permissable in manifest v3. The guidelines refer to 'remote code', but I suspect that reviewers will just look at new Function and say no.
https://developer.chrome.com/docs/extensions/mv3/mv3-migration-checklist/#api-remote-code

I can see this is a tricky issue, are there any other potential methods?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yikes :|

Maybe we can just write this module as plain javascript (then tsc won't convert the import into a require)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an issue for it on the tsc github with some alternatives
microsoft/TypeScript#43329

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one is worth trying
microsoft/TypeScript#43329 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inclusion did not work (causes Critical dependency: the request of a dependency is an expression errors in frontend bundles), now using a different approach (import a .cjs file which is not transpiled by tsc, use dynamic import with vite-ignore and webpackIgnore: true magic comments)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@chidg chidg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chidg chidg merged commit b083d95 into dev Jan 25, 2023
@chidg chidg deleted the feat/support-for-more-assets branch January 25, 2023 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Assets / Chain maintenance Add / remove / modify assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants