-
Notifications
You must be signed in to change notification settings - Fork 22
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
APP-2072 Migrate PRIME to Svelte 4. #265
APP-2072 Migrate PRIME to Svelte 4. #265
Conversation
The template is here for the taking, if we want it! |
If there is no opposition to it I don't mind setting it as our template. |
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.
🚀
Bundle size is down with Svelte 4! Before:
After:
|
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.
Tests and playground LGTM!
Is the minor version bump to 0.3.0 appropriate? I imagine we'll bump to 1.0.0 with the package restructure since that will be breaking.
Works for me. Since we're pre 1.0, 0.3.0
is not semver compatible with ^0.2.0
, which should cover our bases
.eslintrc.cjs
Outdated
@@ -5,6 +5,7 @@ module.exports = { | |||
env: { | |||
browser: true, | |||
}, | |||
parser: '@typescript-eslint/parser', |
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.
[Nit] I think this might be set by @viamrobotics/eslint-config
, and may not be needed. However, it is not harmful to include
src/elements/badge.svelte
Outdated
@@ -25,3 +22,7 @@ addStyles(); | |||
> | |||
{label} | |||
</small> | |||
|
|||
<style> | |||
@import './../../prime.css'; |
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.
[nit] does ./..
=== ../
?
@import './../../prime.css'; | |
@import '../../prime.css'; |
src/elements/badge.svelte
Outdated
@@ -25,3 +22,7 @@ addStyles(); | |||
> | |||
{label} | |||
</small> | |||
|
|||
<style> |
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.
Is this running through PostCSS? I thought this was necessary:
<style> | |
<style lang="postcss"> |
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.
✅
10534d8
to
ac4db69
Compare
ac4db69
to
379379e
Compare
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.
🎉 glad we arrived at this solution
0082355
to
eaf9b9a
Compare
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.
Looks great! One question about the need for dynamic imports in main, but that can be moved to the restructuring PR
const main = async () => { | ||
// These components are exported as pure Svelte components. | ||
const componentModules = { | ||
'v-badge': await import('./elements/badge.svelte'), |
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.
Can these become static imports since we removed the tag side effect?
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.
Yup, that's totally reasonable. We'll do that when we restructure the package.
@mcous thanks for the inspiration for PR descriptions :)
Overview
This migrates PRIME to Svelte 4. I wanted to do this migration before changing the package structure.
Change log
npx svelte-migrate@latest svelte-4
addStyles
helperattachInternals
range
prop to only accept a string - mixed types doesn't play well with web componentscreateEventDispatcher
directly -get_current_component
no longer worksReview requests
Pull down the branch and make sure:
pnpm run test
passespnpm run storybook
andpnpm start
Questions: