Overview
Version 6.0.0 represents a complete rewrite ofapp-datepicker with modern web technologies. This guide helps you migrate from versions 4.x and 5.x to the latest 6.0.0-rc.33 release.
Current Version
The latest release is 6.0.0-rc.33 (released March 25, 2023).Breaking Changes
Lit 3.x Upgrade
Version 6.0.0 has been upgraded to use Lit 3.x, which introduces several breaking changes:Lit 3.x Breaking Changes
Lit 3.x Breaking Changes
Key changes:See the Lit upgrade guide for complete details.
- The
@lit/reactive-element,lit-element, andlit-htmlpackages are now consolidated into thelitpackage - Updated decorator syntax and behavior
- New reactivity system with improved performance
- TypeScript types are now included in the main package
TypeScript 5.3+ Required
Version 6.0.0 now requires TypeScript 5.3.3 or higher for TypeScript users.If you’re not using TypeScript, you can ignore this requirement. However, the element is compiled with features targeting ES2021.
package.json:
ES2021 Target
The element is now compiled targeting ES2021 features. You may need to transpile the package for older browser support. Supported browsers:- Chrome/Edge 100+
- Firefox 96+
- Safari 15.4+
Element Naming and Structure
Complete Rewrite with New Architecture
Complete Rewrite with New Architecture
Version 6.0.0 was completely rewritten from the ground up with a new component architecture:Major architectural changes:
- Moved from Polymer-style to modern Lit patterns
- Improved styling system with CSS custom properties
- Enhanced keyboard navigation and accessibility
- Better Material Design 2021 compliance
- Refactored internal components for better modularity
DatePickerInput- Enhanced with lazy loading support via.lazyLoadpropertyDatePickerDialog- Improved dialog behavior with clean slate on re-openIconButton- Custom implementation to fix rendering bugs in Material Web Components- Year Grid and Month Calendar - Completely refactored with better performance
API Changes
Property and Method Changes
Property and Method Changes
New features added:
-
DatePickerInput properties:
disabled- Disable the date picker inputreadonly- Make the input read-onlyvalueAsDate- Get/set value as Date objectvalueAsNumber- Get/set value as timestamp
-
Lazy loading support:
-
Export parts:
- New CSS parts exposed:
today,toyear,calendar,yearGrid - Allows better styling customization through
::part()selector
- New CSS parts exposed:
- Date picker now always opens in calendar view (not year view)
- Dialog re-opens with a clean slate instead of previous state
- Improved
.layout()method timing for property updates
Styling Changes
CSS Custom Properties
CSS Custom Properties
Version 6.0.0 includes major refactoring for Material Design 2021 compatibility:Simplified CSS Custom Properties:The styling system has been simplified and standardized. Many CSS custom properties were consolidated or renamed.Material Design 2021 updates:
- Updated shape values (4px border radius)
- Improved color system alignment with MD2021
- Better scrim color customization
- Enhanced styling for disabled and readonly states
Dependency Updates
Material Web Components
Material Web Components
Version 6.0.0 uses Material Web Components 0.27.0:
Material Web Components may have their own breaking changes. Review their documentation if you use them directly.
Migration Steps
1. Update Dependencies
Update yourpackage.json:
2. Update Import Statements
Change all Lit imports to use the consolidated package:3. Review Property Usage
Check if you’re using any properties that may have changed behavior:4. Update Custom Styles
Review and update any custom CSS:5. Test Thoroughly
After migration:- Test all date picker interactions - Ensure calendar navigation works
- Verify event handlers - Check that date selection events still fire correctly
- Test keyboard navigation - Verify accessibility improvements
- Check responsive behavior - Test on different screen sizes
- Validate form integration - If using in forms, test submission
Version-Specific Notes
From 4.x to 6.x
Major Version Jump
Major Version Jump
If you’re upgrading from version 4.x, you’re skipping version 5.x entirely. Version 6.0.0-rc.0 was released in November 2021, representing a complete rewrite from version 4.5.1.Key differences from v4:
- Complete rewrite with Lit 3.x (v4 used lit-element 2.x)
- New component architecture
- Better TypeScript support
- Improved accessibility
- Material Design 2021 updates
- Removed Polymer dependencies
- Better bundle size and performance
- Review all component APIs - many internals were refactored
- Test all custom event handlers
- Verify polyfill requirements (still need Intl.DateTimeFormat)
From 5.x to 6.x
Version 5.x was a transitional branch. The main changes are similar to those from 4.x, with the addition of Lit 3.x upgrade requirements.
Older Versions
Documentation and code for older versions are available on separate branches:Polyfills
Version 6.0.0 still requires the same polyfills as previous versions:Required Polyfills
Intl.DateTimeFormat and Array.prototype.find
Intl.DateTimeFormat and Array.prototype.find
Intl.DateTimeFormat - Required for date formatting:Array.prototype.find - Required for array operations:
Getting Help
If you encounter issues during migration:- Check the changelog - Review CHANGELOG.md for detailed changes
- Review API documentation - See the component API references for updated properties
- Check GitHub Issues - Search for existing issues
- Join Discord - Get community support on the app-datepicker Discord
Summary Checklist
Use this checklist to ensure a smooth migration:- Update
package.jsondependencies (app-datepicker, lit, TypeScript) - Update all Lit imports to use consolidated
litpackage - Update decorator imports to
lit/decorators.js - Review and update TypeScript configuration (if applicable)
- Update custom CSS using new CSS parts and variables
- Test date picker functionality thoroughly
- Verify keyboard navigation and accessibility
- Check browser compatibility for ES2021 target
- Update polyfills if supporting older browsers
- Review Material Web Components changes (if using them)
The effort required for migration depends on how extensively you’ve customized the components. Most applications with standard usage should only need dependency and import updates.