Modernize to ES modules (Phases 1-3, GA4, iOS12 compat)#1077
Open
devin-ai-integration[bot] wants to merge 5 commits into
Open
Modernize to ES modules (Phases 1-3, GA4, iOS12 compat)#1077devin-ai-integration[bot] wants to merge 5 commits into
devin-ai-integration[bot] wants to merge 5 commits into
Conversation
Complete rewrite of freedom-video-player engine:
Phase 1 — Quick wins:
- Updated browserslist to modern browser floor
- Removed IE/old-browser polyfills (matches, CSSStyleDeclaration, rAF fallback)
- Removed Flash references and webkit-playsinline (keep playsinline)
- Replaced document.execCommand('copy') with navigator.clipboard (iOS12 fallback)
Phase 2 — Dependency removal:
- Replaced bean event library with native addEventListener via domOn/domOff/domOne
- Replaced class-list with native classList
- Replaced computed-style with native getComputedStyle()
- Replaced extend-object with Object.assign()
- Replaced is-function with typeof checks
- Removed punycode dependency
- Zero runtime dependencies
Phase 3 — Architecture:
- Simplified support.js: removed IE/WP/Silk/old-Android detection
- Simplified fullscreen.js: standard API + webkit fallback only
- Cleaned up mobile.js: removed IE Mobile, old Android workarounds
- Replaced <a> controls with <button> elements
- Only inject active skin SVG pair (not all 8 variants)
- Migrated from browserify/CommonJS to Rollup/ES modules
Additional:
- Rewrote analytics.js for GA4/gtag (replaced deprecated UA)
- Converted entire codebase to TypeScript with strict mode
- All iOS < 15 workarounds marked with // iOS12-COMPAT: comments
- Build produces UMD, minified, and ESM outputs
- TypeScript declarations in dist/types/
- Maintained jQuery bridge for WordPress plugin compatibility
Co-Authored-By: martinv <martinv@foliovision.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
PostCSS errored with 'contains both browserslist and package.json with browsers'. The browserslist targets are already defined in package.json. Co-Authored-By: martinv <martinv@foliovision.com>
… in package.json) Co-Authored-By: martinv <martinv@foliovision.com>
Co-Authored-By: martinv <martinv@foliovision.com>
- Convert all .ts files back to .js while keeping modernization intact - Remove TypeScript, tslib, @rollup/plugin-typescript from dependencies - Remove tsconfig.json and type declarations - Fix pick() bug: merge picked source into video object before engine.load() - Fix trigger() to return event object when returnEvent=true - Update test/minimal.html with working CDN video URL - Build is faster (no TS compilation), output is identical - Tested: video plays successfully in test/minimal.html Co-Authored-By: martinv <martinv@foliovision.com>
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.
Summary
Major modernization of the Freedom Player engine for 2026 web standards. All source files converted from CommonJS to plain ES modules, bundled with Rollup (replacing Browserify).
Phase 1 — Quick wins: Removed
requestAnimationFramepolyfill, Flash references, vendor prefix cleanup. Updatedbrowserslist. Replaceddocument.execCommand('copy')withnavigator.clipboard(iOS 12 fallback kept).Phase 2 — Dependency removal (6 packages → 0):
bean→ native addEventListener with namespace support,class-list→ classList,computed-style→ getComputedStyle(),extend-object→ Object.assign(),is-function→ typeof,punycode→ removed.Phase 3 — Architecture: Simplified support.js/fullscreen.js/mobile.js (removed IE/WP/Silk/old-Android code). Migrated to Rollup/ES modules. Build outputs: UMD, minified, ESM.
GA4: Rewrote analytics.js from deprecated Universal Analytics to GA4/gtag.
iOS 12 compat: All iOS < 15 workarounds marked with
// iOS12-COMPAT:for future removal. jQuery bridge preserved for WordPress plugin.Review & Testing Checklist for Human
This is a full engine rewrite — high risk. Thorough testing is essential:
freedomplayer.min.jsin the WP plugin with this build and verify the player works on foliovision.com$('.freedomplayer').data('flowplayer')returns the player APIRecommended test plan:
dist/freedomplayer.min.jsanddist/skin/skin.cssinto the WordPress pluginNotes
skin/sass/_media.scssline 17 is pre-existing and unrelated to this PRmake allproduces the full zip with JS + CSS + fontsLink to Devin session: https://app.devin.ai/sessions/7368b1339e3b4ecdabb1374ff52330a3