mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-29 00:41:07 +08:00
Stronger typing for transformers
Reviewed By: jeanlauliac Differential Revision: D5006679 fbshipit-source-id: 795c60db363fb53bc74697e4befe50995e9b97a7
This commit is contained in:
committed by
Facebook Github Bot
parent
3dfed2e865
commit
73fc439bc0
@@ -24,7 +24,7 @@ const throat = require('throat');
|
||||
|
||||
import type {
|
||||
Options as TransformWorkerOptions,
|
||||
TransformOptions,
|
||||
TransformOptionsStrict,
|
||||
} from '../JSTransformer/worker/worker';
|
||||
import type {CachedResult, GetTransformCacheKey} from './TransformCache';
|
||||
|
||||
@@ -381,7 +381,7 @@ class OptionsHasher {
|
||||
* of the cache key as they should not affect the transformation of a single
|
||||
* particular file.
|
||||
*/
|
||||
hashTransformOptions(hash: crypto$Hash, options: TransformOptions): crypto$Hash {
|
||||
hashTransformOptions(hash: crypto$Hash, options: TransformOptionsStrict): crypto$Hash {
|
||||
const {
|
||||
generateSourceMaps, dev, hot, inlineRequires, platform, projectRoot,
|
||||
...unknowns,
|
||||
|
||||
@@ -20,7 +20,7 @@ const rimraf = require('rimraf');
|
||||
const terminal = require('../lib/terminal');
|
||||
const writeFileAtomicSync = require('write-file-atomic').sync;
|
||||
|
||||
import type {Options as TransformOptions} from '../JSTransformer/worker/worker';
|
||||
import type {Options as WorkerOptions} from '../JSTransformer/worker/worker';
|
||||
import type {MappingsMap} from './SourceMap';
|
||||
import type {Reporter} from './reporting';
|
||||
|
||||
@@ -58,7 +58,7 @@ function hashSourceCode(props: {
|
||||
filePath: string,
|
||||
sourceCode: string,
|
||||
getTransformCacheKey: GetTransformCacheKey,
|
||||
transformOptions: TransformOptions,
|
||||
transformOptions: WorkerOptions,
|
||||
transformOptionsKey: string,
|
||||
}): string {
|
||||
return crypto.createHash('sha1')
|
||||
@@ -134,7 +134,7 @@ function writeSync(props: {
|
||||
filePath: string,
|
||||
sourceCode: string,
|
||||
getTransformCacheKey: GetTransformCacheKey,
|
||||
transformOptions: TransformOptions,
|
||||
transformOptions: WorkerOptions,
|
||||
transformOptionsKey: string,
|
||||
result: CachedResult,
|
||||
}): void {
|
||||
@@ -326,7 +326,7 @@ function readMetadataFileSync(
|
||||
export type ReadTransformProps = {
|
||||
filePath: string,
|
||||
sourceCode: string,
|
||||
transformOptions: TransformOptions,
|
||||
transformOptions: WorkerOptions,
|
||||
transformOptionsKey: string,
|
||||
getTransformCacheKey: GetTransformCacheKey,
|
||||
cacheOptions: CacheOptions,
|
||||
|
||||
Reference in New Issue
Block a user