20 Commits

Author SHA1 Message Date
Shota Fuji
537213926e
feat(addon-docs): Dynamic source rendering for Vue
https://github.com/storybookjs/storybook/issues/11400

This commit adds dynamic source code rendering feature to Docs addon for
Vue.js. The goals are 1) reflecting Controls' value to code block and
2) showing a code similar to what component consumers would write.

To archive these goals, this feature compiles a component with Vue, then
walks through vdom and stringifys the result. It could be possible to
parse components' template or render function then stringify results,
but it would be costly and hard to maintain (especially for parsing).
We can use vue-template-compiler for the purpose, but it can't handle
render functions so it's not the way to go IMO.

Speaking of the goal 2, someone wants events to be in the output code.
But it's so hard to retrieve component definitions (e.g. `methods`,
`computed`). I think it's okay to skip events until we figure there is a
high demand for that.
2020-10-18 13:38:57 +00:00
Blaine Bublitz
9e75d3efe1 Introduce undefined/null value filtering in jsxDecorator 2020-09-02 18:25:39 -07:00
blackfenix2
11f6dfaf84 added unit test. 2020-09-02 00:08:46 -04:00
Michael Shilman
47a861ce6c Dynamic source: Add test cases 2020-06-27 09:42:23 +08:00
Michael Shilman
dbbf98f5d1 Source: Add jsxDecorator from storybook-addon-jsx 2020-06-21 22:13:18 +08:00
Gaëtan Maisse
4a5d7101d6
chore(docs): add missing dependencies
- `@storybook/core` is used to find `coreDirName` in `preset.ts`
- `tslib` is needed because this package is a peerDeps of `@angular/core`
- `@types/estree` is used in `acornParser`

Also:
 - Remove `@ts-ignore`
2020-05-01 16:56:57 +02:00
Norbert de Langen
e44111cfa3
FIX types 2020-04-30 19:55:19 +02:00
Norbert de Langen
f03f427e63
IMPROVE typings && FIX tests by catching error when cleaning tmp dir 2020-04-30 18:45:31 +02:00
Norbert de Langen
d78d235b5d
IMPROVE typings && CORRECT usage of DocGenButton 2020-04-22 17:48:54 +02:00
Michael Shilman
c8c19a2e4e Props: #9592 styled repro 2020-02-15 00:06:34 +08:00
Michael Shilman
eeab514f98 Addon-docs: Cleanup angular properties tests 2020-02-14 12:54:17 +08:00
Michael Shilman
61545c386e Addon-docs: React properties snapshot testing 2020-02-13 10:58:37 +08:00
patrick.lafrance
421f61e6d2 Code review corrections 2019-12-03 22:11:10 -05:00
Michael Shilman
884962b787 Addon-docs: Add unified preset, deprecate framework-specific presets 2019-11-11 14:56:17 +08:00
Michael Shilman
85637aa9d5 Addon-docs: Clean up config using global addParameters 2019-10-26 16:46:19 +08:00
Michael Shilman
492f1ae7ed Addon-docs: Fix typescript errors 2019-10-20 19:40:08 +08:00
atanasster
bd8385343a lint 2019-09-04 15:05:13 -04:00
atanasster
1b72d39cf5 added declare module 'global'; 2019-09-04 15:02:49 -04:00
Michael Shilman
f72bca8f16 Addon-docs: Pass everything through babel & partial TS conversion 2019-08-01 20:44:16 +08:00
Michael Shilman
8f2f3e503d Addon-docs: Add typings 2019-06-22 02:45:37 +08:00