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

Convert balstack to a render function component #1313

Merged
merged 8 commits into from
Jan 24, 2022

Conversation

arb000r
Copy link
Collaborator

@arb000r arb000r commented Jan 17, 2022

Description

#1322 Must be merged first.

There were a few issues with out existing stack component. Given the fact that it relied on computed variable changes to re-render was a big one. It meant that it was not dynamic to changes in slots as well as having difficulty with binding v-model.

The isDynamic prop has been made redundant as a result. So should be a bit easier to understand its API

Type of change

  • 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)
  • Dependency changes
  • Code refactor / cleanup
  • Documentation or wording changes
  • Other

How should this be tested?

The change is pretty visual. Just test that the app styles haven't been broken in pool creation and other areas that BalStack is used.

Visual context

Non-providable.

Checklist:

  • I have performed a self-review of my own code
  • I have requested at least 2 reviews (If the PR is significant enough, use best judgement here)
  • I have commented my code where relevant, particularly in hard-to-understand areas
  • If package-lock.json has changes, it was intentional.
  • The base of this PR is master if hotfix, develop if not

@vercel
Copy link

vercel bot commented Jan 17, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

kovan – ./

🔍 Inspect: https://vercel.com/balancer/kovan/7dkfiT4uZ1WGohxNggi1Zdh6TajP
✅ Preview: Canceled

[Deployment for bcd1645 canceled]

app – ./

🔍 Inspect: https://vercel.com/balancer/app/CBRFz9EDRRAoFPffTTAjEbD7hg8k
✅ Preview: Canceled

[Deployment for bcd1645 canceled]

beta-app – ./

🔍 Inspect: https://vercel.com/balancer/beta-app/9x8enKiYbqrwQfiwg6rTmTvk48ry
✅ Preview: https://beta-app-git-convert-balstack-to-renderfunc-balancer.vercel.app

beta-kovan – ./

🔍 Inspect: https://vercel.com/balancer/beta-kovan/7oSQ5pjEpcZfMzaaY1JWuvDvTS4j
✅ Preview: https://beta-kovan-git-convert-balstack-to-renderfunc-balancer.vercel.app

polygon – ./

🔍 Inspect: https://vercel.com/balancer/polygon/AHyQuBSJQoHYgBbaKGHa8VMv1KeC
✅ Preview: Canceled

[Deployment for bcd1645 canceled]

beta-polygon – ./

🔍 Inspect: https://vercel.com/balancer/beta-polygon/Ern9zux5DCYFg5uhME4UJETNULs2
✅ Preview: https://beta-polygon-git-convert-balstack-to-renderfunc-balancer.vercel.app

beta-arbitrum – ./

🔍 Inspect: https://vercel.com/balancer/beta-arbitrum/G4Z5RRwk9UmBpUPdM4kJABca3LLK
✅ Preview: https://beta-arbitrum-git-convert-balstack-to-renderfunc-balancer.vercel.app

arbitrum – ./

🔍 Inspect: https://vercel.com/balancer/arbitrum/36crbWhL8u4fNRP86W48iGfH9vNu
✅ Preview: Canceled

[Deployment for bcd1645 canceled]

if (Array.isArray(styledNestedChildren)) {
// and those children can be nullish too
const nonNullishChildren = styledNestedChildren.filter(
nestedChild => nestedChild !== undefined || nestedChild !== null
Copy link
Contributor

@evgenyboxer evgenyboxer Jan 18, 2022

Choose a reason for hiding this comment

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

I assume you wanted nestedChild !== undefined && nestedChild !== null right?

Suggested change
nestedChild => nestedChild !== undefined || nestedChild !== null
nestedChild => nestedChild != null

Copy link
Contributor

@evgenyboxer evgenyboxer left a comment

Choose a reason for hiding this comment

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

lgtm

@arb000r
Copy link
Collaborator Author

arb000r commented Jan 20, 2022

Prerequisite to this being merged is merge of #1322

@@ -0,0 +1,83 @@
import { render } from '@testing-library/vue';
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks nice! Glad we have something to do UI tests!

Copy link
Collaborator

@garethfuller garethfuller left a comment

Choose a reason for hiding this comment

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

Render tests look great, nice work!

Comment on lines +77 to +80
expect(getByText('First')).toHaveClass('mb-4 border-b');
expect(getByText('Second')).toHaveClass('mb-4 border-b');
// last el shouldn't have a spacing class
expect(getByText('Third')).not.toHaveClass('mb-4 border-b');
Copy link
Collaborator

Choose a reason for hiding this comment

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

These tests are great! Just a minor thing here, is there any advantage to maybe using the divide class and flexgrid rather than margins and flexbox?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll look into it

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.

4 participants