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

Implement mocking SocialGet #17

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

sekaiking
Copy link
Contributor

It's supposed to work by taking data json from bos loader server and replace it when the user calls Social.get. Didn't test it extensively, so it may be buggy and inconsistent with Social.get from SocialDB

Works with this: NEARBuilders/bos-workspace#9

@vercel
Copy link

vercel bot commented Aug 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
viewer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 12, 2023 2:00pm

@@ -57,6 +61,54 @@ function App(props) {

const location = window.location;

const cc = useCache();
cc.socialGet = (near, keys, recursive, blockId, options, invalidate) => {
Copy link
Member

@elliotBraem elliotBraem Aug 13, 2023

Choose a reason for hiding this comment

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

This is awesome.

@elliotBraem
Copy link
Member

Unless you have any reason not to, I'm down to merge to main. It's helping my development

@sekaiking sekaiking marked this pull request as ready for review August 14, 2023 06:28
@elliotBraem elliotBraem merged commit 8092bed into near-everything:main Aug 14, 2023
1 check passed
@elliotBraem
Copy link
Member

@sekaiking I had to revert this PR; once deployed, the Social.get takes longer in each of the widgets, and so a wave of red boxes overtakes the screen until it's able to resolve.

I think this is only happening because we are mocking the Social.get via the gateway -- this problem should go away if we implement it directly into the VM.

We can pass dataMap into the VM and then access it via this.vm.widgetConfigs.dataMap

@sekaiking
Copy link
Contributor Author

@sekaiking I had to revert this PR; once deployed, the Social.get takes longer in each of the widgets, and so a wave of red boxes overtakes the screen until it's able to resolve.

I think this is only happening because we are mocking the Social.get via the gateway -- this problem should go away if we implement it directly into the VM.

We can pass dataMap into the VM and then access it via this.vm.widgetConfigs.dataMap

I see. You are right It's better if we implement it directly under the VM like redirectMap. I will try to study the VM code more later.

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.

2 participants