-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vue: Improve generated code snippets #27194
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 22938b9. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
Relates to #1078, #414 - simplified some Stories - refactor oynx icon import code transformer to work globally so we don't need to add it to every component that uses icons - temporarily copy over improved source code generation until it is released in Storybook itself (see storybookjs/storybook#27194)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, @larsrickert! I had some old TODOs regarding slots because the generated code wasn't handling edge cases properly.
@larsrickert Should be Let me now when you are finished with this! |
…typing Next.js: Add typing for NextImage to main framework options type (cherry picked from commit 46646d2)
…ypes-for-framework-builder-fields Types: Fix typing for main.framework/builder fields (cherry picked from commit 1ae28db)
Next.js: Avoid conflicts with the raw loader (cherry picked from commit f5fc402)
25eda56
to
4428320
Compare
@kasperpeulen @chakAs3 This PR is done now from my side :) Would appreciate if you guys have some time to review it. I have already copied over the changes of this PR into our onyx Storybook for a few weeks now and it works pretty fine so you can also check it out on a live Storybook there if you like. |
Merge latest changes of storybookjs/storybook#27194. Fixes code snippets when using slot bindings on a deployed Storybook <img width="305" alt="image" src="https://github.com/SchwarzIT/onyx/assets/67898185/15230312-5c5e-46eb-90a5-c9c9d422b604">
I explored the Onyx Storybook and was thoroughly impressed by the multitude of complex snippets. This is a killer feature improvement that sets it apart from other renderers. Plus, integrating this with the vue-component-meta makes the Docs page look incredibly rich. The StorybookVue community should definitely celebrate this achievement. Great job, @larsrickert! @larsrickert |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The result is awesome, it works fabulously
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, we will release this next for 8.2.1 :)
8.2.0 is already feature frozen
Could you resolve the conflicts @larsrickert ?
@chakAs3 Thanks a lot for the positive feedback! I also think that this is a very advanced feature for the Vue renderer 👍 Should we perhaps write a blog post that showcases the new features? I could collaborate with @joevaugh4n on this @kasperpeulen Merge conflicts are resolved, feel free to release it whenever it fits your schedule :) |
@larsrickert Personally, I still find it one of the most—if not the most—attractive features in Storybook, and a blog post about it would certainly highlight its appeal However there still some conflicts |
@larsrickert At this moment @shilman is managing the blog. 💯 Let's do a blog about this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
@larsrickert Could you check the CI failures? |
…urce-code Vue: Improve generated code snippets (cherry picked from commit 6356195)
relates to #26691
What I did
I created a new improved Vue source code generator that has several improvements compared to the current one:
my-prop
instead of:my-prop="true"
my-prop='"I am double quoted"'
, useful if e.g. passing SVG icon content as props:my-props="['a', 'b']"
), currently they are generated as object (:my-prop="{0:'a',1: 'b'}"
) which is incorrect<template #default>
for default slot without bindings<script lang="ts" setup>
(automatically move arrays and objects there)Here is an example which compares the most important features of this PR:
Old:
New:
As reference, here is the Story source for the above example:
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
yarn task --task sandbox --start-from auto --template vue3-vite/default-ts
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli/src/sandbox-templates.ts
Make sure this PR contains one of the labels below:
Available labels
bug
: Internal changes that fixes incorrect behavior.maintenance
: User-facing maintenance tasks.dependencies
: Upgrading (sometimes downgrading) dependencies.build
: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup
: Minor cleanup style change. Will not show up in release changelog.documentation
: Documentation only changes. Will not show up in release changelog.feature request
: Introducing a new feature.BREAKING CHANGE
: Changes that break compatibility in some way with current major version.other
: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/core
team here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>