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

chore(zones): update zones/proxies to use connectedSubscription #2128

Merged
merged 1 commit into from Feb 5, 2024

Conversation

johncowen
Copy link
Contributor

Simplifies the 'knitting' of Zones and their Proxies by using connectedSubscription.

I think this is the last place where we had a subscription inspection without using our new Subscription data layer things. See #1890


Separately, I spent a lot of time trying to get typescript to understand Object.groupBy and/or a type safe polyfill for it, which would simplify this even more and use even less of our own code, but I kinda gave up trying. I can come back to that at a later date. edit: I didn't PR this branch straight away for reasons, and luckily I found out today Object.groupBy is coming to typescript in the next release in around a month or so, so I'll wait for that. I still have a branch or stash here with the native Object.groupBy usage, so I can PR that once the support comes with typescript.

Also, its important for me to make sure I note in relation to #1918 (comment) that I've removed an instance of isSet usage whilst I was here. For the following reason: Unless I've missed something, withConfig here can never be null (its the result of Array.find which never returns null) so I don't see any point using isSet where we can just use straight/native JS instead i.e. this is the better refactor/fix.

There are other places where I think we no longer need isSet, but seeing as I was changing code here anyway, I only updated things here for the moment.

Signed-off-by: John Cowen <john.cowen@konghq.com>
Copy link

netlify bot commented Feb 2, 2024

Deploy Preview for kuma-gui ready!

Name Link
🔨 Latest commit 2d4805b
🔍 Latest deploy log https://app.netlify.com/sites/kuma-gui/deploys/65bcdb168803fe0008e6e288
😎 Deploy Preview https://deploy-preview-2128--kuma-gui.netlify.app/gui
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@johncowen johncowen marked this pull request as ready for review February 2, 2024 12:11
@johncowen johncowen requested a review from a team as a code owner February 2, 2024 12:11
@johncowen johncowen requested review from kleinfreund and removed request for a team February 2, 2024 12:11
@johncowen johncowen self-assigned this Feb 2, 2024
@johncowen johncowen merged commit e30a96c into kumahq:master Feb 5, 2024
16 checks passed
johncowen added a commit that referenced this pull request Mar 14, 2024
Now Typescript comes with built-in declarations for `Object.groupBy` its a little less annoying to polyfill use Javascript's `Object.groupBy`, also see the description in #2128.

This PR adds a polyfill and uses it an a couple of places where conversations have arisen lately. most of the change here is as a result of a re-nest, but the code that came up in past conversations is now just a one-liner.

There are a few places I'll be switching this in at some point (including the code in above linked PR)

I tested the polyfill manually in Firefox 118.

Signed-off-by: John Cowen <john.cowen@konghq.com>
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.

None yet

2 participants