yavin-dev / framework

A framework for rapidly building production quality analytics applications
https://yavin.dev
MIT License
84 stars 35 forks source link

How does Yavin work with React JS? #1728

Open QubitPi opened 9 months ago

QubitPi commented 9 months ago

Hi Yavin team,

We have used Yavin for some time and we like it! So our team are looking at some customization on top of it. Some of them include:

  1. i18n, i.e. translating the whole into Chinese
  2. login feature
  3. an online interactive guide for the first-time yavin dashboard user
  4. etc...

These above raised one issues for us: our team is heavily based on React but yavin is written in Ember. We would like to fork, customize, and potentially contribute back to yahoo-yavin using React JS. Is there a way to develop Yavin using React in some way?

Thank you for your attention

cythrawll commented 9 months ago

Hello, I have some ideas for you.

  1. Ember has some great i18n libraries.
  2. We actually have login working in our own yavin deployments, we set up login, for example with an express middleware and then expose the navi.user in the ember environment via a server-generated-config.js
  3. that would be cool

So, about react, we've actually recently made the jump to react ourselves in many of our projects, but as yavin is written in ember, if you wish to develop with it, I strongly suggest learning and writing in the ember ecosystem. It's actually a good thing to have experience and knowledge of several frameworks these days. Anyway, if you have existing components in react, there are ways you can expose and embed them in ember. We've actually done this by wrapping react components in ember for custom visualizations and such. It works really well if used sparingly. However, you'll have best results in using it sparingly for complex components where the cost is too high to find or rewrite a ember alternative. For most features you'll probably want to stick with ember as rendering react components in ember can just make things complex for debugging/testing maintainability and might have some performance overhead as well as you have to bootstrap react inside of every ember component that uses react.