creative-web-solution/front-polyfill-bundle
Array.prototype.forEach, Object.entries, IntersectionObserver), reducing reliance on bloated universal polyfill libraries like core-js or polyfill.io. Supports progressive enhancement by loading only required polyfills per user/device.polyfill-domch-eachnl.js instead of loading all polyfills).Intl or Firefox lacking ResizeObserver).Promise polyfill to IE11 when your app doesn’t need it).core-js or babel-polyfill.polyfill-service or core-js instead.navigator.userAgent). This package requires manual configuration.<script> tag or core-js."This package lets us serve lightweight, targeted polyfills to older browsers—only what’s needed—without bloating our app’s performance. For example, if a user’s browser lacks IntersectionObserver, we’ll dynamically load just that polyfill (e.g., polyfill-io-observer.js), not a 50KB library. This aligns with our performance goals and reduces bandwidth costs, especially for mobile users. It’s a low-code solution that avoids reinventing the wheel, with minimal dev overhead."
Key Outcomes:
*"This Symfony bundle automates polyfill generation via Twig templates and YAML config, eliminating manual if (typeof X === 'undefined') checks in JavaScript. It supports two loading strategies:
js/polyfill-domch-eachnl.js (cached by Symfony).polyfill.js?domch&eachnl).Why it’s better than alternatives:
active: true for picture element support).Trade-offs:
Proposed Workflow:
composer.json.config.yaml to list needed polyfills (e.g., domch, eachnl).get_front_polyfill_list() to generate scripts dynamically.Next Steps:
core-js) to identify redundancies.polyfill.io for our top 5 browsers.Intl polyfill for Safari)."*How can I help you explore Laravel packages today?