@rspack/core 1.1.8 → 1.2.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/compiled/@swc/types/index.d.ts +20 -5
  2. package/compiled/@swc/types/license +1 -1
  3. package/compiled/@swc/types/package.json +1 -1
  4. package/dist/Chunk.d.ts +21 -28
  5. package/dist/ChunkGraph.d.ts +8 -4
  6. package/dist/ChunkGroup.d.ts +13 -19
  7. package/dist/Compilation.d.ts +5 -9
  8. package/dist/Compiler.d.ts +1 -0
  9. package/dist/Entrypoint.d.ts +4 -3
  10. package/dist/ExportsInfo.d.ts +20 -0
  11. package/dist/FileSystem.d.ts +17 -17
  12. package/dist/Module.d.ts +6 -8
  13. package/dist/ModuleGraph.d.ts +6 -0
  14. package/dist/ModuleGraphConnection.d.ts +11 -0
  15. package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
  16. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
  17. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
  18. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
  19. package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
  20. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
  21. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
  22. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
  23. package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +1 -1
  24. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
  25. package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
  26. package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
  27. package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
  28. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +8 -10
  29. package/dist/builtin-plugin/DllEntryPlugin.d.ts +1 -1
  30. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
  31. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
  32. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
  33. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
  34. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
  35. package/dist/builtin-plugin/EntryPlugin.d.ts +11 -3
  36. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
  37. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
  38. package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
  39. package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
  40. package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -1
  41. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
  42. package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +1 -1
  43. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
  44. package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
  45. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
  46. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
  47. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
  48. package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -1
  49. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -1
  50. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
  51. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
  52. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
  53. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
  54. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
  55. package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +8 -10
  56. package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +1 -1
  57. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
  58. package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +10 -0
  59. package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
  60. package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
  61. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
  62. package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +1 -1
  63. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
  64. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
  65. package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
  66. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
  67. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
  68. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
  69. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
  70. package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
  71. package/dist/builtin-plugin/base.d.ts +1 -1
  72. package/dist/builtin-plugin/css-extract/index.d.ts +1 -0
  73. package/dist/builtin-plugin/index.d.ts +1 -0
  74. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
  75. package/dist/config/adapter.d.ts +2 -4
  76. package/dist/config/adapterRuleUse.d.ts +32 -8
  77. package/dist/config/normalization.d.ts +18 -2
  78. package/dist/config/types.d.ts +33 -11
  79. package/dist/config/zod.d.ts +1279 -1253
  80. package/dist/container/ContainerPlugin.d.ts +1 -1
  81. package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
  82. package/dist/exports.d.ts +1 -0
  83. package/dist/index.js +1376 -1379
  84. package/dist/util/hash/wasm-hash.d.ts +1 -1
  85. package/dist/util/identifier.d.ts +0 -36
  86. package/package.json +8 -7
@@ -11,6 +11,7 @@ export interface CssExtractRspackPluginOptions {
11
11
  linkType?: string | "text/css" | false;
12
12
  runtime?: boolean;
13
13
  pathinfo?: boolean;
14
+ enforceRelative?: boolean;
14
15
  }
15
16
  export declare class CssExtractRspackPlugin {
16
17
  static pluginName: string;
@@ -46,6 +46,7 @@ export * from "./NamedModuleIdsPlugin";
46
46
  export * from "./NaturalChunkIdsPlugin";
47
47
  export * from "./NaturalModuleIdsPlugin";
48
48
  export * from "./NodeTargetPlugin";
49
+ export * from "./OccurrenceChunkIdsPlugin";
49
50
  export * from "./ProgressPlugin";
50
51
  export * from "./ProvidePlugin";
51
52
  export * from "./RealContentHashPlugin";
@@ -17,7 +17,7 @@ export declare const BuiltinLazyCompilationPlugin: {
17
17
  data: string;
18
18
  client: string;
19
19
  }, cacheable: boolean, entries: boolean, imports: boolean, test?: RegExp | ((m: JsModule) => boolean) | undefined];
20
- affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
20
+ affectedHooks: "done" | "make" | "environment" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
21
21
  raw(compiler: import("../..").Compiler): import("@rspack/binding").BuiltinPlugin;
22
22
  apply(compiler: import("../..").Compiler): void;
23
23
  };
@@ -1,10 +1,8 @@
1
- import { type JsLibraryOptions, type RawOptions } from "@rspack/binding";
1
+ import { type RawOptions } from "@rspack/binding";
2
2
  import type { Compiler } from "../Compiler";
3
3
  import { type LoaderContext, type LoaderDefinition, type LoaderDefinitionFunction } from "./adapterRuleUse";
4
4
  import type { RspackOptionsNormalized } from "./normalization";
5
- import type { ChunkLoading, LibraryOptions, Resolve } from "./types";
5
+ import type { Resolve } from "./types";
6
6
  export type { LoaderContext, LoaderDefinition, LoaderDefinitionFunction };
7
7
  export declare const getRawOptions: (options: RspackOptionsNormalized, compiler: Compiler) => RawOptions;
8
8
  export declare function getRawResolve(resolve: Resolve): RawOptions["resolve"];
9
- export declare function getRawLibrary(library: LibraryOptions): JsLibraryOptions;
10
- export declare function getRawChunkLoading(chunkLoading: ChunkLoading): string;
@@ -6,10 +6,10 @@ import type { Module } from "../Module";
6
6
  import { type LoaderObject } from "../loader-runner";
7
7
  import type { Logger } from "../logging/Logger";
8
8
  import type Hash from "../util/hash";
9
+ import type { RspackOptionsNormalized } from "./normalization";
9
10
  import type { Mode, PublicPath, Resolve, RuleSetUseItem, Target } from "./types";
10
11
  export declare const BUILTIN_LOADER_PREFIX = "builtin:";
11
12
  export interface ComposeJsUseOptions {
12
- devtool: RawOptions["devtool"];
13
13
  context: RawOptions["context"];
14
14
  mode: RawOptions["mode"];
15
15
  experiments: RawOptions["experiments"];
@@ -58,6 +58,20 @@ export interface Diagnostic {
58
58
  interface LoaderExperiments {
59
59
  emitDiagnostic(diagnostic: Diagnostic): void;
60
60
  }
61
+ export interface ImportModuleOptions {
62
+ /**
63
+ * Specify a layer in which this module is placed/compiled
64
+ */
65
+ layer?: string;
66
+ /**
67
+ * The public path used for the built modules
68
+ */
69
+ publicPath?: PublicPath;
70
+ /**
71
+ * Target base uri
72
+ */
73
+ baseUri?: string;
74
+ }
61
75
  export interface LoaderContext<OptionsType = {}> {
62
76
  version: 2;
63
77
  resource: string;
@@ -116,11 +130,21 @@ export interface LoaderContext<OptionsType = {}> {
116
130
  getContextDependencies(): string[];
117
131
  getMissingDependencies(): string[];
118
132
  addBuildDependency(file: string): void;
119
- importModule(request: string, options: {
120
- layer?: string;
121
- publicPath?: PublicPath;
122
- baseUri?: string;
123
- }, callback: (err?: Error, res?: any) => void): void;
133
+ /**
134
+ * Compile and execute a module at the build time.
135
+ * This is an alternative lightweight solution for the child compiler.
136
+ * `importModule` will return a Promise if no callback is provided.
137
+ *
138
+ * @example
139
+ * ```ts
140
+ * const modulePath = path.resolve(__dirname, 'some-module.ts');
141
+ * const moduleExports = await this.importModule(modulePath, {
142
+ * // optional options
143
+ * });
144
+ * ```
145
+ */
146
+ importModule<T = any>(request: string, options: ImportModuleOptions | undefined, callback: (err?: null | Error, exports?: T) => any): void;
147
+ importModule<T = any>(request: string, options?: ImportModuleOptions): Promise<T>;
124
148
  fs: any;
125
149
  /**
126
150
  * This is an experimental API and maybe subject to change.
@@ -152,6 +176,6 @@ export type LoaderDefinition<OptionsType = {}, ContextAdditions = {}> = LoaderDe
152
176
  pitch?: PitchLoaderDefinitionFunction;
153
177
  };
154
178
  export declare function createRawModuleRuleUses(uses: RuleSetUseItem | RuleSetUseItem[], path: string, options: ComposeJsUseOptions): RawModuleRuleUse[];
155
- export declare function isUseSourceMap(devtool: RawOptions["devtool"]): boolean;
156
- export declare function isUseSimpleSourceMap(devtool: RawOptions["devtool"]): boolean;
179
+ export declare function isUseSourceMap(devtool: RspackOptionsNormalized["devtool"]): boolean;
180
+ export declare function isUseSimpleSourceMap(devtool: RspackOptionsNormalized["devtool"]): boolean;
157
181
  export {};
@@ -8,7 +8,7 @@
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
10
  import type { Compilation } from "../Compilation";
11
- import type { AssetModuleFilename, Bail, CacheOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryDescription, Environment, ExperimentCacheOptions, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, ImportMetaName, Incremental, InfrastructureLogging, LazyCompilationOptions, LibraryOptions, Loader, Mode, Name, NoParseOption, Node, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, Profile, PublicPath, Resolve, RspackFutureOptions, RspackOptions, RuleSetRules, ScriptType, SnapshotOptions, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from "./types";
11
+ import type { AssetModuleFilename, Bail, CacheOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryDescription, Environment, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, ImportMetaName, Incremental, InfrastructureLogging, LazyCompilationOptions, LibraryOptions, Loader, Mode, Name, NoParseOption, Node, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, Profile, PublicPath, Resolve, RspackFutureOptions, RspackOptions, RuleSetRules, ScriptType, SnapshotOptions, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from "./types";
12
12
  export declare const getNormalizedRspackOptions: (config: RspackOptions) => RspackOptionsNormalized;
13
13
  export type EntryDynamicNormalized = () => Promise<EntryStaticNormalized>;
14
14
  export type EntryNormalized = EntryDynamicNormalized | EntryStaticNormalized;
@@ -75,8 +75,24 @@ export interface ModuleOptionsNormalized {
75
75
  generator: GeneratorOptionsByModuleType;
76
76
  noParse?: NoParseOption;
77
77
  }
78
+ export type ExperimentCacheNormalized = boolean | {
79
+ type: "memory";
80
+ } | {
81
+ type: "persistent";
82
+ buildDependencies: string[];
83
+ version: string;
84
+ snapshot: {
85
+ immutablePaths: Array<string | RegExp>;
86
+ unmanagedPaths: Array<string | RegExp>;
87
+ managedPaths: Array<string | RegExp>;
88
+ };
89
+ storage: {
90
+ type: "filesystem";
91
+ directory: string;
92
+ };
93
+ };
78
94
  export interface ExperimentsNormalized {
79
- cache?: ExperimentCacheOptions;
95
+ cache?: ExperimentCacheNormalized;
80
96
  lazyCompilation?: false | LazyCompilationOptions;
81
97
  asyncWebAssembly?: boolean;
82
98
  outputModule?: boolean;
@@ -765,6 +765,12 @@ export type JavascriptParserOptions = {
765
765
  requireResolve?: boolean;
766
766
  importDynamic?: boolean;
767
767
  };
768
+ export type JsonParserOptions = {
769
+ /**
770
+ * The depth of json dependency flagged as `exportInfo`.
771
+ */
772
+ exportsDepth?: number;
773
+ };
768
774
  /** Configure all parsers' options in one place with module.parser. */
769
775
  export type ParserOptionsByModuleTypeKnown = {
770
776
  /** Parser options for `asset` modules. */
@@ -783,6 +789,8 @@ export type ParserOptionsByModuleTypeKnown = {
783
789
  "javascript/dynamic"?: JavascriptParserOptions;
784
790
  /** Parser options for `javascript/esm` modules. */
785
791
  "javascript/esm"?: JavascriptParserOptions;
792
+ /** Parser options for `json` modules. */
793
+ json?: JsonParserOptions;
786
794
  };
787
795
  /** Configure all parsers' options in one place with module.parser. */
788
796
  export type ParserOptionsByModuleTypeUnknown = {
@@ -794,9 +802,9 @@ export type AssetGeneratorDataUrlOptions = {
794
802
  encoding?: false | "base64";
795
803
  mimetype?: string;
796
804
  };
797
- export type AssetGeneratorDataUrlFunction = (options: {
805
+ export type AssetGeneratorDataUrlFunction = (content: Buffer, context: {
798
806
  filename: string;
799
- content: string;
807
+ module: Module;
800
808
  }) => string;
801
809
  export type AssetGeneratorDataUrl = AssetGeneratorDataUrlOptions | AssetGeneratorDataUrlFunction;
802
810
  /** Options for asset inline modules. */
@@ -804,6 +812,8 @@ export type AssetInlineGeneratorOptions = {
804
812
  /** Only for modules with module type 'asset' or 'asset/inline'. */
805
813
  dataUrl?: AssetGeneratorDataUrl;
806
814
  };
815
+ /** Emit the asset in the specified folder relative to 'output.path'. */
816
+ export type AssetModuleOutputPath = Filename;
807
817
  /** Options for asset modules. */
808
818
  export type AssetResourceGeneratorOptions = {
809
819
  /**
@@ -813,6 +823,8 @@ export type AssetResourceGeneratorOptions = {
813
823
  emit?: boolean;
814
824
  /** This option determines the name of each asset resource output bundle.*/
815
825
  filename?: Filename;
826
+ /** Emit the asset in the specified folder relative to 'output.path' */
827
+ outputPath?: AssetModuleOutputPath;
816
828
  /** This option determines the URL prefix of the referenced 'asset' or 'asset/resource'*/
817
829
  publicPath?: PublicPath;
818
830
  };
@@ -954,7 +966,7 @@ export type ExternalItemFunctionData = {
954
966
  * }
955
967
  * ```
956
968
  * */
957
- export type ExternalItem = string | RegExp | ExternalItemObjectUnknown | ((data: ExternalItemFunctionData, callback: (err?: Error, result?: ExternalItemValue, type?: ExternalsType) => void) => void) | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
969
+ export type ExternalItem = string | RegExp | ExternalItemObjectUnknown | ((data: ExternalItemFunctionData) => ExternalItemValue) | ((data: ExternalItemFunctionData, callback: (err?: Error, result?: ExternalItemValue, type?: ExternalsType) => void) => void) | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
958
970
  /**
959
971
  * Prevent bundling of certain imported packages and instead retrieve these external dependencies at runtime.
960
972
  *
@@ -1556,7 +1568,7 @@ export type OptimizationSplitChunksCacheGroup = {
1556
1568
  */
1557
1569
  enforce?: boolean;
1558
1570
  /** Allows to override the filename when and only when it's an initial chunk. */
1559
- filename?: string;
1571
+ filename?: Filename;
1560
1572
  /**
1561
1573
  * Whether to reuse existing chunks when possible.
1562
1574
  * @default false
@@ -1600,7 +1612,7 @@ export type Optimization = {
1600
1612
  /**
1601
1613
  * Which algorithm to use when choosing chunk ids.
1602
1614
  */
1603
- chunkIds?: "natural" | "named" | "deterministic";
1615
+ chunkIds?: "natural" | "named" | "deterministic" | "size" | "total-size";
1604
1616
  /**
1605
1617
  * Whether to minimize the bundle.
1606
1618
  * The value is `true` in production mode.
@@ -1697,6 +1709,10 @@ export type Optimization = {
1697
1709
  * The value is `true` in development mode.
1698
1710
  * */
1699
1711
  emitOnErrors?: boolean;
1712
+ /**
1713
+ * Avoid wrapping the entry module in an IIFE.
1714
+ */
1715
+ avoidEntryIife?: boolean;
1700
1716
  };
1701
1717
  /**
1702
1718
  * Options for caching snapshots and intermediate products during the build process.
@@ -1713,14 +1729,16 @@ export type ExperimentCacheOptions = boolean | {
1713
1729
  type: "memory";
1714
1730
  } | {
1715
1731
  type: "persistent";
1716
- snapshot: {
1717
- immutablePaths: Array<string | RegExp>;
1718
- unmanagedPaths: Array<string | RegExp>;
1719
- managedPaths: Array<string | RegExp>;
1732
+ buildDependencies?: string[];
1733
+ version?: string;
1734
+ snapshot?: {
1735
+ immutablePaths?: Array<string | RegExp>;
1736
+ unmanagedPaths?: Array<string | RegExp>;
1737
+ managedPaths?: Array<string | RegExp>;
1720
1738
  };
1721
- storage: {
1739
+ storage?: {
1722
1740
  type: "filesystem";
1723
- directory: string;
1741
+ directory?: string;
1724
1742
  };
1725
1743
  };
1726
1744
  /**
@@ -1836,6 +1854,10 @@ export type Incremental = {
1836
1854
  * Enables diagnostics for dependencies.
1837
1855
  */
1838
1856
  dependenciesDiagnostics?: boolean;
1857
+ /**
1858
+ * Enables incremental side effects optimization.
1859
+ */
1860
+ sideEffects?: boolean;
1839
1861
  /**
1840
1862
  * Enable incremental build chunk graph.
1841
1863
  */