@markless/bundler 0.8.0 → 0.10.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.
@@ -1,4 +1,48 @@
1
- import { ArtifactChildMaterialization, ModuleGraphInterfaceArtifact, SemanticGraphArtifact, SemanticGraphInput } from "@markless/compiler";
1
+ import { ArtifactChildMaterialization, CompilerDiagnostic, ModuleGraphInterfaceArtifact, SemanticGraphArtifact, SemanticGraphInput } from "@markless/compiler";
2
+ import { Plugin } from "rolldown";
3
+ //#region src/prop-flow.d.ts
4
+ type PassedProp = {
5
+ readonly kind: 'fixed';
6
+ } | {
7
+ readonly kind: 'changing';
8
+ readonly source: string;
9
+ } | {
10
+ readonly kind: 'forwarded';
11
+ readonly props: ReadonlyArray<string>;
12
+ readonly source: string;
13
+ } | {
14
+ readonly kind: 'unknown';
15
+ readonly source: string;
16
+ };
17
+ type ModulePropFlow = {
18
+ readonly components: ReadonlyArray<{
19
+ readonly name: string;
20
+ readonly exportName?: string;
21
+ }>;
22
+ readonly decided: ReadonlyArray<{
23
+ readonly code: string;
24
+ readonly componentName: string;
25
+ readonly props: ReadonlyArray<string>;
26
+ readonly message: string;
27
+ }>;
28
+ readonly edges: ReadonlyArray<{
29
+ readonly id: string;
30
+ readonly parentComponentName: string;
31
+ readonly childComponentName: string;
32
+ readonly importSource?: string;
33
+ readonly importedName?: string;
34
+ readonly props: Readonly<Record<string, PassedProp>>;
35
+ readonly spread?: PassedProp;
36
+ }>;
37
+ };
38
+ //#endregion
39
+ //#region src/build/native-packing.d.ts
40
+ /** The pack each module was planned into, and the routes a shared pack serves. */
41
+ type PackOwnership = {
42
+ readonly packOf: (moduleId: string) => string | undefined;
43
+ readonly packRoutes: (pack: string) => ReadonlyArray<string> | undefined;
44
+ };
45
+ //#endregion
2
46
  //#region src/types.d.ts
3
47
  type MarklessEnvironment = 'client' | 'server' | 'lib';
4
48
  type MarklessClientOutput = 'full' | 'symbols-only';
@@ -27,7 +71,7 @@ interface MarklessRolldownOptions {
27
71
  rootDir?: string;
28
72
  buildId?: string;
29
73
  }
30
- type MarklessVirtualModuleType = 'payload' | 'prerender-wake' | 'render-data' | 'render-data-entry' | 'resolver' | 'resume' | 'settle' | 'symbol' | 'symbol-entry' | 'symbol-bundle' | 'trigger-group' | 'style';
74
+ type MarklessVirtualModuleType = 'payload' | 'prerender-wake' | 'render-data' | 'render-data-served' | 'render-data-entry' | 'resolver' | 'resume' | 'settle' | 'symbol' | 'symbol-bundle' | 'trigger-group' | 'style';
31
75
  type BuiltPrerenderRecords = {
32
76
  readonly state: import('@markless/serializer').ProtocolStatePayload;
33
77
  readonly view: import('@markless/serializer').ProtocolViewPayload;
@@ -57,6 +101,8 @@ interface TransformTsrxModuleInput {
57
101
  serverOnlyProps?: SemanticGraphInput['serverOnlyProps'];
58
102
  routeRoot?: SemanticGraphInput['routeRoot'];
59
103
  renderDataImportSources?: Readonly<Record<string, string>>;
104
+ /** Pages are rendered on the server, so a browser-side render loads full render data only when it runs. */
105
+ serverRenderedPages?: boolean;
60
106
  artifactChildMaterializations?: Readonly<Record<string, ArtifactChildMaterialization>>;
61
107
  symbols?: import('@markless/compiler').SymbolResolverModuleInput['symbols'];
62
108
  devResumeReexport?: boolean;
@@ -92,6 +138,7 @@ interface TransformTsrxModuleResult {
92
138
  interfaceHash: string;
93
139
  moduleImports: SemanticGraphArtifact['moduleImports'];
94
140
  artifactChildren: ReadonlyArray<ArtifactChildCandidate>;
141
+ propFlow?: ModulePropFlow;
95
142
  /** Imported constants a prop reads that this compile was not given. */
96
143
  importedConstantRequests?: ReadonlyArray<{
97
144
  readonly source: string;
@@ -129,6 +176,8 @@ interface MarklessTransformManifest {
129
176
  resolver: MarklessBuildModuleReference;
130
177
  symbols: MarklessSymbolManifestEntry[];
131
178
  runtimeDemandMap?: RuntimeDemandMapManifest;
179
+ /** This client module mounts through the direct-DOM renderer, which never reaches render()'s other paths. */
180
+ directCsr?: boolean;
132
181
  }
133
182
  interface MarklessBuildModuleReference {
134
183
  virtualModuleId: string;
@@ -189,12 +238,16 @@ type MarklessRolldownPluginApi = {
189
238
  declareServerOnlyProps: (resolve: (moduleId: string) => SemanticGraphInput['serverOnlyProps']) => void;
190
239
  /** A host plugin names, per root-relative module id, the modules it renders as pages. */
191
240
  declareRouteModules: (isRoute: (moduleId: string) => boolean) => void;
241
+ /** The packing pass names the pack each module went into, so the import map can list only chunks several pages load. */
242
+ declarePackOwnership: (packs: PackOwnership) => void;
192
243
  invalidateGeneratedModules: (parent: string, environment?: MarklessEnvironment, nextSource?: string) => string[] | Promise<string[]>;
193
244
  runtimeDemandMaps: () => Iterable<RuntimeDemandMapManifest | undefined>;
194
245
  runtimeDemandSources: () => Iterable<{
195
246
  readonly source: string;
196
247
  readonly map: RuntimeDemandMapManifest | undefined;
197
248
  }>;
249
+ /** Whether every compiled module of this build mounts through the direct-DOM renderer. */
250
+ directCsrOnly: () => boolean;
198
251
  };
199
252
  //#endregion
200
253
  export { TransformTsrxModuleInput as _, MarklessBundle as a, MarklessEnvironment as c, MarklessRolldownPluginApi as d, MarklessTransformManifest as f, PreloadGraphEntriesAdder as g, PreloadGraphEntries as h, MarklessBuildMetadata as i, MarklessManifest as l, PreloadGraphContext as m, GlobalInjections as n, MarklessBundleGraph as o, MarklessVirtualModule as p, MarklessAsset as r, MarklessDevServer as s, BundleGraphAdder as t, MarklessRolldownOptions as u, TransformTsrxModuleResult as v };
package/dist/vite.d.ts CHANGED
@@ -1,10 +1,15 @@
1
- import { c as MarklessEnvironment, g as PreloadGraphEntriesAdder, h as PreloadGraphEntries, i as MarklessBuildMetadata, l as MarklessManifest, m as PreloadGraphContext, n as GlobalInjections, t as BundleGraphAdder, u as MarklessRolldownOptions } from "./types-iOUoceJ-.js";
1
+ import { c as MarklessEnvironment, g as PreloadGraphEntriesAdder, h as PreloadGraphEntries, i as MarklessBuildMetadata, l as MarklessManifest, m as PreloadGraphContext, n as GlobalInjections, t as BundleGraphAdder, u as MarklessRolldownOptions } from "./types-B8YqEscg.js";
2
2
  import { Plugin } from "vite";
3
3
  //#region src/vite/index.d.ts
4
4
  export interface MarklessViteOptions extends MarklessRolldownOptions {
5
5
  clientEnvironment?: string;
6
6
  debug?: boolean;
7
7
  serverEnvironment?: string;
8
+ /**
9
+ * Keep each module's compile result under Vite's `cacheDir` (`markless-compile/`), keyed by the module's
10
+ * source, its compile inputs and the compiler's own files, so the next build reuses it. Default `true`.
11
+ */
12
+ compileCache?: boolean;
8
13
  }
9
14
  export declare function markless(options?: MarklessViteOptions): Plugin[];
10
15
  export type MarklessVitePlugin = ReturnType<typeof markless>[number];