Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Add annotations to break type cycles in www root
Browse files Browse the repository at this point in the history
Summary:
Faecbook:

Add explicit annotations to break type cycles as required for Flow's Local Type Inference project. This codemod prepares the codebase to match Flow's new typechecking algorithm. The new algorithm will make Flow more reliable and predictable.

Details:
- Codemod script: `./scripts/typedjs/flow/runner lti/annotate_cycles .`
- Local Type Inference announcement: [post](https://fb.workplace.com/groups/flowlang/posts/788206301785035)
- Support group: [Flow Support](https://fb.workplace.com/groups/flow)

Codemodded paths:
- ``

drop-conflicts
bypass-lint

Reviewed By: jbrown215

Differential Revision: D41980338

fbshipit-source-id: b4101ac694cdac606344c9054a13b97eca1c73cf
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Dec 13, 2022
1 parent ea485cc commit bc8c486
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

'use strict';

// DraftEditorComposition uses timers to detect duplicate `compositionend`
// events.
jest.useFakeTimers();
import type DraftEditor from 'DraftEditor.react';

const ContentBlock = require('ContentBlock');
const ContentState = require('ContentState');
Expand All @@ -24,6 +22,10 @@ const convertFromHTMLToContentBlocks = require('convertFromHTMLToContentBlocks')
const editOnCompositionStart = require('editOnCompositionStart');
const {Map} = require('immutable');

// DraftEditorComposition uses timers to detect duplicate `compositionend`
// events.
jest.useFakeTimers();

jest.mock('DOMObserver', () => {
function DOMObserver() {}
// $FlowFixMe[prop-missing]
Expand All @@ -48,7 +50,15 @@ jest.mock('getDraftEditorSelection', () => {
// the module in a bad state we forcibly reload it each test.
let compositionHandler = null;
// Initialization of mock editor component that will be used for all tests
let editor;
let editor: {
_latestEditorState: EditorState,
_onCompositionStart: (editor: DraftEditor) => void,
_onKeyDown: JestMockFn<$FlowFixMe, $FlowFixMe>,
exitCurrentMode: JestMockFn<$FlowFixMe, $FlowFixMe>,
restoreEditorDOM: JestMockFn<$FlowFixMe, $FlowFixMe>,
setMode: JestMockFn<$FlowFixMe, $FlowFixMe>,
update: JestMockFn<$FlowFixMe, $FlowFixMe>,
};

function getEditorState(
blocks:
Expand Down

0 comments on commit bc8c486

Please sign in to comment.