diff --git a/.flowconfig b/.flowconfig index 086c54ac2..c9152a6e6 100644 --- a/.flowconfig +++ b/.flowconfig @@ -33,7 +33,6 @@ experimental.strict_type_args=true munge_underscores=true -module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' suppress_type=$FlowIssue diff --git a/Libraries/Image/GlobalImageStub.js b/Libraries/Image/GlobalImageStub.js deleted file mode 100644 index 1e0271dab..000000000 --- a/Libraries/Image/GlobalImageStub.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule GlobalImageStub - * @flow - */ -'use strict'; - -// This is a stub for flow to make it understand require('image!icon') -// See packager/react-packager/src/Bundler/index.js - -module.exports = { - __packager_asset: true, - path: '/full/path/to/something.png', - uri: 'icon', - width: 100, - height: 100, - deprecated: true, -}; diff --git a/jest-preset.json b/jest-preset.json index a0ecb24f1..b1ee86de0 100644 --- a/jest-preset.json +++ b/jest-preset.json @@ -7,7 +7,6 @@ ] }, "moduleNameMapper": { - "^image![a-zA-Z0-9$_-]+$": "GlobalImageStub", "^[./a-zA-Z0-9$_-]+\\.(bmp|gif|jpg|jpeg|png|psd|svg|webp)$": "RelativeImageStub", "^React$": "node_modules/react" }, diff --git a/local-cli/bundle/buildBundle.js b/local-cli/bundle/buildBundle.js index a8b3c44ea..859943f99 100644 --- a/local-cli/bundle/buildBundle.js +++ b/local-cli/bundle/buildBundle.js @@ -51,7 +51,6 @@ function buildBundle(args, config, output = outputBundle, packagerInstance) { const options = { projectRoots: config.getProjectRoots(), assetExts: defaultAssetExts.concat(assetExts), - assetRoots: config.getAssetRoots(), blacklistRE: config.getBlacklistRE(), getTransformOptionsModulePath: config.getTransformOptionsModulePath, transformModulePath: transformModulePath, diff --git a/local-cli/bundle/saveAssets.js b/local-cli/bundle/saveAssets.js index f95cd4c16..2985a301a 100644 --- a/local-cli/bundle/saveAssets.js +++ b/local-cli/bundle/saveAssets.js @@ -31,7 +31,6 @@ function saveAssets( const filesToCopy = Object.create(null); // Map src -> dest assets - .filter(asset => !asset.deprecated) .forEach(asset => asset.scales.forEach((scale, idx) => { const src = asset.files[idx]; diff --git a/local-cli/default.config.js b/local-cli/default.config.js index 3e5dbcdc6..6dda83e56 100644 --- a/local-cli/default.config.js +++ b/local-cli/default.config.js @@ -20,22 +20,11 @@ var rnpmConfig = require('./core/config'); * to tweak. */ var config = { - getProjectRoots() { - return getRoots(); - }, + getProjectRoots, getProjectConfig: rnpmConfig.getProjectConfig, getDependencyConfig: rnpmConfig.getDependencyConfig, - /** - * Specify where to look for assets that are referenced using - * `image!`. Asset directories for images referenced using - * `./` don't require any entry in here. - */ - getAssetRoots() { - return getRoots(); - }, - /** * Specify any additional asset extentions to be used by the packager. * For example, if you want to include a .ttf file, you would return ['ttf'] @@ -62,7 +51,7 @@ var config = { }, }; -function getRoots() { +function getProjectRoots() { var root = process.env.REACT_NATIVE_APP_ROOT; if (root) { return [path.resolve(root)]; diff --git a/local-cli/dependencies/dependencies.js b/local-cli/dependencies/dependencies.js index 2e3c3d667..f0ebc1dd2 100644 --- a/local-cli/dependencies/dependencies.js +++ b/local-cli/dependencies/dependencies.js @@ -27,7 +27,6 @@ function dependencies(argv, config, args, packagerInstance) { const packageOpts = { projectRoots: config.getProjectRoots(), - assetRoots: config.getAssetRoots(), blacklistRE: config.getBlacklistRE(), getTransformOptionsModulePath: config.getTransformOptionsModulePath, transformModulePath: transformModulePath, diff --git a/local-cli/server/runServer.js b/local-cli/server/runServer.js index 46526abdf..c2423e698 100644 --- a/local-cli/server/runServer.js +++ b/local-cli/server/runServer.js @@ -87,7 +87,6 @@ function getPackagerServer(args, config) { return ReactPackager.createServer({ assetExts: defaultAssetExts.concat(args.assetExts), - assetRoots: args.assetRoots, blacklistRE: config.getBlacklistRE(), cacheVersion: '3', extraNodeModules: config.extraNodeModules, diff --git a/local-cli/server/server.js b/local-cli/server/server.js index 24fd5d128..b7f3a64ab 100644 --- a/local-cli/server/server.js +++ b/local-cli/server/server.js @@ -91,11 +91,6 @@ module.exports = { description: 'override the root(s) to be used by the packager', parse: (val) => val.split(','), default: (config) => config.getProjectRoots(), - }, { - command: '--assetRoots [list]', - description: 'specify the root directories of app assets', - parse: (val) => val.split(',').map(dir => path.resolve(process.cwd(), dir)), - default: (config) => config.getAssetRoots(), }, { command: '--assetExts [list]', description: 'Specify any additional asset extentions to be used by the packager', diff --git a/local-cli/server/util/attachHMRServer.js b/local-cli/server/util/attachHMRServer.js index a223c1935..e8d4657b0 100644 --- a/local-cli/server/util/attachHMRServer.js +++ b/local-cli/server/util/attachHMRServer.js @@ -47,7 +47,7 @@ function attachHMRServer({httpServer, path, packagerServer}) { // `{path: '/a/b/c.js', deps: ['modA', 'modB', ...]}` return Promise.all(Object.values(response.dependencies).map(dep => { return dep.getName().then(depName => { - if (dep.isAsset() || dep.isAsset_DEPRECATED() || dep.isJSON()) { + if (dep.isAsset() || dep.isJSON()) { return Promise.resolve({path: dep.path, deps: []}); } return packagerServer.getShallowDependencies({ diff --git a/local-cli/templates/HelloWorld/_flowconfig b/local-cli/templates/HelloWorld/_flowconfig index 5912f47fc..9b195e10a 100644 --- a/local-cli/templates/HelloWorld/_flowconfig +++ b/local-cli/templates/HelloWorld/_flowconfig @@ -28,7 +28,6 @@ experimental.strict_type_args=true munge_underscores=true -module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' suppress_type=$FlowIssue diff --git a/local-cli/util/Config.js b/local-cli/util/Config.js index 649dddcd6..2f7b0e014 100644 --- a/local-cli/util/Config.js +++ b/local-cli/util/Config.js @@ -23,7 +23,6 @@ export type ConfigT = { getTransformOptionsModulePath?: () => string, transformVariants?: () => {[name: string]: Object}, - getAssetRoots(): Array, getBlacklistRE(): RegExp, getProjectRoots(): Array, }; diff --git a/package.json b/package.json index fb4b614f7..d42240606 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "timers": "fake", "moduleNameMapper": { "^React$": "/Libraries/react-native/React.js", - "^image![a-zA-Z0-9$_-]+$": "GlobalImageStub", "^[./a-zA-Z0-9$_-]+\\.png$": "RelativeImageStub" }, "testPathIgnorePatterns": [ diff --git a/packager/README.md b/packager/README.md index b7970273d..2bf09ebfb 100644 --- a/packager/README.md +++ b/packager/README.md @@ -117,7 +117,7 @@ Builds a bundle according to the provided options. #### `bundleOptions` * `entryFile` string (required): the entry file of the bundle, relative to one - of the asset roots. + of the roots. * `dev` boolean (defaults to `true`): sets a global `__DEV__` variable which will effect how the React Native core libraries behave. * `minify` boolean: Whether to minify code and apply production optimizations. diff --git a/packager/react-packager/src/Bundler/__tests__/Bundler-test.js b/packager/react-packager/src/Bundler/__tests__/Bundler-test.js index 9ef47830e..386bf25a3 100644 --- a/packager/react-packager/src/Bundler/__tests__/Bundler-test.js +++ b/packager/react-packager/src/Bundler/__tests__/Bundler-test.js @@ -38,7 +38,6 @@ describe('Bundler', function() { id, dependencies, isAsset, - isAsset_DEPRECATED, isJSON, isPolyfill, resolution, @@ -50,7 +49,6 @@ describe('Bundler', function() { getName: () => Promise.resolve(id), isJSON: () => isJSON, isAsset: () => isAsset, - isAsset_DEPRECATED: () => isAsset_DEPRECATED, isPolyfill: () => isPolyfill, read: () => ({ code: 'arbitrary', @@ -100,13 +98,6 @@ describe('Bundler', function() { modules = [ createModule({id: 'foo', path: '/root/foo.js', dependencies: []}), createModule({id: 'bar', path: '/root/bar.js', dependencies: []}), - createModule({ - path: '/root/img/img.png', - id: 'image!img', - isAsset_DEPRECATED: true, - dependencies: [], - resolution: 2, - }), createModule({ id: 'new_image.png', path: '/root/img/new_image.png', @@ -166,9 +157,8 @@ describe('Bundler', function() { expect(ithAddedModule(0)).toEqual('/root/foo.js'); expect(ithAddedModule(1)).toEqual('/root/bar.js'); - expect(ithAddedModule(2)).toEqual('/root/img/img.png'); - expect(ithAddedModule(3)).toEqual('/root/img/new_image.png'); - expect(ithAddedModule(4)).toEqual('/root/file.json'); + expect(ithAddedModule(2)).toEqual('/root/img/new_image.png'); + expect(ithAddedModule(3)).toEqual('/root/file.json'); expect(bundle.finalize.mock.calls[0]).toEqual([{ runMainModule: true, @@ -177,15 +167,6 @@ describe('Bundler', function() { }]); expect(bundle.addAsset.mock.calls[0]).toEqual([{ - __packager_asset: true, - path: '/root/img/img.png', - uri: 'img', - width: 25, - height: 50, - deprecated: true, - }]); - - expect(bundle.addAsset.mock.calls[1]).toEqual([{ __packager_asset: true, fileSystemLocation: '/root/img', httpServerLocation: '/assets/img', @@ -245,7 +226,7 @@ describe('Bundler', function() { sourceMapUrl: 'source_map_url', assetPlugins: ['mockPlugin1', 'asyncMockPlugin2'], }).then(bundle => { - expect(bundle.addAsset.mock.calls[1]).toEqual([{ + expect(bundle.addAsset.mock.calls[0]).toEqual([{ __packager_asset: true, fileSystemLocation: '/root/img', httpServerLocation: '/assets/img', @@ -334,7 +315,6 @@ describe('Bundler', function() { .then((paths) => expect(paths).toEqual([ '/root/foo.js', '/root/bar.js', - '/root/img/img.png', '/root/img/new_image.png', '/root/img/new_image@2x.png', '/root/img/new_image@3x.png', diff --git a/packager/react-packager/src/Bundler/index.js b/packager/react-packager/src/Bundler/index.js index 26e9b6646..ced2be346 100644 --- a/packager/react-packager/src/Bundler/index.js +++ b/packager/react-packager/src/Bundler/index.js @@ -79,10 +79,6 @@ const validateOpts = declareOpts({ type: 'object', required: false, }, - assetRoots: { - type: 'array', - required: false, - }, assetExts: { type: 'array', default: ['png'], @@ -120,7 +116,6 @@ type Options = { resetCache: boolean, transformModulePath: string, extraNodeModules: {}, - assetRoots: Array, assetExts: Array, watch: boolean, assetServer: AssetServer, @@ -182,7 +177,6 @@ class Bundler { this._resolver = new Resolver({ assetExts: opts.assetExts, - assetRoots: opts.assetRoots, blacklistRE: opts.blacklistRE, cache: this._cache, extraNodeModules: opts.extraNodeModules, @@ -603,10 +597,7 @@ class Bundler { let moduleTransport; const moduleId = getModuleId(module); - if (module.isAsset_DEPRECATED()) { - moduleTransport = - this._generateAssetModule_DEPRECATED(bundle, module, moduleId); - } else if (module.isAsset()) { + if (module.isAsset()) { moduleTransport = this._generateAssetModule( bundle, module, moduleId, assetPlugins, transformOptions.platform); } @@ -639,38 +630,6 @@ class Bundler { }); } - _generateAssetModule_DEPRECATED(bundle, module, moduleId) { - return Promise.all([ - sizeOf(module.path), - module.getName(), - ]).then(([dimensions, id]) => { - const img = { - __packager_asset: true, - path: module.path, - uri: id.replace(/^[^!]+!/, ''), - width: dimensions.width / module.resolution, - height: dimensions.height / module.resolution, - deprecated: true, - }; - - bundle.addAsset(img); - - const code = - 'module.exports=' + - JSON.stringify(filterObject(img, assetPropertyBlacklist)) - + ';'; - - return new ModuleTransport({ - name: id, - id: moduleId, - code: code, - sourceCode: code, - sourcePath: module.path, - virtual: true, - }); - }); - } - _generateAssetObjAndCode(module, assetPlugins, platform: mixed = null) { const relPath = getPathRelativeToRoot(this._projectRoots, module.path); var assetUrlPath = joinPath('/assets', pathDirname(relPath)); diff --git a/packager/react-packager/src/ModuleGraph/node-haste/node-haste.flow.js b/packager/react-packager/src/ModuleGraph/node-haste/node-haste.flow.js index 5ac113951..9f1cc1726 100644 --- a/packager/react-packager/src/ModuleGraph/node-haste/node-haste.flow.js +++ b/packager/react-packager/src/ModuleGraph/node-haste/node-haste.flow.js @@ -54,19 +54,6 @@ export type FastFS = { matches(directory: Path, pattern: RegExp): Array, }; -type DeprecatedAssetMapOptions = {| - assetExts: Extensions, - files: Array, - helpers: DependencyGraphHelpers, - platforms: Platforms, -|}; - -declare class DeprecatedAssetMap { - // node-haste/DependencyGraph/DeprecatedAssetMap.js - constructor(options: DeprecatedAssetMapOptions): void, -} -export type DeprecatedAssetMapT = DeprecatedAssetMap; - type HasteMapOptions = {| allowRelativePaths: boolean, extensions: Extensions, @@ -89,7 +76,6 @@ type ResolutionRequestOptions = {| platforms: Platforms, preferNativePlatform: true, hasteMap: HasteMap, - deprecatedAssetMap: DeprecatedAssetMap, helpers: DependencyGraphHelpers, moduleCache: ModuleCache, fastfs: FastFS, diff --git a/packager/react-packager/src/ModuleGraph/node-haste/node-haste.js b/packager/react-packager/src/ModuleGraph/node-haste/node-haste.js index 5eaaf14ef..fb0997e66 100644 --- a/packager/react-packager/src/ModuleGraph/node-haste/node-haste.js +++ b/packager/react-packager/src/ModuleGraph/node-haste/node-haste.js @@ -12,7 +12,6 @@ 'use strict'; import type { // eslint-disable-line sort-requires - DeprecatedAssetMapT, Extensions, HasteMapT, Path, @@ -25,7 +24,6 @@ import type { } from '../types.flow'; const DependencyGraphHelpers = require('../../node-haste/DependencyGraph/DependencyGraphHelpers'); -const DeprecatedAssetMap: Class = require('../../node-haste/DependencyGraph/DeprecatedAssetMap'); const FastFS = require('./FastFS'); const HasteMap: Class = require('../../node-haste/DependencyGraph/HasteMap'); const Module = require('./Module'); @@ -58,12 +56,6 @@ exports.createResolveFn = function(options: ResolveOptions): ResolveFn { assetExts, providesModuleNodeModules: defaults.providesModuleNodeModules, }); - const deprecatedAssetMap = new DeprecatedAssetMap({ - assetExts, - files, - helpers, - platforms, - }); const fastfs = new FastFS(files); const moduleCache = new ModuleCache(fastfs, getTransformedFile); @@ -83,7 +75,6 @@ exports.createResolveFn = function(options: ResolveOptions): ResolveFn { let resolutionRequest = resolutionRequests[platform]; if (!resolutionRequest) { resolutionRequest = resolutionRequests[platform] = new ResolutionRequest({ - deprecatedAssetMap, extraNodeModules, fastfs, hasteMap, diff --git a/packager/react-packager/src/Resolver/index.js b/packager/react-packager/src/Resolver/index.js index 47c28123e..04f5c0658 100644 --- a/packager/react-packager/src/Resolver/index.js +++ b/packager/react-packager/src/Resolver/index.js @@ -31,10 +31,6 @@ const validateOpts = declareOpts({ type: 'string', default: 'haste', }, - assetRoots: { - type: 'array', - default: [], - }, watch: { type: 'boolean', default: false, @@ -92,7 +88,6 @@ class Resolver { this._depGraph = new DependencyGraph({ roots: opts.projectRoots, - assetRoots_DEPRECATED: opts.assetRoots, assetExts: opts.assetExts, ignoreFilePath: function(filepath) { return filepath.indexOf('__tests__') !== -1 || diff --git a/packager/react-packager/src/Server/index.js b/packager/react-packager/src/Server/index.js index 39d4a7504..5532c8127 100644 --- a/packager/react-packager/src/Server/index.js +++ b/packager/react-packager/src/Server/index.js @@ -79,10 +79,6 @@ const validateOpts = declareOpts({ type: 'boolean', default: false, }, - assetRoots: { - type: 'array', - required: false, - }, assetExts: { type: 'array', default: defaults.assetExts, diff --git a/packager/react-packager/src/node-haste/AssetModule_DEPRECATED.js b/packager/react-packager/src/node-haste/AssetModule_DEPRECATED.js deleted file mode 100644 index cfbbd16dc..000000000 --- a/packager/react-packager/src/node-haste/AssetModule_DEPRECATED.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -const Module = require('./Module'); -const getAssetDataFromName = require('./lib/getAssetDataFromName'); - -class AssetModule_DEPRECATED extends Module { - constructor(args, platforms) { - super(args); - const {resolution, name} = getAssetDataFromName(this.path, platforms); - this.resolution = resolution; - this.name = name; - this.platforms = platforms; - } - - isHaste() { - return Promise.resolve(false); - } - - getName() { - return Promise.resolve(`image!${this.name}`); - } - - getDependencies() { - return Promise.resolve([]); - } - - hash() { - return `AssetModule_DEPRECATED : ${this.path}`; - } - - isJSON() { - return false; - } - - isAsset_DEPRECATED() { - return true; - } - - resolution() { - return getAssetDataFromName(this.path, this.platforms).resolution; - } - -} - -module.exports = AssetModule_DEPRECATED; diff --git a/packager/react-packager/src/node-haste/DependencyGraph/DeprecatedAssetMap.js b/packager/react-packager/src/node-haste/DependencyGraph/DeprecatedAssetMap.js deleted file mode 100644 index e72829a0c..000000000 --- a/packager/react-packager/src/node-haste/DependencyGraph/DeprecatedAssetMap.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -'use strict'; - -const AssetModule_DEPRECATED = require('../AssetModule_DEPRECATED'); -const debug = require('debug')('ReactNativePackager:DependencyGraph'); -const path = require('path'); - -class DeprecatedAssetMap { - constructor({ - assetExts, - helpers, - platforms, - files, - }) { - this._helpers = helpers; - this._map = Object.create(null); - this._assetExts = assetExts; - this._platforms = platforms; - - files.forEach(file => this._processAsset(file)); - } - - resolve(fromModule, toModuleName) { - if (this._disabled) { - return null; - } - - const assetMatch = toModuleName.match(/^image!(.+)/); - if (assetMatch && assetMatch[1]) { - if (!this._map[assetMatch[1]]) { - debug('WARINING: Cannot find asset:', assetMatch[1]); - return null; - } - return this._map[assetMatch[1]]; - } - } - - _processAsset(file) { - const ext = this._helpers.extname(file); - if (this._assetExts.indexOf(ext) !== -1) { - const name = assetName(file, ext); - if (this._map[name] != null) { - debug('Conflicting assets', name); - } - - this._map[name] = new AssetModule_DEPRECATED({ file }, this._platforms); - } - } - - processFileChange(type, filePath, fstat) { - const name = assetName(filePath); - if (type === 'change' || type === 'delete') { - delete this._map[name]; - } - - if (type === 'change' || type === 'add') { - this._processAsset(filePath); - } - } -} - -function assetName(file, ext) { - return path.basename(file, '.' + ext).replace(/@[\d\.]+x/, ''); -} - -module.exports = DeprecatedAssetMap; diff --git a/packager/react-packager/src/node-haste/DependencyGraph/ResolutionRequest.js b/packager/react-packager/src/node-haste/DependencyGraph/ResolutionRequest.js index dff5b745c..07d24a214 100644 --- a/packager/react-packager/src/node-haste/DependencyGraph/ResolutionRequest.js +++ b/packager/react-packager/src/node-haste/DependencyGraph/ResolutionRequest.js @@ -26,7 +26,6 @@ class ResolutionRequest { preferNativePlatform, entryPath, hasteMap, - deprecatedAssetMap, helpers, moduleCache, fastfs, @@ -38,7 +37,6 @@ class ResolutionRequest { this._preferNativePlatform = preferNativePlatform; this._entryPath = entryPath; this._hasteMap = hasteMap; - this._deprecatedAssetMap = deprecatedAssetMap; this._helpers = helpers; this._moduleCache = moduleCache; this._fastfs = fastfs; @@ -63,14 +61,6 @@ class ResolutionRequest { return Promise.resolve(this._immediateResolutionCache[resHash]); } - const asset_DEPRECATED = this._deprecatedAssetMap.resolve( - fromModule, - toModuleName - ); - if (asset_DEPRECATED) { - return Promise.resolve(asset_DEPRECATED); - } - const cacheResult = (result) => { this._immediateResolutionCache[resHash] = result; return result; @@ -206,8 +196,8 @@ class ResolutionRequest { function collect(module) { collectionsInProgress.start(module); const result = resolveDependencies(module) - .then(result => addMockDependencies(module, result)) - .then(result => crawlDependencies(module, result)); + .then(deps => addMockDependencies(module, deps)) + .then(deps => crawlDependencies(module, deps)); const end = () => collectionsInProgress.end(module); result.then(end, end); return result; @@ -252,9 +242,9 @@ class ResolutionRequest { let mocks = null; if (pattern) { mocks = Object.create(null); - this._fastfs.matchFilesByPattern(pattern).forEach(file => - mocks[path.basename(file, path.extname(file))] = file - ); + this._fastfs.matchFilesByPattern(pattern).forEach(file => { + mocks[path.basename(file, path.extname(file))] = file; + }); } return Promise.resolve(mocks); } @@ -532,8 +522,8 @@ function resolveKeyWithPromise([key, promise]) { return promise.then(value => [key, value]); } -function isRelativeImport(path) { - return /^[.][.]?(?:[/]|$)/.test(path); +function isRelativeImport(filePath) { + return /^[.][.]?(?:[/]|$)/.test(filePath); } module.exports = ResolutionRequest; diff --git a/packager/react-packager/src/node-haste/Module.js b/packager/react-packager/src/node-haste/Module.js index 8a4ceab95..1e716dadc 100644 --- a/packager/react-packager/src/node-haste/Module.js +++ b/packager/react-packager/src/node-haste/Module.js @@ -219,8 +219,6 @@ class Module { callback: (error: ?Error, result: ?TransformedCode) => void, ) { const {_transformCode, _transformCacheKey} = this; - // AssetModule_DEPRECATED doesn't provide transformCode, but these should - // never be transformed anyway. invariant(_transformCode != null, 'missing code transform funtion'); invariant(_transformCacheKey != null, 'missing cache key'); this._readSourceCode() @@ -311,16 +309,11 @@ class Module { return false; } - isAsset_DEPRECATED() { - return false; - } - toJSON() { return { hash: this.hash(), isJSON: this.isJSON(), isAsset: this.isAsset(), - isAsset_DEPRECATED: this.isAsset_DEPRECATED(), type: this.type, path: this.path, }; diff --git a/packager/react-packager/src/node-haste/__tests__/DependencyGraph-test.js b/packager/react-packager/src/node-haste/__tests__/DependencyGraph-test.js index be472c9a8..0c90e4290 100644 --- a/packager/react-packager/src/node-haste/__tests__/DependencyGraph-test.js +++ b/packager/react-packager/src/node-haste/__tests__/DependencyGraph-test.js @@ -48,7 +48,6 @@ describe('DependencyGraph', function() { path: dep.path, isJSON: dep.isJSON(), isAsset: dep.isAsset(), - isAsset_DEPRECATED: dep.isAsset_DEPRECATED(), isPolyfill: dep.isPolyfill(), resolution: dep.resolution, id: name, @@ -177,7 +176,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['a'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -188,7 +186,6 @@ describe('DependencyGraph', function() { path: '/root/a.js', dependencies: ['b'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -199,7 +196,6 @@ describe('DependencyGraph', function() { path: '/root/b.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -233,7 +229,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -278,7 +273,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['a'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -288,7 +282,6 @@ describe('DependencyGraph', function() { path: '/root/a.js', dependencies: ['b'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -332,7 +325,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['a'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -342,7 +334,6 @@ describe('DependencyGraph', function() { path: '/root/a.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -382,7 +373,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['./a.json', './b'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -393,7 +383,6 @@ describe('DependencyGraph', function() { path: '/root/a.json', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isPolyfill: false, resolution: undefined, }, @@ -403,7 +392,6 @@ describe('DependencyGraph', function() { path: '/root/b.json', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isPolyfill: false, resolution: undefined, }, @@ -439,7 +427,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['./package.json'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -450,7 +437,6 @@ describe('DependencyGraph', function() { path: '/root/package.json', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isPolyfill: false, resolution: undefined, }, @@ -458,54 +444,6 @@ describe('DependencyGraph', function() { }); }); - it('should get dependencies with deprecated assets', function() { - var root = '/root'; - setMockFileSystem({ - 'root': { - 'index.js': [ - '/**', - ' * @providesModule index', - ' */', - 'require("image!a")', - ].join('\n'), - 'imgs': { - 'a.png': '', - }, - }, - }); - - var dgraph = new DependencyGraph({ - ...defaults, - roots: [root], - assetRoots_DEPRECATED: ['/root/imgs'], - }); - return getOrderedDependenciesAsJSON(dgraph, '/root/index.js').then(function(deps) { - expect(deps) - .toEqual([ - { - id: 'index', - path: '/root/index.js', - dependencies: ['image!a'], - isAsset: false, - isAsset_DEPRECATED: false, - isJSON: false, - isPolyfill: false, - resolution: undefined, - }, - { - id: 'image!a', - path: '/root/imgs/a.png', - dependencies: [], - isAsset_DEPRECATED: true, - resolution: 1, - isAsset: false, - isJSON: false, - isPolyfill: false, - }, - ]); - }); - }); - it('should get dependencies with relative assets', function() { var root = '/root'; setMockFileSystem({ @@ -537,7 +475,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['./imgs/a.png'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -548,7 +485,6 @@ describe('DependencyGraph', function() { dependencies: [], isAsset: true, resolution: 1, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, }, @@ -596,7 +532,6 @@ describe('DependencyGraph', function() { './imgs/c.png', ], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -607,7 +542,6 @@ describe('DependencyGraph', function() { resolution: 1.5, dependencies: [], isAsset: true, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, }, @@ -617,7 +551,6 @@ describe('DependencyGraph', function() { resolution: 0.7, dependencies: [], isAsset: true, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, }, @@ -627,7 +560,6 @@ describe('DependencyGraph', function() { resolution: 1, dependencies: [], isAsset: true, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, }, @@ -676,7 +608,6 @@ describe('DependencyGraph', function() { './imgs/c.png', ], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -687,7 +618,6 @@ describe('DependencyGraph', function() { resolution: 1.5, dependencies: [], isAsset: true, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, }, @@ -697,7 +627,6 @@ describe('DependencyGraph', function() { resolution: 0.7, dependencies: [], isAsset: true, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, }, @@ -707,69 +636,6 @@ describe('DependencyGraph', function() { resolution: 1, dependencies: [], isAsset: true, - isAsset_DEPRECATED: false, - isJSON: false, - isPolyfill: false, - }, - ]); - }); - }); - - it('Deprecated and relative assets can live together', function() { - var root = '/root'; - setMockFileSystem({ - 'root': { - 'index.js': [ - '/**', - ' * @providesModule index', - ' */', - 'require("./imgs/a.png")', - 'require("image!a")', - ].join('\n'), - 'imgs': { - 'a.png': '', - }, - 'package.json': JSON.stringify({ - name: 'rootPackage', - }), - }, - }); - - var dgraph = new DependencyGraph({ - ...defaults, - roots: [root], - assetRoots_DEPRECATED: ['/root/imgs'], - }); - return getOrderedDependenciesAsJSON(dgraph, '/root/index.js').then(function(deps) { - expect(deps) - .toEqual([ - { - id: 'index', - path: '/root/index.js', - dependencies: ['./imgs/a.png', 'image!a'], - isAsset: false, - isAsset_DEPRECATED: false, - isJSON: false, - isPolyfill: false, - resolution: undefined, - }, - { - id: 'rootPackage/imgs/a.png', - path: '/root/imgs/a.png', - dependencies: [], - isAsset: true, - resolution: 1, - isAsset_DEPRECATED: false, - isJSON: false, - isPolyfill: false, - }, - { - id: 'image!a', - path: '/root/imgs/a.png', - dependencies: [], - isAsset_DEPRECATED: true, - resolution: 1, - isAsset: false, isJSON: false, isPolyfill: false, }, @@ -808,7 +674,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['a'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -818,7 +683,6 @@ describe('DependencyGraph', function() { path: '/root/a.js', dependencies: ['index'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -859,7 +723,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -869,7 +732,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -910,7 +772,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage/'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -920,7 +781,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -969,7 +829,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['sha.js', 'x.y.z'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -979,7 +838,6 @@ describe('DependencyGraph', function() { path: '/root/sha.js/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -989,7 +847,6 @@ describe('DependencyGraph', function() { path: '/root/x.y.z/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1024,7 +881,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1034,7 +890,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/index.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1073,7 +928,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1083,7 +937,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/index.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1121,7 +974,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1131,7 +983,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/lib/index.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1166,7 +1017,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['./lib/'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1176,7 +1026,6 @@ describe('DependencyGraph', function() { path: '/root/lib/index.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1215,7 +1064,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['./lib/'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1225,7 +1073,6 @@ describe('DependencyGraph', function() { path: '/root/lib/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1262,7 +1109,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1332,7 +1178,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['lolomg'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1377,7 +1222,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage/subdir/lolynot'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1388,7 +1232,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/subdir/lolynot.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1434,7 +1277,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage/subdir/lolynot'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1445,7 +1287,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/subdir/lolynot.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1491,7 +1332,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1502,7 +1342,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/main.js', dependencies: ['./subdir/lolynot'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1513,7 +1352,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/subdir/lolynot.js', dependencies: ['../other'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1524,7 +1362,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/other.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1581,7 +1418,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1592,7 +1428,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/client.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1636,7 +1471,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1646,7 +1480,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/client.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1692,7 +1525,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1701,7 +1533,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/client.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1748,7 +1579,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1759,7 +1589,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/client.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1817,7 +1646,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1826,7 +1654,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/client.js', dependencies: ['./node', './dir/server.js'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1835,7 +1662,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/not-node.js', dependencies: ['./not-browser'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1844,7 +1670,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/browser.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1854,7 +1679,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/dir/client.js', dependencies: ['../hello'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1864,7 +1688,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/bye.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1918,7 +1741,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1927,7 +1749,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/index.js', dependencies: ['node-package'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1936,7 +1757,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/browser-package/index.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1988,7 +1808,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -1997,7 +1816,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/index.js', dependencies: ['./dir/ooga'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2006,7 +1824,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/dir/ooga.js', dependencies: ['node-package'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2015,7 +1832,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/dir/browser.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2069,7 +1885,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2078,7 +1893,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/index.js', dependencies: ['node-package'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2087,7 +1901,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/browser-package/index.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2135,7 +1948,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2144,7 +1956,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/index.js', dependencies: ['booga'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2187,7 +1998,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2196,7 +2006,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/index.js', dependencies: ['./booga'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2262,7 +2071,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2271,7 +2079,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/index.js', dependencies: ['node-package'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2280,7 +2087,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/node_modules/rn-package/index.js', dependencies: ['nested-package'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2289,7 +2095,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/node_modules/nested-browser-package/index.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2319,7 +2124,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['/root/arbitrary.js'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2329,7 +2133,6 @@ describe('DependencyGraph', function() { path: '/root/arbitrary.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2431,7 +2234,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2440,7 +2242,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/index.js', dependencies: ['node-package-a', 'node-package-b', 'node-package-c'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2449,7 +2250,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/node_modules/rn-package-a/index.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2458,7 +2258,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/node_modules/rn-package-b/index.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2467,7 +2266,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/node_modules/rn-package-d/index.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2509,7 +2307,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['./foo'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2519,7 +2316,6 @@ describe('DependencyGraph', function() { path: '/root/foo/index.js', dependencies: ['bar'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2529,7 +2325,6 @@ describe('DependencyGraph', function() { path: '/root/provides-bar/lib/bar.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2566,7 +2361,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['bar'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2576,7 +2370,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/bar.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2614,7 +2407,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['bar/lib/foo'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2624,7 +2416,6 @@ describe('DependencyGraph', function() { path: '/root/provides-bar/lib/foo.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2686,7 +2477,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\index.js', dependencies: ['a'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2697,7 +2487,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\a.js', dependencies: ['b'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2708,7 +2497,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\b.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2739,7 +2527,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\index.js', dependencies: ['C:\\root\\arbitrary.js'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2749,7 +2536,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\arbitrary.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2822,7 +2608,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['foo', 'bar'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2832,7 +2617,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/foo/main.js', dependencies: ['bar'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2842,7 +2626,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/foo/node_modules/bar/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2852,7 +2635,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/bar/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2902,7 +2684,6 @@ describe('DependencyGraph', function() { path: '/root/index.ios.js', dependencies: ['foo', 'bar'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2912,7 +2693,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/foo/index.ios.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2922,7 +2702,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/bar/main.ios.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2983,7 +2762,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['foo', 'bar/'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -2993,7 +2771,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/foo/main.js', dependencies: ['bar/lol'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3003,7 +2780,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/foo/node_modules/bar/lol.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3013,7 +2789,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/bar/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3078,7 +2853,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['foo', 'bar'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3088,7 +2862,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/foo/main.js', dependencies: ['bar/lol'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3098,7 +2871,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/foo/node_modules/bar/lol.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3108,7 +2880,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/bar/main2.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3162,7 +2933,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['bar'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3172,7 +2942,6 @@ describe('DependencyGraph', function() { path: '/root/path/to/bar.js', dependencies: ['foo'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3182,7 +2951,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/foo/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3306,7 +3074,6 @@ describe('DependencyGraph', function() { 'anotherIndex', ], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3316,7 +3083,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/react-haste/main.js', dependencies: ['submodule'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3326,7 +3092,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/react-haste/node_modules/submodule/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3336,7 +3101,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/ember/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3346,7 +3110,6 @@ describe('DependencyGraph', function() { path: '/root/vendored_modules/a-vendored-package/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3356,7 +3119,6 @@ describe('DependencyGraph', function() { path: '/anotherRoot/index.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3403,7 +3165,6 @@ describe('DependencyGraph', function() { path: '/react-haste/index.js', dependencies: ['shouldWork'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3413,7 +3174,6 @@ describe('DependencyGraph', function() { path: '/react-haste/node_modules/react-haste/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3458,7 +3218,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['foo/lol'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3501,7 +3260,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['sha.js'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3511,7 +3269,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/sha.js/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3560,7 +3317,6 @@ describe('DependencyGraph', function() { path: '/root/index.ios.js', dependencies: ['a'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3570,7 +3326,6 @@ describe('DependencyGraph', function() { path: '/root/a.ios.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3620,7 +3375,6 @@ describe('DependencyGraph', function() { path: '/root/index.ios.js', dependencies: ['a'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3630,7 +3384,6 @@ describe('DependencyGraph', function() { path: '/root/a.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3667,7 +3420,6 @@ describe('DependencyGraph', function() { path: '/root/index.ios.js', dependencies: ['./a'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3677,7 +3429,6 @@ describe('DependencyGraph', function() { path: '/root/a.ios.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3727,7 +3478,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['foo/package.json', 'bar'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3737,7 +3487,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/foo/package.json', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: true, isPolyfill: false, resolution: undefined, @@ -3747,7 +3496,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/bar/main.js', dependencies: ['./package.json'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3757,7 +3505,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/bar/package.json', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: true, isPolyfill: false, resolution: undefined, @@ -3793,7 +3540,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['a/index.js'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3803,7 +3549,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/a/index.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3873,7 +3618,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\index.js', dependencies: ['foo', 'bar'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3883,7 +3627,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\foo\\main.js', dependencies: ['bar'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3893,7 +3636,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\foo\\node_modules\\bar\\main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3903,7 +3645,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\bar\\main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3953,7 +3694,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\index.ios.js', dependencies: ['foo', 'bar'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3963,7 +3703,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\foo\\index.ios.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -3973,7 +3712,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\bar\\main.ios.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4034,7 +3772,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\index.js', dependencies: ['foo', 'bar/'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4044,7 +3781,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\foo\\main.js', dependencies: ['bar/lol'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4054,7 +3790,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\foo\\node_modules\\bar\\lol.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4064,7 +3799,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\bar\\main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4129,7 +3863,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\index.js', dependencies: ['foo', 'bar'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4139,7 +3872,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\foo\\main.js', dependencies: ['bar/lol'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4149,7 +3881,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\foo\\node_modules\\bar\\lol.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4159,7 +3890,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\bar\\main2.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4213,7 +3943,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\index.js', dependencies: ['bar'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4223,7 +3952,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\path\\to\\bar.js', dependencies: ['foo'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4233,7 +3961,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\foo\\main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4357,7 +4084,6 @@ describe('DependencyGraph', function() { 'anotherIndex', ], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4367,7 +4093,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\react-haste\\main.js', dependencies: ['submodule'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4377,7 +4102,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\react-haste\\node_modules\\submodule\\main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4387,7 +4111,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\ember\\main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4397,7 +4120,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\vendored_modules\\a-vendored-package\\main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4407,7 +4129,6 @@ describe('DependencyGraph', function() { path: 'C:\\anotherRoot\\index.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4454,7 +4175,6 @@ describe('DependencyGraph', function() { path: 'C:\\react-haste\\index.js', dependencies: ['shouldWork'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4464,7 +4184,6 @@ describe('DependencyGraph', function() { path: 'C:\\react-haste\\node_modules\\react-haste\\main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4508,7 +4227,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\index.js', dependencies: ['foo/lol'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4551,7 +4269,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\index.js', dependencies: ['sha.js'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4561,7 +4278,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\sha.js\\main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4610,7 +4326,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\index.ios.js', dependencies: ['a'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4620,7 +4335,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\a.ios.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4669,7 +4383,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\index.ios.js', dependencies: ['a'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4679,7 +4392,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\a.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4716,7 +4428,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\index.ios.js', dependencies: ['./a'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4726,7 +4437,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\a.ios.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4776,7 +4486,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\index.js', dependencies: ['foo/package.json', 'bar'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4786,7 +4495,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\foo\\package.json', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: true, isPolyfill: false, resolution: undefined, @@ -4796,7 +4504,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\bar\\main.js', dependencies: ['./package.json'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4806,7 +4513,6 @@ describe('DependencyGraph', function() { path: 'C:\\root\\node_modules\\bar\\package.json', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: true, isPolyfill: false, resolution: undefined, @@ -4877,7 +4583,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4887,7 +4592,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4940,7 +4644,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -4950,7 +4653,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5002,7 +4704,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage', 'foo'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5012,7 +4713,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5073,7 +4773,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage', 'foo'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5083,7 +4782,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/main.js', dependencies: ['bar'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5093,7 +4791,6 @@ describe('DependencyGraph', function() { path: '/root/bar.js', dependencies: ['foo'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5104,7 +4801,6 @@ describe('DependencyGraph', function() { path: '/root/foo.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5115,75 +4811,6 @@ describe('DependencyGraph', function() { }); }); - it('updates module dependencies on deprecated asset add', function() { - var root = '/root'; - var filesystem = setMockFileSystem({ - 'root': { - 'index.js': [ - '/**', - ' * @providesModule index', - ' */', - 'require("image!foo")', - ].join('\n'), - }, - }); - - var dgraph = new DependencyGraph({ - ...defaults, - roots: [root], - assetRoots_DEPRECATED: [root], - assetExts: ['png'], - }); - - return getOrderedDependenciesAsJSON(dgraph, '/root/index.js').then(function(deps) { - expect(deps) - .toEqual([ - { - id: 'index', - path: '/root/index.js', - dependencies: ['image!foo'], - isAsset: false, - isAsset_DEPRECATED: false, - isJSON: false, - isPolyfill: false, - resolution: undefined, - resolveDependency: undefined, - }, - ]); - - filesystem.root['foo.png'] = ''; - dgraph.processFileChange('add', root + '/foo.png', mockStat); - - return getOrderedDependenciesAsJSON(dgraph, '/root/index.js').then(function(deps2) { - expect(deps2) - .toEqual([ - { - id: 'index', - path: '/root/index.js', - dependencies: ['image!foo'], - isAsset: false, - isAsset_DEPRECATED: false, - isJSON: false, - isPolyfill: false, - resolution: undefined, - resolveDependency: undefined, - }, - { - id: 'image!foo', - path: '/root/foo.png', - dependencies: [], - isAsset_DEPRECATED: true, - resolution: 1, - isAsset: false, - isJSON: false, - isPolyfill: false, - resolveDependency: undefined, - }, - ]); - }); - }); - }); - it('updates module dependencies on relative asset add', function() { var root = '/root'; var filesystem = setMockFileSystem({ @@ -5213,7 +4840,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['./foo.png'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5232,7 +4858,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['./foo.png'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5244,7 +4869,6 @@ describe('DependencyGraph', function() { dependencies: [], isAsset: true, resolution: 1, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolveDependency: undefined, @@ -5295,7 +4919,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5306,7 +4929,6 @@ describe('DependencyGraph', function() { path: '/root/aPackage/browser.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5357,7 +4979,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['aPackage'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5411,7 +5032,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['foo'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5422,7 +5042,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/foo/main.js', dependencies: ['bar'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5433,7 +5052,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/foo/node_modules/bar/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5452,7 +5070,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['foo'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5463,7 +5080,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/foo/main.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5517,7 +5133,6 @@ describe('DependencyGraph', function() { path: '/root/index.js', dependencies: ['foo'], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5528,7 +5143,6 @@ describe('DependencyGraph', function() { path: '/root/node_modules/foo/browser.js', dependencies: [], isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, resolution: undefined, @@ -5620,7 +5234,6 @@ describe('DependencyGraph', function() { dependencies: ['a'], id: 'index', isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, path: '/root/index.jsx', @@ -5630,7 +5243,6 @@ describe('DependencyGraph', function() { dependencies: [], id: 'a', isAsset: false, - isAsset_DEPRECATED: false, isJSON: false, isPolyfill: false, path: '/root/a.coffee', @@ -5745,7 +5357,6 @@ describe('DependencyGraph', function() { path: '/root/A.js', isJSON: false, isAsset: false, - isAsset_DEPRECATED: false, isPolyfill: false, id: 'A', dependencies: ['foo', 'A'], @@ -5754,7 +5365,6 @@ describe('DependencyGraph', function() { path: '/root/foo.js', isJSON: false, isAsset: false, - isAsset_DEPRECATED: false, isPolyfill: false, id: 'foo', dependencies: [], @@ -5763,7 +5373,6 @@ describe('DependencyGraph', function() { path: '/root/__mocks__/A.js', isJSON: false, isAsset: false, - isAsset_DEPRECATED: false, isPolyfill: false, id: '/root/__mocks__/A.js', dependencies: ['b'], @@ -5772,7 +5381,6 @@ describe('DependencyGraph', function() { path: '/root/__mocks__/b.js', isJSON: false, isAsset: false, - isAsset_DEPRECATED: false, isPolyfill: false, id: '/root/__mocks__/b.js', dependencies: [], @@ -5813,7 +5421,6 @@ describe('DependencyGraph', function() { path: '/root/A.js', isJSON: false, isAsset: false, - isAsset_DEPRECATED: false, isPolyfill: false, id: 'A', dependencies: ['foo'], @@ -5822,7 +5429,6 @@ describe('DependencyGraph', function() { path: '/root/__mocks__/foo.js', isJSON: false, isAsset: false, - isAsset_DEPRECATED: false, isPolyfill: false, id: '/root/__mocks__/foo.js', dependencies: ['b'], @@ -5831,7 +5437,6 @@ describe('DependencyGraph', function() { path: '/root/__mocks__/b.js', isJSON: false, isAsset: false, - isAsset_DEPRECATED: false, isPolyfill: false, id: '/root/__mocks__/b.js', dependencies: [], diff --git a/packager/react-packager/src/node-haste/index.js b/packager/react-packager/src/node-haste/index.js index 8fcdda7a9..c5cbf5f0a 100644 --- a/packager/react-packager/src/node-haste/index.js +++ b/packager/react-packager/src/node-haste/index.js @@ -13,7 +13,6 @@ const Cache = require('./Cache'); const DependencyGraphHelpers = require('./DependencyGraph/DependencyGraphHelpers'); -const DeprecatedAssetMap = require('./DependencyGraph/DeprecatedAssetMap'); const Fastfs = require('./fastfs'); const HasteMap = require('./DependencyGraph/HasteMap'); const JestHasteMap = require('jest-haste-map'); @@ -46,18 +45,13 @@ const { print, } = require('../Logger'); -const escapePath = (p: string) => { - return (path.sep === '\\') ? p.replace(/(\/|\\(?!\.))/g, '\\\\') : p; -}; - class DependencyGraph { - _opts: { + _opts: {| roots: Array, ignoreFilePath: (filePath: string) => boolean, watch: boolean, forceNodeFilesystemAPI: boolean, - assetRoots_DEPRECATED: Array, assetExts: Array, providesModuleNodeModules: Array, platforms: Set, @@ -67,17 +61,14 @@ class DependencyGraph { transformCode: TransformCode, transformCacheKey: string, shouldThrowOnUnresolvedErrors: () => boolean, - enableAssetMap: boolean, moduleOptions: ModuleOptions, extraNodeModules: mixed, useWatchman: boolean, maxWorkers: number, resetCache: boolean, - }; + |}; _assetDependencies: mixed; - _assetPattern: RegExp; _cache: Cache; - _deprecatedAssetMap: DeprecatedAssetMap; _fastfs: Fastfs; _haste: JestHasteMap; _hasteMap: HasteMap; @@ -92,7 +83,6 @@ class DependencyGraph { ignoreFilePath, watch, forceNodeFilesystemAPI, - assetRoots_DEPRECATED, assetExts, providesModuleNodeModules, platforms, @@ -103,7 +93,6 @@ class DependencyGraph { transformCode, transformCacheKey, shouldThrowOnUnresolvedErrors = () => true, - enableAssetMap, assetDependencies, moduleOptions, extraNodeModules, @@ -116,7 +105,6 @@ class DependencyGraph { ignoreFilePath: (filePath: string) => boolean, watch: boolean, forceNodeFilesystemAPI?: boolean, - assetRoots_DEPRECATED: Array, assetExts: Array, providesModuleNodeModules: Array, platforms: mixed, @@ -127,7 +115,6 @@ class DependencyGraph { transformCode: TransformCode, transformCacheKey: string, shouldThrowOnUnresolvedErrors: () => boolean, - enableAssetMap: boolean, assetDependencies: mixed, moduleOptions: ?ModuleOptions, extraNodeModules: mixed, @@ -140,7 +127,6 @@ class DependencyGraph { ignoreFilePath: ignoreFilePath || (() => {}), watch: !!watch, forceNodeFilesystemAPI: !!forceNodeFilesystemAPI, - assetRoots_DEPRECATED: assetRoots_DEPRECATED || [], assetExts: assetExts || [], providesModuleNodeModules, platforms: new Set(platforms || []), @@ -150,7 +136,6 @@ class DependencyGraph { transformCode, transformCacheKey, shouldThrowOnUnresolvedErrors, - enableAssetMap: enableAssetMap || true, moduleOptions: moduleOptions || { cacheTransformResults: true, }, @@ -160,8 +145,6 @@ class DependencyGraph { maxWorkers, resetCache, }; - this._assetPattern = - new RegExp('^' + this._opts.assetRoots_DEPRECATED.map(escapePath).join('|')); this._cache = cache; this._assetDependencies = assetDependencies; @@ -186,7 +169,7 @@ class DependencyGraph { providesModuleNodeModules: this._opts.providesModuleNodeModules, resetCache: this._opts.resetCache, retainAllFiles: true, - roots: this._opts.roots.concat(this._opts.assetRoots_DEPRECATED), + roots: this._opts.roots, useWatchman: this._opts.useWatchman, watch: this._opts.watch, }); @@ -225,15 +208,6 @@ class DependencyGraph { platforms: this._opts.platforms, }); - const assetFiles = hasteMap.hasteFS.matchFiles(this._assetPattern); - - this._deprecatedAssetMap = new DeprecatedAssetMap({ - helpers: this._helpers, - assetExts: this._opts.assetExts, - platforms: this._opts.platforms, - files: assetFiles, - }); - this._haste.on('change', ({eventsQueue}) => eventsQueue.forEach(({type, filePath, stat}) => this.processFileChange(type, filePath, stat) @@ -314,7 +288,6 @@ class DependencyGraph { platforms: this._opts.platforms, preferNativePlatform: this._opts.preferNativePlatform, entryPath: absPath, - deprecatedAssetMap: this._deprecatedAssetMap, hasteMap: this._hasteMap, helpers: this._helpers, moduleCache: this._moduleCache, @@ -371,9 +344,6 @@ class DependencyGraph { processFileChange(type: string, filePath: string, stat: Object) { this._fastfs.processFileChange(type, filePath, stat); this._moduleCache.processFileChange(type, filePath, stat); - if (this._assetPattern.test(filePath)) { - this._deprecatedAssetMap.processFileChange(type, filePath, stat); - } // This code reports failures but doesn't block recovery in the dev server // mode. When the hasteMap is left in an incorrect state, we'll rebuild when diff --git a/packager/rn-cli.config.js b/packager/rn-cli.config.js index c7741dfbc..3f6f4fd54 100644 --- a/packager/rn-cli.config.js +++ b/packager/rn-cli.config.js @@ -18,10 +18,6 @@ module.exports = { return this._getRoots(); }, - getAssetRoots() { - return this._getRoots(); - }, - getAssetExts() { return []; },