Skip to content

Commit

Permalink
Restore unnecessary imports
Browse files Browse the repository at this point in the history
  • Loading branch information
niutech committed Jul 12, 2021
1 parent 8cf8652 commit 8d5e40b
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/main-thread/commands/event-subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { WorkerContext } from '../worker';
import { CommandExecutorInterface } from './interface';
import { TransferrableMutationType } from '../../transfer/TransferrableMutation';
import { BASE_ELEMENT_INDEX } from '../nodes';
import { RenderableElement } from '../main-thread';

/**
* Monitoring Nodes attribute changes requires a Mutation Observer.
Expand All @@ -47,7 +46,7 @@ const shouldTrackChanges = (node: HTMLElement): boolean => node && 'value' in no
/**
* When a node that has a value needing synced doesn't already have an event listener
* listening for input values, ensure the value is synced with a default listener.
* @param workerContext worker whom to dispatch value toward.
* @param worker whom to dispatch value toward.
* @param node node to listen to value changes on.
*/
export const applyDefaultInputListener = (workerContext: WorkerContext, node: RenderableElement): void => {
Expand All @@ -58,7 +57,7 @@ export const applyDefaultInputListener = (workerContext: WorkerContext, node: Re

/**
* Use a MutationObserver to capture value changes based on Attribute modification (frequently used by frameworks).
* @param workerContext worker whom to dispatch value toward.
* @param worker whom to dispatch value toward.
* @param node node to listen to value changes on.
*/
export const sendValueChangeOnAttributeMutation = (workerContext: WorkerContext, node: RenderableElement): void => {
Expand All @@ -72,7 +71,7 @@ export const sendValueChangeOnAttributeMutation = (workerContext: WorkerContext,

/**
* Tell WorkerDOM what the value is for a Node.
* @param workerContext worker whom to dispatch value toward.
* @param worker whom to dispatch value toward.
* @param node where to get the value from.
*/
const fireValueChange = (workerContext: WorkerContext, node: RenderableElement): void =>
Expand Down Expand Up @@ -118,6 +117,7 @@ export const EventSubscriptionProcessor: CommandExecutorInterface = (strings, no

/**
* Register an event handler for dispatching events to worker thread
* @param worker whom to dispatch events toward
* @param index node index the event comes from (used to dispatchEvent in worker thread).
* @return eventHandler function consuming event and dispatching to worker thread
*/
Expand Down
1 change: 0 additions & 1 deletion src/main-thread/commands/object-creation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import { TransferrableMutationType, ObjectCreationIndex } from '../../transfer/TransferrableMutation';
import { CommandExecutorInterface } from './interface';
import { deserializeTransferrableObject } from '../deserializeTransferrableObject';
import { RenderableElement } from '../main-thread';

export const ObjectCreationProcessor: CommandExecutorInterface = (strings, nodeContext, workerContext, objectContext, config) => {
const allowedExecution = config.executorsAllowed.includes(TransferrableMutationType.OBJECT_CREATION);
Expand Down
1 change: 0 additions & 1 deletion src/main-thread/commands/object-mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import { TransferrableMutationType, ObjectMutationIndex } from '../../transfer/TransferrableMutation';
import { CommandExecutorInterface } from './interface';
import { deserializeTransferrableObject } from '../deserializeTransferrableObject';
import { RenderableElement } from '../main-thread';

export const ObjectMutationProcessor: CommandExecutorInterface = (strings, nodeContext, workerContext, objectContext, config) => {
const allowedExecution = config.executorsAllowed.includes(TransferrableMutationType.OBJECT_MUTATION);
Expand Down
1 change: 0 additions & 1 deletion src/main-thread/commands/offscreen-canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { TransferrableKeys } from '../../transfer/TransferrableKeys';
import { MessageType } from '../../transfer/Messages';
import { CommandExecutorInterface } from './interface';
import { OffscreenCanvasMutationIndex, TransferrableMutationType } from '../../transfer/TransferrableMutation';
import { RenderableElement } from '../main-thread';

export const OffscreenCanvasProcessor: CommandExecutorInterface = (strings, nodeContext, workerContext, objectContext, config) => {
const allowedExecution = config.executorsAllowed.includes(TransferrableMutationType.OFFSCREEN_CANVAS_INSTANCE);
Expand Down
1 change: 0 additions & 1 deletion src/main-thread/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { MessageFromWorker, MessageToWorker } from '../transfer/Messages';
import { Phase } from '../transfer/Phase';
import { HydrateableNode } from '../transfer/TransferrableNodes';
import { DefaultAllowedMutations } from '../transfer/TransferrableMutation';
import { RenderableElement, Sanitizer } from './main-thread';

/**
* The callback for `mutationPump`. If specified, this callback will be called
Expand Down
1 change: 0 additions & 1 deletion src/main-thread/debugging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import { TransferrableSyncValue } from '../transfer/TransferrableSyncValue';
import { createReadableHydrateableRootNode } from './serialize';
import { WorkerDOMConfiguration } from './configuration';
import { WorkerContext } from './worker';
import { RenderableElement } from './main-thread';

/**
* @param element
Expand Down
1 change: 0 additions & 1 deletion src/main-thread/index.amp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { fetchAndInstall, install } from './install';
import { WorkerDOMConfiguration, LongTaskFunction } from './configuration';
import { toLower } from '../utils';
import { ExportedWorker } from './exported-worker';
import { RenderableElement, Sanitizer } from './main-thread';

/**
* AMP Element Children need to be filtered from Hydration, to avoid Author Code from manipulating it.
Expand Down
1 change: 0 additions & 1 deletion src/main-thread/mutator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import { ImageBitmapProcessor } from './commands/image-bitmap';
import { StorageProcessor } from './commands/storage';
import { FunctionProcessor } from './commands/function';
import { ScrollIntoViewProcessor } from './commands/scroll-into-view';
import { Sanitizer, WORKER_DOM_DEBUG } from './main-thread';

export class MutatorProcessor {
private stringContext: StringContext;
Expand Down
1 change: 0 additions & 1 deletion src/main-thread/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import { NodeType, TransferrableNodeIndex } from '../transfer/TransferrableNodes';
import { StringContext } from './strings';
import { RenderableElement, Sanitizer } from './main-thread';

/**
* IE11 doesn't support NodeList.prototype.forEach
Expand Down
1 change: 0 additions & 1 deletion src/main-thread/serialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { NumericBoolean } from '../utils';
import { WorkerDOMConfiguration, HydrationFilterPredicate } from './configuration';
import { applyDefaultInputListener, sendValueChangeOnAttributeMutation } from './commands/event-subscription';
import { WorkerContext } from './worker';
import { RenderableElement } from './main-thread';

const NODES_ALLOWED_TO_TRANSMIT_TEXT_CONTENT = [NodeType.COMMENT_NODE, NodeType.TEXT_NODE];

Expand Down
1 change: 0 additions & 1 deletion src/main-thread/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { NodeContext } from './nodes';
import { TransferrableKeys } from '../transfer/TransferrableKeys';
import { StorageLocation } from '../transfer/TransferrableStorage';
import { IframeWorker } from './iframe-worker';
import { IS_AMP, Sanitizer, StorageValue, WORKER_DOM_DEBUG } from './main-thread';

// TODO: Sanitizer storage init is likely broken, since the code currently
// attempts to stringify a Promise.
Expand Down

0 comments on commit 8d5e40b

Please sign in to comment.