Skip to content

Commit

Permalink
Remove non-implemented postProcessBundleSourcemap from docs and con…
Browse files Browse the repository at this point in the history
…fig (#890)

Summary:
Remove docs, type and config default for the non-implemented `postProcessBundleSourcemap`

Changelog:
**[Breaking]** Remove `postProcessBundleSourcemap` from config

*(Breaks consumers relying on the config default being populated with a function.)*

-- Original PR description follows --

As [the issue](#400) mentions the function is not implemented therefore I thought it should be removed from the public docs.

- #400

Pull Request resolved: #890

Test Plan: This is only a docs update no need for testing.

Reviewed By: jacdebug

Differential Revision: D41161760

Pulled By: robhogan

fbshipit-source-id: bd57f9db2192f16afec66dc85a1a6180dda84b89
  • Loading branch information
krystofwoldrich authored and facebook-github-bot committed Dec 19, 2022
1 parent 322dea8 commit 339794e
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 24 deletions.
6 changes: 0 additions & 6 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,12 +472,6 @@ Type: `({platform: ?string}) => $ReadOnlyArray<string>`

An optional list of polyfills to include in the bundle. The list defaults to a set of common polyfills for Number, String, Array, Object...

#### `postProcessBundleSourcemap`

Type: `PostProcessBundleSourcemap`

An optional function that can modify the code and source map of the bundle before it is written. Applied once for the entire bundle.

#### `getModulesRunBeforeMainModule`

Type: `(entryFilePath: string) => Array<string>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ Object {
"getPolyfills": [Function],
"getRunModuleStatement": [Function],
"polyfillModuleNames": Array [],
"postProcessBundleSourcemap": [Function],
"processModuleFilter": [Function],
},
"server": Object {
Expand Down Expand Up @@ -250,7 +249,6 @@ Object {
"getPolyfills": [Function],
"getRunModuleStatement": [Function],
"polyfillModuleNames": Array [],
"postProcessBundleSourcemap": [Function],
"processModuleFilter": [Function],
},
"server": Object {
Expand Down Expand Up @@ -417,7 +415,6 @@ Object {
"getPolyfills": [Function],
"getRunModuleStatement": [Function],
"polyfillModuleNames": Array [],
"postProcessBundleSourcemap": [Function],
"processModuleFilter": [Function],
},
"server": Object {
Expand Down Expand Up @@ -584,7 +581,6 @@ Object {
"getPolyfills": [Function],
"getRunModuleStatement": [Function],
"polyfillModuleNames": Array [],
"postProcessBundleSourcemap": [Function],
"processModuleFilter": [Function],
},
"server": Object {
Expand Down
13 changes: 0 additions & 13 deletions packages/metro-config/src/configTypes.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import type {CacheStore} from 'metro-cache';
import typeof MetroCache from 'metro-cache';
import type {CacheManagerFactory} from 'metro-file-map';
import type {CustomResolver} from 'metro-resolver';
import type {MixedSourceMap} from 'metro-source-map';
import type {JsTransformerConfig} from 'metro-transform-worker';
import type {TransformResult} from 'metro/src/DeltaBundler';
import type {
Expand All @@ -27,17 +26,6 @@ import type {
import type {Reporter} from 'metro/src/lib/reporting';
import type Server from 'metro/src/Server';

export type PostProcessBundleSourcemap = ({
code: Buffer | string,
map: MixedSourceMap,
outFileName: string,
...
}) => {
code: Buffer | string,
map: MixedSourceMap | string,
...
};

export type ExtraTransformOptions = {
+preloadedModules?: {[path: string]: true, ...} | false,
+ramGroups?: Array<string>,
Expand Down Expand Up @@ -141,7 +129,6 @@ type SerializerConfigT = {
getPolyfills: ({platform: ?string, ...}) => $ReadOnlyArray<string>,
getRunModuleStatement: (number | string) => string,
polyfillModuleNames: $ReadOnlyArray<string>,
postProcessBundleSourcemap: PostProcessBundleSourcemap,
processModuleFilter: (modules: Module<>) => boolean,
};

Expand Down
1 change: 0 additions & 1 deletion packages/metro-config/src/defaults/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const getDefaultValues = (projectRoot: ?string): ConfigT => ({
getRunModuleStatement: (moduleId: number | string) =>
`__r(${JSON.stringify(moduleId)});`,
getPolyfills: () => [],
postProcessBundleSourcemap: ({code, map, outFileName}) => ({code, map}),
getModulesRunBeforeMainModule: () => [],
processModuleFilter: module => true,
createModuleIdFactory: defaultCreateModuleIdFactory,
Expand Down

0 comments on commit 339794e

Please sign in to comment.