{"id":18632325,"url":"https://github.com/frejs/fre-ie","last_synced_at":"2025-10-06T01:37:09.874Z","repository":{"id":42847793,"uuid":"262297099","full_name":"frejs/fre-ie","owner":"frejs","description":"Make Fre work in IE8+ (NOT IE7)","archived":false,"fork":false,"pushed_at":"2023-01-06T05:18:56.000Z","size":1401,"stargazers_count":9,"open_issues_count":12,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-11T14:57:41.491Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frejs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-08T10:43:13.000Z","updated_at":"2025-03-15T17:27:47.000Z","dependencies_parsed_at":"2023-02-05T10:01:10.005Z","dependency_job_id":null,"html_url":"https://github.com/frejs/fre-ie","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/frejs/fre-ie","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frejs%2Ffre-ie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frejs%2Ffre-ie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frejs%2Ffre-ie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frejs%2Ffre-ie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frejs","download_url":"https://codeload.github.com/frejs/fre-ie/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frejs%2Ffre-ie/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278547772,"owners_count":26004772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T05:11:45.518Z","updated_at":"2025-10-06T01:37:09.846Z","avatar_url":"https://github.com/frejs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fre ie\n\n\u003e fre + webpack4 + babel7 兼容 IE（IE8+. Not IE7）\n\n### Run\n\n```console\nyarn start\n```\n\n### Use\n\n```shell\nyarn add webpack-ie8-plugin -D\n```\n```js\nconst IE8 = require('webpack-ie8-plugin')\n\nplugins: [\n    ...\n    new IE8() // 配置文件引入 webpack 的 polyfill\n]\n\nimport 'fre/ie' // 业务入口引入 fre 的 polyfill\n```\n\n\n### 动机\n\n目前主流前端框架都不支持 ie，react16 已经不可能支持 ie8 了，vue 更是想都别想\n\n然而 ie8+ 在国内仍有很高的占有率\n\nfre 代码量非常小，没有用到几个高级 API，所以兼容起来十分简单\n\n### 兼容思路\n\n- webpack 兼容\n\nwebpack 最新版本自身不支持 ie8，所以我们要打补丁，幸运的是，webpack4 高级 API 也不多\n\n`Object.defineproperty`、 `Object.create` 、`Function.bind`\n\n\n- fre 兼容\n\n`Array.forEach`、 `Array.isArray` 、`Array.some`、`Performance.now`\n\n以上是 fre 用到的高级 API，也需要打补丁，幸好也不多\n\n- text 的处理\n\n重写 createTextNode 为 `x-text`，然后将 textContent 改为 `innerText`\n\n- 模拟事件\n\n主要是对 addEventListener 和 removeEventListener 的模拟\n\n### 不足\n\n- 不能使用 webpack-dev-server\n\n由于 ie8 并不支持 webSocket（webpack 是 eventSource），所以基本上所有的通信插件都用不了\n\n- 没有并入 fre 主库\n\nfre2 重构会适当照顾到兼容，达到一个极佳的平衡，然后会放到主库里维护\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrejs%2Ffre-ie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrejs%2Ffre-ie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrejs%2Ffre-ie/lists"}