Open
Conversation
This is a comprehensive modernization of the TimelineJS3 codebase to use modern JavaScript patterns and APIs while maintaining backward compatibility with the existing data model. ## Major Changes ### Event System - Replace custom Events class with native EventTarget - All classes now extend EventTarget for standard browser event handling - Maintains backward-compatible API (on/off/fire methods) ### Class Inheritance - Remove custom TLClass.extend() pattern - Convert all classes to ES6 class syntax with native extends - Remove classMixin() pattern in favor of proper inheritance chain - Create clear inheritance: EventTarget → Events → I18NMixins → DOMMixins ### Animation System - Replace legacy Morpheus-based animation (420+ lines) with modern implementation - Use Web Animations API with CSS transitions fallback - Simpler, more performant, and standards-compliant - Maintains same API for backward compatibility ### Browser Support - Remove all IE-specific detection and workarounds - Remove obsolete browser checks (IE9, Opera, etc.) - Use modern browser APIs exclusively - Simplified Browser.js from 68 to 44 lines ### DOM Utilities - Modernize DOM.js to use current browser APIs - Use getBoundingClientRect() for positioning - Simplify transform handling with modern CSS - Better JSDoc documentation ### Async Patterns - Convert callback-based makeConfig() to return Promises - Maintain backward compatibility with deprecated callback support - Use async/await throughout for cleaner async code - Replace ajax() calls with modern fetch() ### Date Classes - Convert TLDate, BigDate, BigYear from TLClass.extend to ES6 classes - Use const/let instead of var - Maintain all functionality and data model compatibility ## Files Modified (25 files) - Core: Events.js, Browser.js, ConfigFactory.js, Util.js (removed TLClass.js) - DOM: DOM.js, DOMMixins.js - Animation: Animate.js - Date: TLDate.js - Language: I18NMixins.js - UI: Draggable.js, MenuBar.js, Message.js, Swipable.js - Timeline: Timeline.js - TimeNav: TimeAxis.js, TimeEra.js, TimeGroup.js, TimeMarker.js, TimeNav.js - Slider: Slide.js, SlideNav.js, StorySlider.js - Media: Media.js, types/Text.js ## Backward Compatibility - Public Timeline API unchanged - Data model completely unchanged - Legacy callback support maintained with deprecation warnings - All existing timelines will continue to work ## Benefits - Modern, maintainable codebase - Better IDE support and autocomplete - Smaller bundle size (removed 400+ lines of legacy code) - Standards-compliant with native browser APIs - Easier to contribute to and understand
Modern browsers no longer need IE-specific handling for PDFs. Simplified logic to only use Google Docs viewer for Dropbox URLs which need special handling.
|
Have been waiting for this for some time now and will be following this closely so I can bring things up to date in code :) Thankyou @JoeGermuska ! Can confirm that this PR works prefectly in place in existing code, and nice not to have all the warnings and manual fixes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I used some Claude Code credits to modernize the code base. The goal is to not have any visible changes. So far it seems to work, but since it's not urgent, i'll wait to merge until some more testing can happen.