Skip to content

Commit

Permalink
chore: remove unused dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
rachel-fenichel committed Aug 12, 2022
1 parent c204ba8 commit 9e7c5a2
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 27 deletions.
1 change: 0 additions & 1 deletion core/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import type {Coordinate} from './utils/coordinate.js';
import * as dom from './utils/dom.js';
import type {Size} from './utils/size.js';
import {Svg} from './utils/svg.js';
import * as userAgent from './utils/useragent.js';


/**
Expand Down
1 change: 0 additions & 1 deletion core/contextmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import * as deprecation from './utils/deprecation.js';
import * as dom from './utils/dom.js';
import {Rect} from './utils/rect.js';
import * as svgMath from './utils/svg_math.js';
import * as userAgent from './utils/useragent.js';
import * as WidgetDiv from './widgetdiv.js';
import {WorkspaceCommentSvg} from './workspace_comment_svg.js';
import type {WorkspaceSvg} from './workspace_svg.js';
Expand Down
1 change: 0 additions & 1 deletion core/contextmenu_items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import * as eventUtils from './events/utils.js';
import {inputTypes} from './input_types.js';
import {Msg} from './msg.js';
import * as idGenerator from './utils/idgenerator.js';
import * as userAgent from './utils/useragent.js';
import type {WorkspaceSvg} from './workspace_svg.js';


Expand Down
1 change: 0 additions & 1 deletion core/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ goog.declareModuleId('Blockly.Grid');

import * as dom from './utils/dom.js';
import {Svg} from './utils/svg.js';
import * as userAgent from './utils/useragent.js';
import {GridOptions} from './blockly_options.js';


Expand Down
1 change: 0 additions & 1 deletion core/renderers/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import * as dom from '../../utils/dom.js';
import * as parsing from '../../utils/parsing.js';
import {Svg} from '../../utils/svg.js';
import * as svgPaths from '../../utils/svg_paths.js';
import * as userAgent from '../../utils/useragent.js';


/** An object containing sizing and path information about outside corners. */
Expand Down
1 change: 0 additions & 1 deletion core/utils/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import * as goog from '../../closure/goog/goog.js';
goog.declareModuleId('Blockly.utils.dom');

import type {Svg} from './svg.js';
import * as userAgent from './useragent.js';


/**
Expand Down
1 change: 0 additions & 1 deletion core/utils/svg_math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import * as deprecation from './deprecation.js';
import {Rect} from './rect.js';
import {Size} from './size.js';
import * as style from './style.js';
import * as userAgent from './useragent.js';


/**
Expand Down
1 change: 0 additions & 1 deletion core/utils/toolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import type {ConnectionState} from '../serialization/blocks.js';
import type {CssConfig as CategoryCssConfig} from '../toolbox/category.js';
import type {CssConfig as SeparatorCssConfig} from '../toolbox/separator.js';
import * as Xml from '../xml.js';
import * as userAgent from './useragent.js';


/**
Expand Down
12 changes: 3 additions & 9 deletions core/utils/useragent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ goog.declareModuleId('Blockly.utils.userAgent');
/** The raw useragent string. */
let rawUserAgent: string;

let isIe: boolean;

let isEdge: boolean;

let isJavaFx: boolean;

let isChrome: boolean;
Expand Down Expand Up @@ -63,18 +59,16 @@ function has(name: string): boolean {

// Browsers. Logic from:
// https://github.com/google/closure-library/blob/master/closure/goog/labs/useragent/browser.js
isIe = has('Trident') || has('MSIE');
isEdge = has('Edge');
// Useragent for JavaFX:
// Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.44
// (KHTML, like Gecko) JavaFX/8.0 Safari/537.44
isJavaFx = has('JavaFX');
isChrome = (has('Chrome') || has('CriOS')) && !isEdge;
isChrome = (has('Chrome') || has('CriOS'));

// Engines. Logic from:
// https://github.com/google/closure-library/blob/master/closure/goog/labs/useragent/engine.js
isWebKit = has('WebKit') && !isEdge;
isGecko = has('Gecko') && !isWebKit && !isIe && !isEdge;
isWebKit = has('WebKit');
isGecko = has('Gecko') && !isWebKit;

// Platforms. Logic from:
// https://github.com/google/closure-library/blob/master/closure/goog/labs/useragent/platform.js
Expand Down
10 changes: 0 additions & 10 deletions tests/mocha/contextmenu_items_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,16 +356,6 @@ suite('Context Menu Items', function() {
chai.assert.equal(this.commentOption.preconditionFn(this.scope), 'enabled');
});

test.skip('Hidden for IE', function() {
const oldState = Blockly.utils.userAgent.IE;
try {
Blockly.utils.userAgent.IE = true;
chai.assert.equal(this.commentOption.preconditionFn(this.scope), 'hidden');
} finally {
Blockly.utils.userAgent.IE = oldState;
}
});

test('Hidden for collapsed block', function() {
// Must render block to collapse it properly.
this.block.initSvg();
Expand Down

0 comments on commit 9e7c5a2

Please sign in to comment.