-
Notifications
You must be signed in to change notification settings - Fork 1
Migration Guide
This guide helps you migrate between major versions of LARC packages. LARC follows Semantic Versioning:
- PATCH updates (1.0.x) - Safe to update, no changes needed
- MINOR updates (1.x.0) - Safe to update, new features are opt-in
- MAJOR updates (x.0.0) - May require code changes
| From Version | To Version | Migration Needed |
|---|---|---|
| 0.x | 1.0.x | No breaking changes |
| 1.0.x | 1.0.y | No changes needed (PATCH) |
| 1.x | 1.y | No changes needed (MINOR) |
| 1.x | 2.0 | See guide below |
Good News: LARC 1.0 introduces zero breaking changes to the core APIs. Upgrade safely!
- Component autoload system (opt-in)
- Router and navigation components
- WebSocket bridge component
- IndexedDB bridge component
- New UI components
- Comprehensive test suite (80%+ coverage)
- Performance benchmarks (300k+ msg/sec)
- Enhanced error handling
- Better memory management
- Improved TypeScript support
- Extended browser compatibility documentation
# npm
npm install @larcjs/core@^1.0.0
# yarn
yarn add @larcjs/core@^1.0.0
# pnpm
pnpm add @larcjs/core@^1.0.0npm testAutoloader (Recommended)
<!-- Before (0.x): Manual imports -->
<script type="module">
import './components/pan-bus.mjs';
import './components/pan-client.mjs';
</script>
<!-- After (1.0): Automatic loading -->
<script type="module">
import '@larcjs/core/pan.mjs';
</script>
<!-- Components load automatically when needed -->Enhanced Client API
// Before (0.x): Still works in 1.0
const client = new PanClient();
await client.ready();
// After (1.0): New convenience methods
const data = await client.request('user.get', { id: 123 }, { timeout: 5000 });All core APIs unchanged:
-
PanBuscomponent and configuration -
PanClientmethods (publish, subscribe, request) - PAN message envelope format
- Topic naming conventions
- CustomEvent names (pan:publish, pan:deliver, etc.)
LARC 2.0 is a major release with modular packages for better tree-shaking and smaller bundles.
Before (1.x):
npm install @larcjs/coreAfter (2.0):
# Core packages
npm install @larcjs/core-lite # 9KB - Basic messaging
npm install @larcjs/core # 40KB - Full featured
npm install @larcjs/core-routing # +8KB - Message routing
npm install @larcjs/core-debug # +3KB - Debug toolsBefore (1.x):
import { PanClient, PanBus } from '@larcjs/core';After (2.0):
// From core-lite (smaller bundle)
import { PanClient } from '@larcjs/core-lite';
// Or from full core (includes all features)
import { PanClient, PanBus } from '@larcjs/core';-
Choose your package:
-
@larcjs/core-lite- For most apps (9KB) -
@larcjs/core- Full featured (40KB)
-
-
Update imports if using core-lite
-
Add optional packages as needed:
npm install @larcjs/core-routing # If you need routing npm install @larcjs/core-debug # For development
-
Run tests
Current Status (v2.0.x)
- Stability: HIGH - Core APIs are locked
- Breaking Changes: Package restructuring from 1.x
- Deprecations: None
Current Status (v2.0.x)
- Stability: MEDIUM - Components evolve more frequently
- Breaking Changes: None since 2.0.0
- Deprecations: None
| Redux | LARC |
|---|---|
| Store | PAN Bus + Retained Messages |
| Actions | PAN Topics |
| Reducers | Provider Components |
| Selectors | pan-computed-state |
| Middleware | store.use() |
| DevTools | pan-inspector |
| Context API | LARC |
|---|---|
| createContext() | PAN topic namespace |
| Provider | Provider components |
| useContext() | panClient.subscribe() |
- Read the Release Notes - Check CHANGELOG for breaking changes
-
Review Dependencies -
npm outdated - Check Compatibility - See Browser-Compatibility
-
Create a Feature Branch
git checkout -b upgrade-larc-2.0
-
Update One Package at a Time
npm install @larcjs/core@2.0.0 npm test -
Run Your Test Suite
-
Test in Development Environment
-
Monitor Deprecation Warnings
- Update Your Code - Replace deprecated APIs
- Update Documentation
- Deploy Gradually - Canary deployment recommended
- Read CHANGELOG.md for target version
- Read this migration guide
- Check browser compatibility requirements
- Create git feature branch
- Set up rollback plan
- Update package.json dependencies
- Run
npm install - Update code following migration guide
- Fix deprecation warnings
- Run test suite
- Test in development environment
- Update documentation
- Deploy to staging environment
- Perform QA testing
- Monitor error logs
- Gradual rollout to production
It's recommended for the smaller bundle sizes and modular packages. But 1.x code should work with minimal changes.
Most code will work. Main change is package restructuring for better tree-shaking.
Yes! Core-lite has the same API as the full core. Just install and update imports.
- Troubleshooting - Common issues and solutions
- GitHub Issues - Report migration problems
- GitHub Discussions - Ask questions