Version 2.0.0 migrates the Svelte adapter to Svelte 5. This is a breaking change for Svelte users.
- Svelte users: Must upgrade to Svelte 5
- React users: No changes required
- Vue users: No changes required
-
Svelte 4 is no longer supported
- Peer dependency changed from
^4.0.0 || ^5.0.0to^5.0.0
- Peer dependency changed from
-
App mounting syntax changed
- import App from './App.svelte'; - const app = new App({ target: document.getElementById('app') }); + import { mount } from 'svelte'; + import App from './App.svelte'; + const app = mount(App, { target: document.getElementById('app') });
-
Component props syntax changed (if you're extending Shimmer)
- export let loading = true; - export let shimmerColor = undefined; + let { loading = true, shimmerColor = undefined } = $props();
-
Reactive state syntax changed (in your own components)
- let isLoading = true; + let isLoading = $state(true);
-
Update dependencies
npm install svelte@^5.0.0 @sveltejs/vite-plugin-svelte@^4.0.0 svelte-check@^4.0.0
-
Update your
main.ts(if using the old mounting syntax)import { mount } from 'svelte'; import App from './App.svelte'; mount(App, { target: document.getElementById('app')! });
-
Update your components to use Svelte 5 runes (optional but recommended)
export let prop→let { prop } = $props()let x = value→let x = $state(value)$: derived = ...→const derived = $derived(...)$: { ... }→$effect(() => { ... })
If you cannot upgrade to Svelte 5, pin your dependency to v1.x:
npm install @shimmer-from-structure/svelte@^1.1.0Version 1.0.0 introduces a monorepo structure with support for both React and Vue. This guide will help you migrate from the previous single-package version.
For React users, the migration is seamless:
- Your existing code will continue to work without changes
- All imports remain the same (
'shimmer-from-structure') - No breaking changes to the API
- No action required!
Before (v0.7.0):
shimmer-from-structure/
├── src/
│ ├── Shimmer.tsx
│ ├── ShimmerContext.tsx
│ └── types.ts
└── package.json
After (v1.0.0):
shimmer-from-structure/
├── packages/
│ ├── core/ # Framework-agnostic
│ ├── react/ # React adapter
│ ├── vue/ # Vue adapter (NEW!)
│ └── shimmer-from-structure/ # Main package (re-exports React)
No changes needed! The main package continues to provide the React adapter for backward compatibility:
// This still works exactly as before
import { Shimmer, ShimmerProvider } from 'shimmer-from-structure';For Vue users (new):
// Use the Vue-specific package import { Shimmer, provideShimmerConfig } from
'@shimmer-from-structure/vue';Advanced: Explicit imports (optional for React users who want to be specific):
// React - explicit import
import type { ShimmerConfig } from '@shimmer-from-structure/react';
import { Shimmer } from '@shimmer-from-structure/react';
// Or use subpath export from main package
import { Shimmer } from 'shimmer-from-structure/vue';Your existing code works as-is. The main shimmer-from-structure package continues to provide the React adapter.
# Just update to the latest version
npm update shimmer-from-structureThat's it! Your imports and code remain unchanged.
If you want to be explicit about using the React adapter:
- import { Shimmer, ShimmerProvider } from 'shimmer-from-structure';
+ import { Shimmer, ShimmerProvider } from '@shimmer-from-structure/react';But this is entirely optional - the old import still works!
If you're starting fresh with Vue:
npm install shimmer-from-structure<script setup>
import { Shimmer } from 'shimmer-from-structure/vue';
// or auto-detect: import { Shimmer } from 'shimmer-from-structure';
</script>See VUE_README.md for complete Vue documentation.
All existing APIs remain the same:
<Shimmer>component - same props<ShimmerProvider>- same APIuseShimmerConfig- same hook- All configuration options - identical
Vue users get equivalent APIs:
<Shimmer>component (with Vue slots)provideShimmerConfig()functionuseShimmerConfig()composable
Issue: Type errors or missing IntelliSense
Solution: Clear your TypeScript cache and restart your IDE:
# Delete node_modules and reinstall
rm -rf node_modules package-lock.json
npm installEach package can be developed/tested independently:
npm run build:core # Build core utilities
npm run build:react # Build React adapter
npm run build:vue # Build Vue adapter
npm run build:main # Build main package- Smaller bundles: Only the code for your framework is included
- Better tree-shaking: Framework-agnostic core is shared
- Explicit dependencies: Clear separation between frameworks
Compared to v0.7.0, the packages are now smaller and more modular:
| Package | Size (ESM) | What's Included |
|---|---|---|
@shimmer-from-structure/core |
1.44 kB | DOM measurement logic |
@shimmer-from-structure/react |
12.84 kB | React-specific code + core |
@shimmer-from-structure/vue |
3.89 kB | Vue-specific code + core |
Before (v0.7.0): ~13 kB for React (with duplicated code)
After (v1.0.0): ~12.84 kB for React (optimized structure)
- React users: No action needed! Your code continues to work.
- Vue users: See VUE_README.md
- Issues: Open a GitHub issue
Happy shimmer-ing! ✨