Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add umi-plugin-polyfills #517

Merged
merged 3 commits into from
May 23, 2018
Merged

add umi-plugin-polyfills #517

merged 3 commits into from
May 23, 2018

Conversation

xiaohuoni
Copy link
Member

defined import @babel/polyfill setprototypeof
use case:
.umirc.js

export default {
  plugins: [
    "umi-plugin-polyfills"
  ]
};

or

export default {
  plugins: [
    ["umi-plugin-polyfills",{
      extend:['model name']
    }]
  ]
};

extend must be a array ,defined null,
extend:['model name','./src/polyfills.js']
#413

@coveralls
Copy link

coveralls commented May 22, 2018

Pull Request Test Coverage Report for Build 471

  • 0 of 32 (0.0%) changed or added relevant lines in 2 files are covered.
  • 125 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.3%) to 21.268%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/umi-plugin-polyfill/src/global.js 0 7 0.0%
packages/umi-plugin-polyfill/src/index.js 0 25 0.0%
Files with Coverage Reduction New Missed Lines %
packages/af-webpack/src/getConfig.js 4 62.55%
packages/umi-build-dev/src/UserConfig.js 49 19.15%
packages/umi-build-dev/src/Service.js 72 0.0%
Totals Coverage Status
Change from base Build 459: -0.3%
Covered Lines: 484
Relevant Lines: 2508

💛 - Coveralls

"lib"
],
"dependencies": {
"@babel/polyfill": "^7.0.0-beta.47",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@babel 依赖在正式发布前需要写死版本,用 7.0.0-beta.46,并且不要用 ^,和其他库的保持一致,统一测试后升级。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -0,0 +1,24 @@
{
"name": "umi-plugin-routes",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name 不对,我觉得叫 umi-plugin-polyfill 比较合适,和 @babel/polyfill 的命名保持一致。

@sorrycc
Copy link
Member

sorrycc commented May 23, 2018

extend 是做啥的?import 额外的 js ?

@sorrycc
Copy link
Member

sorrycc commented May 23, 2018

现在是否只解决了 IE 10 及以下的兼容问题?

@xiaohuoni
Copy link
Member Author

extend 用于加入其他的兼容文件,支持直接写模块名,支持本地相对应根目录的文件路径。
现在只解决了ie10及以上的兼容问题,未测试ie8、9等浏览器

@sorrycc
Copy link
Member

sorrycc commented May 23, 2018

再加个 README.md 介绍下用途吧。

@@ -0,0 +1,24 @@
{
"name": "umi-plugin-routes",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@sorrycc sorrycc merged commit 0c64f20 into umijs:master May 23, 2018
Copy link

@codering codering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里只用\n是不是好些?

sorrycc pushed a commit that referenced this pull request Jun 23, 2022
* refactor(plugins): export getter from initial state plugin

* refactor(preset-umi): init history before patch routes

* feat(plugins): support to render exception for layout

* feat(plugins): provide runtime component from access plugin

* feat(plugins): support to handle access for each route

* revert(plugins): export getter from initial state plugin

This reverts commit 0c40911241649e2f2ffe197ebb3e99a53b0097fc.

* revert(plugins): support to handle access for each route

This reverts commit f37302f9d6e93c0cfa525fc656d3ac823d6d4dbc.

* feat(plugins): export marked routes hook from access plugin

* refactor(plugins): use access marked routes in layout plugin

* revert(preset-umi): init history before patch routes

This reverts commit c219fd631c0ac99b6e0fbf1762e59958850cd1b9.

Co-authored-by: Peach <[email protected]>
xierenyuan pushed a commit to xierenyuan/umi that referenced this pull request Jun 23, 2022
* refactor(plugins): export getter from initial state plugin

* refactor(preset-umi): init history before patch routes

* feat(plugins): support to render exception for layout

* feat(plugins): provide runtime component from access plugin

* feat(plugins): support to handle access for each route

* revert(plugins): export getter from initial state plugin

This reverts commit 0c40911241649e2f2ffe197ebb3e99a53b0097fc.

* revert(plugins): support to handle access for each route

This reverts commit f37302f9d6e93c0cfa525fc656d3ac823d6d4dbc.

* feat(plugins): export marked routes hook from access plugin

* refactor(plugins): use access marked routes in layout plugin

* revert(preset-umi): init history before patch routes

This reverts commit c219fd631c0ac99b6e0fbf1762e59958850cd1b9.

Co-authored-by: Peach <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants