Coder Social home page Coder Social logo

Riot 4 support about riot HOT 20 OPEN

damusix avatar damusix commented on May 27, 2024 23
Riot 4 support

from riot.

Comments (20)

libetl avatar libetl commented on May 27, 2024 11

I have not worked with riot for a while.
Let's vote for the issue. If I get more than 10 👍 I can take a look

from riot.

dmtrs avatar dmtrs commented on May 27, 2024 3

Thanks @shilman have forked storybook and will go through the document

Will come back to this ticket for updates/questions.

from riot.

libetl avatar libetl commented on May 27, 2024 2

Aïe... more than 10 thumbs.

from riot.

libetl avatar libetl commented on May 27, 2024 1

@GianlucaGuarini Hi

from riot.

libetl avatar libetl commented on May 27, 2024 1

Team, I am quite ready to get started now

from riot.

shilman avatar shilman commented on May 27, 2024 1

Start of a doc here: https://docs.google.com/document/d/1fe6uCfpr3mzSnj4jN_uoZqVnyNtjBjfOMxt_ZI7ktL8/edit

If somebody wants to add Riot 4 support and it's completely different from Riot 3, I recommend dropping Riot 3 support. If people want to use the old version of Riot, they can also use the old version of Storybook, and there are not enough existing Storybook for Riot users to justify supporting both.

from riot.

libetl avatar libetl commented on May 27, 2024

Hmm, I was pretty sure it would not be compatibe

from riot.

libetl avatar libetl commented on May 27, 2024

Pretty busy right now, but if I think some time I can have a look.

How do we mount a component with riot 4 ? and how do we unmount ?

from riot.

damusix avatar damusix commented on May 27, 2024

Webpack info

Mounting / Unmounting components

Ways to mount

From a bundled file

import * as riot from 'riot'
import App from './app.riot'

const mountApp = riot.component(App)

const app = mountApp(
  document.getElementById('root'),
  { message: 'Hello World' }
)

Using riot.mount

Riot template

<my-component>

  <!-- layout -->
  <h3>{ props.title }</h3>

  <style>
    :host { display: block }
    h3 { font-size: 120% }
    /** other component specific styles **/
  </style>

</my-component>

index.html

<div is="my-component"></div>

app.js

// import the component javascript output generated via @riotjs/compiler
import MyComponent from './my-component.js'

// register the riot component
riot.register('my-component', MyComponent)

riot.mount('my-component')

Ways to unmount

  • Within a particular tag, you can call: this.unmount()
  • Using riot global, you can call: riot.unmount('my-component')

Relevant to story book

I imagine you'd want a way to bind into any component and unmount, intercept, etc. You can do that using riot plugins

from riot.

damusix avatar damusix commented on May 27, 2024

Any updates on this? @libetl

from riot.

shilman avatar shilman commented on May 27, 2024

@libetl I downvoted to help you focus on source-loader 🤣 Teasing of course.

from riot.

damusix avatar damusix commented on May 27, 2024

@shilman you troll! lol @libetl can I be of any help?

from riot.

stale avatar stale commented on May 27, 2024

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

from riot.

libetl avatar libetl commented on May 27, 2024

Really busy these days with my regular job. The situation will slightly get better after september 14th.

from riot.

libetl avatar libetl commented on May 27, 2024

@damusix can we chat on discord or zoom when you get a chance ?

from riot.

damusix avatar damusix commented on May 27, 2024

@libetl https://discord.gg/vpzwUm

from riot.

dmtrs avatar dmtrs commented on May 27, 2024

What approach do you consider in order to add the riot 4 support without breaking existing installation with current version?

from riot.

dmtrs avatar dmtrs commented on May 27, 2024

dependbot trying to update storybookjs/storybook@a21885f

from riot.

damusix avatar damusix commented on May 27, 2024

What approach do you consider in order to add the riot 4 support without breaking existing installation with current version?

Old version is completely different in almost every way. I'll assume you might need to start from scratch.

Old riot, you import tags and mount. New riot, you import tags, register, then mount.
New riot uses lifecycle methods, component state, and no observable.
New riot has less template flexibility (good thing), so old ways will break.
Some attributes and elements changed (each, virtual, template)

from riot.

dmtrs avatar dmtrs commented on May 27, 2024

Hey @damusix,
should storybook support both riot 3 and 4 or should riot 4 be a replacement to existing riot implementation?

What could be good starting points to make appropriate changes alteration? Is there any "support your framework" documentation to see how to start from scratch?

from riot.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.