Scaffold generator does not generate stories or tests

We had several discussions about this when we first started integrating Jest and Storybook. Our thought was that most folks will end up customizing or throwing away the scaffolded pages as they build out their app. Several of us on the core team are seasoned Rails developers (the framework that inspired the scaffold generators) and none of us had used the Rails scaffold generators in years. It’s very impressive for new developers, or when rapidly prototyping something, but once you’re used to the framework and know what you’re doing they seemed much less useful.

If you do keep them, they’ll almost certainly be customized at some point, and it won’t take hardly any changes before the test suite and/or the generated stories completely break, which can frustrating or scary for a new dev.

If you know you’re going to keep generating scaffolds and keep them around, you can customize the generated templates, including the test and stories files, so that any future scaffolds you create will have those files fully built out. But I don’t think we’re going to make that the default in the framework in the near future.

2 Likes