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: appkit basic code-split #3757

Open
wants to merge 170 commits into
base: main
Choose a base branch
from
Open

feat: appkit basic code-split #3757

wants to merge 170 commits into from

Conversation

tomiir
Copy link
Collaborator

@tomiir tomiir commented Jan 28, 2025

Description

  • Splits Appkit class into AppkitBasic and AppKit
  • Abstract core functionality into AppkitCore
  • Splits UI and Scaffold UI component exports and individually import necessary components
  • Updates WC Libraries to latest version

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

@@ -47,10 +52,24 @@ describe('Balance sync', () => {
expect(setBalanceSpy).toHaveBeenCalledWith('1.00', 'ETH', sepolia.chainNamespace)
})

it('should set the correct native token balance', async () => {
it.sequential('should set the correct native token balance', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

@enesozturk did we need to do this for other tests too ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@magiziz For async tests we 'might' need. When there are async test, and if they are trying to mock same module, or some how the internal functions relying on the same state, not using sequentia might cause race condition issues which would be painful to debug

@@ -182,7 +133,7 @@ export class WuiIcon extends LitElement {
--local-width: ${`var(--wui-icon-size-${this.size});`}
`

return html`${svgOptions[this.name]}`
return html`${until(getSvg(this.name), html`<div class="fallback"></div>`)}`
Copy link
Contributor

Choose a reason for hiding this comment

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

This is nice! Can we maybe use until in more places where we load stuff to minimise dom rendering?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah definitely, we can probably do it after appkit core split

@@ -98,7 +109,6 @@ export class W3mAccountWalletFeaturesWidget extends LitElement {
gap="m"
data-testid="w3m-account-wallet-features-widget"
>
${this.network && html`<wui-network-icon .network=${this.network}></wui-network-icon>`}
Copy link
Contributor

Choose a reason for hiding this comment

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

This got removed ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

remember this was not being rendered?

@@ -21,6 +21,19 @@ describe('SIWE mapped to SIWX', () => {
let appkit: AppKit

beforeEach(async () => {
global.document = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use mockWindowAndDocument method which is mocking document and window object, if it's not doing the exact same, we could extend it maybe?

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.

5 participants