{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-legacy-js-a6c1f170e2d8","title":"Avoid Serving Legacy JavaScript to Modern Browsers","summary":"Serve modern JavaScript to compatible browsers to reduce overhead, improve load times, and optimize performance by eliminating unnecessary polyfills and transpiled ES5 code.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-legacy-js-a6c1f170e2d8","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-legacy-js-a6c1f170e2d8","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-legacy-js-a6c1f170e2d8.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-legacy-js-a6c1f170e2d8\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Verify the actual bottleneck in DevTools, Lighthouse, or field data before recommending changes. Ensure the build configuration supports differential serving (module\/nomodule) and targets modern JavaScript standards.","instructions":"---\nname: legacy-js\ndescription: \"Use when auditing slow page loads, heavy assets, or rendering delays related to Avoid serving legacy JavaScript to modern browsers. Verify the actual bottleneck in DevTools, Lighthouse, or field data before recommending changes.\"\nmetadata:\n  category: performance\n  priority: medium\n  difficulty: intermediate\n  estimatedTime: \"10\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/performance\/legacy-js\n---\n\n# Avoid serving legacy JavaScript to modern browsers\n\nModern browsers can execute ES6+ code faster and more efficiently; serving them transpiled ES5 with polyfills adds unnecessary weight.\n\n## Quick Reference\n\n- Use differential serving (module\/nomodule) to target modern and legacy browsers\n- Avoid heavy ES5 polyfills for browsers that support ES6+\n- Compile code to modern targets to reduce bundle size and improve execution speed\n\n## Check\n\nAnalyze the project's JavaScript output to see if modern browsers are being served unnecessary ES5 code and polyfills.\n\n## Fix\n\nUpdate the build configuration to use differential serving and set a modern target for your primary JavaScript output.\n\n## Explain\n\nExplain how serving ES6+ code to modern browsers improves performance and why transpiling everything to ES5 is no longer recommended.\n\n## Code Review\n\nReview the routes, assets, and loading behavior that affect Avoid serving legacy JavaScript to modern browsers. Flag exact files, requests, or rendering steps that add unnecessary network, CPU, or layout cost, and describe the measurement method used to confirm the issue.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/performance\/legacy-js\n","use_cases":["Auditing page load performance to identify unnecessary ES5 code served to modern browsers","Improving rendering speed by eliminating polyfills for ES6+ compatible browsers","Reducing bundle size and improving execution speed by targeting modern JavaScript standards"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/legacy-js\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-23","created_at":"2026-11-22T16:53:12.000000Z","updated_at":"2026-11-23T04:55:22.000000Z","seo_title":"Avoid serving legacy JS to modern browsers","seo_description":"Optimize performance by serving modern JavaScript to modern browsers, reducing unnecessary overhead and improving load times.","seo_keywords":["optimize JavaScript performance","modern browser JavaScript","avoid legacy JS overhead","reduce ES5 polyfill usage","improve page load speed"]}}