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

Declared packages side effect free and fixed existing side effects #830

Merged
merged 1 commit into from Sep 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/popper/package.json
Expand Up @@ -28,6 +28,7 @@
"module": "dist/esm/popper.js",
"unpkg": "dist/umd/popper.min.js",
"types": "index.d.ts",
"sideEffects": false,
"scripts": {
"prepare": "yarn build",
"postpublish": "nuget-publish && ./bower-publish.sh",
Expand Down
15 changes: 8 additions & 7 deletions packages/popper/src/utils/debounce.js
@@ -1,13 +1,14 @@
import isBrowser from './isBrowser';

const longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
let timeoutDuration = 0;
for (let i = 0; i < longerTimeoutBrowsers.length; i += 1) {
if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
timeoutDuration = 1;
break;
const timeoutDuration = (function(){
const longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
for (let i = 0; i < longerTimeoutBrowsers.length; i += 1) {
if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
return 1;
}
}
}
return 0;
}());

export function microtaskDebounce(fn) {
let called = false
Expand Down
1 change: 1 addition & 0 deletions packages/tooltip/package.json
Expand Up @@ -7,6 +7,7 @@
"module": "./dist/esm/tooltip.js",
"unpkg": "./dist/umd/tooltip.min.js",
"types": "index.d.ts",
"sideEffects": false,
"scripts": {
"build": "node bundle.js",
"prepublish": "yarn build",
Expand Down