Comments (20)
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.
Thanks @shilman have forked storybook and will go through the document
Will come back to this ticket for updates/questions.
from riot.
Aïe... more than 10 thumbs.
from riot.
from riot.
Team, I am quite ready to get started now
from riot.
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.
Hmm, I was pretty sure it would not be compatibe
from riot.
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.
Webpack info
- Official webpack example
- My webpack setup (bit more elaborate)
Mounting / Unmounting components
- Docs: Mount
- Docs: Unmount
- Official Example of mount
- How a component's JS is implemented
- Working example of mounting an element
- Working example of registering elements
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.
Any updates on this? @libetl
from riot.
@libetl I downvoted to help you focus on source-loader
🤣 Teasing of course.
from riot.
@shilman you troll! lol @libetl can I be of any help?
from riot.
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.
Really busy these days with my regular job. The situation will slightly get better after september 14th.
from riot.
@damusix can we chat on discord or zoom when you get a chance ?
from riot.
@libetl https://discord.gg/vpzwUm
from riot.
What approach do you consider in order to add the riot 4 support without breaking existing installation with current version?
from riot.
dependbot trying to update storybookjs/storybook@a21885f
from riot.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from riot.