Skip to content
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

Restore & add support for legacy syntax #186

Merged
merged 75 commits into from
Oct 16, 2024
Merged

Conversation

xeho91
Copy link
Collaborator

@xeho91 xeho91 commented Jul 5, 2024

Dependencies

Requires #181 to be merged first.

Objectives

Support for legacy components for backward compatibility:

  1. <Meta>

    • codemod - <Meta> to defineMeta & insertion into <script context="module">
    • tests
  2. <Story>

    • tests
    • codemods:
      • transform let:args & let:context directives to inner children snippet block
      • transform autodocs prop to tags={["autodocs"]}
      • transform source by removing when is a shorthand or to parameters.docs.source.code
      • transform template prop to children={<template identifier>}
  3. <Template>

    • codemods - replace component with snippet block
    • tests

Add addon options - StorybookAddonSvelteCsfOptions

  • update addon's Vite plugin - add pre-transform hook
  • add option supportLegacy

Deprecation warnings, errors, messages

  • document new errors
  • Ensure deprecation warnings are visible enough while writing stories code:
    - writing the code (with TypeScript support and marking <Template> as deprecated)
  • log deprecated warnings at runtime

Update stories tests

  • Using LegacyTemplate component
  • Using LegacyStory component (and its legacy props)
  • Using Meta component

Update indexer

  • Support indexing legacy export const meta syntax
  • Support indexing legacy Meta component

TODO


📦 Published PR as canary version: 4.2.0--canary.186.ff8a94d.0

✨ Test out this PR locally via:

npm install @storybook/[email protected]
# or 
yarn add @storybook/[email protected]

Version

Published prerelease version: v5.0.0-next.4

Changelog

💥 Breaking Change

🚀 Enhancement

🐛 Bug Fix

🏠 Internal

  • refactor: Improve AST-related types readability & fix existing issues #209 (@xeho91)

Authors: 4

@xeho91 xeho91 added enhancement New feature or request help wanted Extra attention is needed minor Increment the minor version when merged prerelease This change is available in a prerelease. labels Jul 5, 2024
@xeho91 xeho91 self-assigned this Jul 5, 2024
@xeho91 xeho91 marked this pull request as draft July 5, 2024 05:28
@JReinhold JReinhold changed the base branch from next to experimental-support-svelte-v5 July 6, 2024 21:36
@xeho91 xeho91 changed the title Restore & support legacy <Template> component Restore & add support for legacy syntax Jul 8, 2024
@xeho91 xeho91 marked this pull request as ready for review July 15, 2024 11:56
@JReinhold JReinhold merged commit 0dcacba into next Oct 16, 2024
6 of 7 checks passed
@JReinhold JReinhold deleted the restore-template-component branch October 16, 2024 18:20
@shilman
Copy link
Member

shilman commented Oct 16, 2024

🚀 PR was released in v5.0.0-next.4 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed minor Increment the minor version when merged prerelease This change is available in a prerelease.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants