Open tomByrer opened 5 years ago
thanks for the idea!
after hacking on this a bit this weekend, i think i'm coming to the conclusion that the sfc plugin is lower level - i.e. this <stories>
tag is something that we can build on TOP of an sfc plugin (or a general react-sfc preset sfc plugins.). sfc plugin exists mainly to make it possible to farm out different parts of a file to various filetype parsers.
in other words.. yes this will be possible. the degree to which we allow for a modular/fragmented vs a unified/opinionated system is going to be a very tough one..
Yes, I was thinking one approach would be:
How about adding some more caramel to your sugar? Let the build tool to do the
export default () =>
typing for you. Easier to colocate the docs & test with the demo:<info>
is a pivoted version of a Storybook plugin.Tests' code are more minimal & easier to scan with your eyes When the component renders, in it gets an unique class name (eg
sb1904fiaoa4v
), then all tests in that<story></story>
get prefixed withexpect(wrapper.find('.sb1904fiaoa4v')).
.<snapshot />
is visual regression test. I added a flag to only render if all the tests pass to prevent wasted CPU.Although MDX looks fun, I like the idea of having new devs only having to learn extra weird XML-ish keywords since they're already learning HTML & JSX. Adding a 4th language, even if simple, is a bit much mind-jumping to me. Plus, using XML/JSX to separate concerns is easier for editors; clear boundaries for code-folding, jump-tos, etc....
I really dig the idea of having everything in 1 file; thanks for your idea!