Skip to content

Commit 718510a

Browse files
committed
fix(core): remove whitespaces in tree.json
tree.json can grow too large to be serialized, as detailed in #27261. One reason why the file is very large is that the serialization uses indentation level of 2. Removing the whitespace from serialization will return a lot of spaces, and it is a very straightforward change. This is OK to do because the file is not meant to be read by human anyway. This PR implements the solution. Ideally, in the future we should also make it possible to split tree.json into multiple files or use the solution in bmoffatt@91edfec, to make it scalable. At that stage, it's also possible to turn indentation space back to 2 (perhaps to aid debugging). For now, however, this issue is blocking the deployment in our team, and we really need this fix to continue. Fixes #27261
1 parent ab6ba09 commit 718510a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/aws-cdk-lib/core/lib/private/tree-metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class TreeMetadata extends Construct {
7777
// tree.json
7878
if (key === 'parent') return undefined;
7979
return value;
80-
}, 2), { encoding: 'utf-8' });
80+
}), { encoding: 'utf-8' });
8181

8282
builder.addArtifact('Tree', {
8383
type: ArtifactType.CDK_TREE,

0 commit comments

Comments
 (0)