Skip to content

Commit

Permalink
feat: ie11 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
squallliu committed Sep 27, 2022
1 parent 2fcf78c commit 6957cbe
Show file tree
Hide file tree
Showing 31 changed files with 662 additions and 546 deletions.
2 changes: 1 addition & 1 deletion examples/angular12/.browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
4 changes: 2 additions & 2 deletions examples/angular12/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2017",
"target": "es5",
"module": "es2020",
"lib": [
"es2018",
Expand All @@ -27,4 +27,4 @@
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
}
14 changes: 7 additions & 7 deletions examples/main-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
">1%",
"last 2 versions",
"ie >= 11"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
">1%",
"last 2 versions",
"ie >= 11"
]
},
"jest": {
Expand Down Expand Up @@ -152,4 +152,4 @@
"react-app"
]
}
}
}
48 changes: 26 additions & 22 deletions examples/main-react/public/index.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--

<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<script>if(window.parent !== window){window.stop()}</script>
<!--
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<script>
if (window.parent !== window) {
window.stop ? window.stop() : document.execCommand("Stop");
}
</script>
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Expand All @@ -25,12 +27,13 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>无界react-demo展示</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
<title>无界react-demo展示</title>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand All @@ -40,5 +43,6 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
</body>

</html>
17 changes: 11 additions & 6 deletions examples/main-react/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import "react-app-polyfill/stable";
import "react-app-polyfill/ie11";

import React from "react";
import ReactDOM from "react-dom";
import WujieReact from "wujie-react";
Expand Down Expand Up @@ -104,15 +107,17 @@ if (window.localStorage.getItem("preload") !== "false") {
preloadApp({
name: "vue2",
});
preloadApp({
name: "vue3",
});
preloadApp({
name: "angular12",
});
preloadApp({
name: "vite",
});
if (window.Proxy) {
preloadApp({
name: "vue3",
});
preloadApp({
name: "vite",
});
}
}

ReactDOM.render(<App />, document.getElementById("root"));
Expand Down
2 changes: 1 addition & 1 deletion examples/main-vue/.browserslistrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
> 1%
last 2 versions
not dead
ie >= 11
4 changes: 3 additions & 1 deletion examples/main-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
"dependencies": {
"ant-design-vue": "^1.7.8",
"core-js": "^3.6.5",
"custom-event-polyfill": "^1.0.7",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"whatwg-fetch": "^3.6.2",
"wujie": "^1.0.0-rc.19",
"wujie-vue2": "^1.0.0-rc.19"
},
Expand All @@ -28,4 +30,4 @@
"prettier": "^2.2.1",
"vue-template-compiler": "^2.6.11"
}
}
}
39 changes: 23 additions & 16 deletions examples/main-vue/public/index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>无界vue-demo展示</title>
<script>if(window.parent !== window){window.stop()}</script>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>无界vue-demo展示</title>
<script>
if (window.parent !== window) {
window.stop ? window.stop() : document.execCommand("Stop");
}
</script>
</head>

<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>

</html>
17 changes: 11 additions & 6 deletions examples/main-vue/src/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import "whatwg-fetch"; // fetch polyfill
import "custom-event-polyfill";

import Vue from "vue";
import App from "./App.vue";
import router from "./router";
Expand Down Expand Up @@ -134,15 +137,17 @@ if (window.localStorage.getItem("preload") !== "false") {
preloadApp({
name: "vue2",
});
preloadApp({
name: "vue3",
});
preloadApp({
name: "angular12",
});
preloadApp({
name: "vite",
});
if (window.Proxy) {
preloadApp({
name: "vue3",
});
preloadApp({
name: "vite",
});
}
}

new Vue({
Expand Down
3 changes: 3 additions & 0 deletions examples/main-vue/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ module.exports = {
open: process.env.NODE_ENV === "development",
port: "8000",
},
transpileDependencies: [
"sockjs-client",
],
};
Loading

0 comments on commit 6957cbe

Please sign in to comment.