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

Svelte: Support v4 #22905

Merged
merged 18 commits into from
Jun 23, 2023
Merged

Svelte: Support v4 #22905

merged 18 commits into from
Jun 23, 2023

Conversation

JReinhold
Copy link
Contributor

@JReinhold JReinhold commented Jun 3, 2023

What I did

  • Expanded the dependency ranges to support Svelte v4

How to test

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

@JReinhold JReinhold added ci:daily Run the CI jobs that normally run in the daily job. patch:yes Bugfix & documentation PR that need to be picked to main branch maintenance User-facing maintenance tasks labels Jun 3, 2023
@socket-security
Copy link

socket-security bot commented Jun 3, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

@JReinhold
Copy link
Contributor Author

@shilman @yannbf this should be patched back to 7.0 (once everything is confirmed to be working ofc) because of the expanded version range, but I'm not sure if the changes to templates should too, since they now install svelte@next instead of latest. Will it have an affect on the CI we run for main/7.0, the status page, or something else?

@JReinhold JReinhold changed the title Svelte: Support Svelte 4 beta Svelte: Support svelte@next - v4 Jun 3, 2023
@JReinhold JReinhold marked this pull request as ready for review June 5, 2023 07:20
@JReinhold JReinhold requested a review from a team as a code owner June 5, 2023 07:20
@socket-security
Copy link

socket-security bot commented Jun 7, 2023

New and updated dependency changes detected. Learn more about Socket for GitHub ↗︎

Copy link
Contributor

@kasperpeulen kasperpeulen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing approval here

@JReinhold
Copy link
Contributor Author

@kasperpeulen do you know why types are failing here? https://app.circleci.com/pipelines/github/storybookjs/storybook/52536/workflows/580c415a-ebab-4aa8-97e9-58cd32596d46/jobs/544399 (I can reproduce this locally)

It's failing here because it can't find the 'svelte/compiler' module, but I can't reproduce this outside of our Storybook repo. In a separate project, doing the same import (import { preprocess } from 'svelte/compiler';) and going to definition correctly takes you here: https://github.com/sveltejs/svelte/blob/master/src/compiler/preprocess/index.ts#L210

Are we configuring TypeScript in a way that doesn't support these direct-to-JS definitions, or something else?

cc @benmccann

@benmccann
Copy link
Contributor

Thanks for testing! We'll release a new version in the next day or two, which should hopefully fix this

@benmccann
Copy link
Contributor

4.0.0-next.2 is now out. Can you check if it fixes it?

@dummdidumm
Copy link

The svelte/internal thing failing is expected - we deliberatly removed those types to discourage their use. You can still use them, but you need to silence the type error. Probably best to talk about the need to use svelte/internal separately in Discord. I suspect there are more projects in the ecosystem resorting to internal methods to accomplish certain tasks, and we want to make sure they are properly supported in Svelte 5.

@ndelangen ndelangen self-assigned this Jun 21, 2023
@JReinhold
Copy link
Contributor Author

Thanks for the detailed description @dummdidumm. We're planning to remove this area of the code soon, so I wouldn't worry too much about looking into long term support of the internal features that we use there.

@ndelangen ndelangen removed their assignment Jun 21, 2023
@JReinhold JReinhold changed the title Svelte: Support svelte@next - v4 Svelte: Support v4 Jun 22, 2023
@JReinhold JReinhold merged commit 96b838b into next Jun 23, 2023
@JReinhold JReinhold deleted the svelte-4 branch June 23, 2023 11:23
@shilman
Copy link
Member

shilman commented Jun 23, 2023

@JReinhold I don't feel great about patching this back to 7.0 since it's technically a breaking change. Before users did not have to have svelte installed, and now they do. It's a corner case, but I'd much rather have this only go out in a minor release. Are you ok with that?

@JReinhold
Copy link
Contributor Author

@JReinhold I don't feel great about patching this back to 7.0 since it's technically a breaking change. Before users did not have to have svelte installed, and now they do. It's a corner case, but I'd much rather have this only go out in a minor release. Are you ok with that?

We discuss this a bit here. #22905 (comment)

I would consider this a bug fix more than a breaking change. And that any users that are affected by this are relying on a bug.
And for semver there's really no difference between patch and minor for most users.

But it's your call.

@shilman
Copy link
Member

shilman commented Jun 23, 2023

@JReinhold Ok I'm fine with that. Just wanted to discuss first

shilman pushed a commit that referenced this pull request Jun 27, 2023
Svelte: Support v4
(cherry picked from commit 96b838b)
@JReinhold JReinhold added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jun 27, 2023
@JReinhold JReinhold mentioned this pull request Jul 6, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:daily Run the CI jobs that normally run in the daily job. maintenance User-facing maintenance tasks patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants