Skip to content

Instantly share code, notes, and snippets.

@andreyvit
Created November 20, 2018 11:58
Show Gist options
  • Save andreyvit/17d38315a65f6a54c3d1d39cbc87b7a3 to your computer and use it in GitHub Desktop.
Save andreyvit/17d38315a65f6a54c3d1d39cbc87b7a3 to your computer and use it in GitHub Desktop.
A minimal reproduction case for a weird IE11 memory leak
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script crossorigin src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script>
(function () {
var doc = document;
function unused() {
doc.createElement();
}
Math.easeInOutSine = function () {
return 0;
};
})()
</script>
</head>
<body class="assemble_views-scope">
<div id="mount-nav-bar"></div>
<script crossorigin src="https://cdnjs.cloudflare.com/ajax/libs/react/16.4.2/umd/react.production.min.js"></script>
<script crossorigin src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.4.2/umd/react-dom.production.min.js"></script>
<script>
function CompanyProjectPicker(props) {
return React.createElement(
'div',
{},
React.createElement('input'),
props.projects.map(function (item, idx) {
return React.createElement(
'li',
{
key: 'item-' + idx,
className: "some_really_really_reeealllyyy_looooong_string"
},
React.createElement(
'a',
{
className: ['', "some_really_really_reeealllyyy_looooong_string", ''].join(' '),
href: '/set_project/123'
},
'test project'
)
);
})
);
}
function renderNav() {
var availableProjects = [];
for (var i = 1; i <= 40000; i++) {
availableProjects.push({})
}
var mount = document.getElementById('mount-nav-bar');
var nav = React.createElement(CompanyProjectPicker, {
projects: availableProjects
})
return ReactDOM.render(nav, mount);
};
renderNav();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment