NEAR-DevHub / neardevhub-bos

DevHub Portal Product UI (Hosted BOS) – Includes other instances (e.g. Infrastructure, Events)
https://neardevhub.org
MIT License
24 stars 23 forks source link

Research the near-social-bridge approach #118

Open ailisp opened 1 year ago

ailisp commented 1 year ago

Problem Currently, we are not able to use npm packages like css libraries and third party react compoents in near social viewer. The event handler also has some limitations that prevent us from implementing a better search bar experience, see problem 1 in this comment: https://github.com/near/neardevhub-widgets/pull/85#issuecomment-1501391631.

User Story As a developer, I want to use npm packages and reuse the react ecosystem's tooling.

Acceptance Criteria

If everything goes well, scope after this ticket:

frol commented 1 year ago

I just want to say that such an approach to components defeats the purpose of BOS as it would just store JS blobs that are not editable, but I see the benefits. I don't see an alternative solution to the limitations we face with BOS VM today.

ori-near commented 1 year ago

Hi @ailisp thanks so much for creating this. Can you please add a problem statement and acceptance criteria to this? What else do we need to move this from triage to the backlog?

carina-akaia commented 1 year ago

we can use npm packages, such as tailwindcss and nextjs

Speaking of nextjs, I would insist not to go with SSR solutions, since it almost kills decentralization; I think we should rather use PWA approach ( as much as it's possible ) along with Preact, and web4 as a hosting solution

carina-akaia commented 1 year ago

Summary for recent discussions within the DevHub team

Topic: using near-social-bridge as an application entry point and BOS functionalities provider, and web4 as the deployment solution

Pros

Cons

💡 Addressing security concerns:

near-social-vm was created as a sandbox solution with the goal to restrict the access to LocalStorage and Cookies. But most of the modern browsers already have the sandbox – it’s called WebAssembly. Moreover, WebAssembly allows using more than just one language and its VM unlocks near-native performance. It’s also worth noticing that WebAssembly is a widely acknowledged open standard curated by a huge community, with W3C in its core.

carina-akaia commented 1 year ago

Update: now the migration to this approach makes even more sense, as BOS moving towards embracing native JS, and we need to improve quality and Cycle Time metrics.

elliotBraem commented 1 year ago

@carina-akaia I support this idea of exploring near-social-bridge as we've talked about this in length, but I see it more as an application wrapper and should be coupled with near-social-vm being installed in the bridged application, in order to retain composability.

What specific features are you trying to achieve by using near-social-bridge? This is an important consideration, as well.

I would suggest refactoring DevHub into a more typical, native BOS application before embarking on this. I would not group the limitations of BOS with the difficulties of developing DevHub -- I think we can draw inspiration from other BOS applications for how to make the development experience easier. Then we can use the near social bridge to provide specific external libraries.

carina-akaia commented 1 year ago

@elliotBraem please read this document, it should make the topic more clear