Coder Social home page Coder Social logo

Comments (4)

tajo avatar tajo commented on June 3, 2024 1

Imagine having a vast number of templates, and you want to generate stories without repeating the tedious process of generating simple stories for them.

That sounds like a use-case for controls (args/argTypes) or similar API. If you insist on having separate stories (extra items in the sidebar), macros would be way to go.

from ladle.

tajo avatar tajo commented on June 3, 2024

Ladle doesn't support this for the same reason Storybook is trying to deprecate it now. Ladle was built around static analysis, automatic code-splitting, automatic story naming and meta.json.

I think the fact Storybook is moving in the same direction now is a proof that it was the correct architectural decision.

I also just went over Indexer API proposal. That's something that could fit into Ladle's architecture as well. However, that's still a build time feature, it doesn't replace/solve programmatically added stories. Also, it might not be as value to us since we only support React/MDX.

from ladle.

tajo avatar tajo commented on June 3, 2024

I think the only path here would be to introduce some sort of declarative macros. However, it's a foreign concept to JS developers so not sure if it would be successful.

from ladle.

phaistonian avatar phaistonian commented on June 3, 2024

I still believe being able to provide such functionality will be of value — especially since Storybook does not.

Imagine having a vast number of templates, and you want to generate stories without repeating the tedious process of generating simple stories for them.

I thought about creating story files for each glob match, either on the filesystem or on memory, on startup — and perhaps when a watcher triggers a needed change — but that feels like a hack.

In any case, I wish such a feature will "Land on Ladle" one day ;)

from ladle.

Related Issues (20)

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.