Skip to content

Commit bc2c5bc

Browse files
authored
Turbopack: JSON is always side effect free (vercel#76869)
I think this should be safe to assume?
1 parent ffe5664 commit bc2c5bc

File tree

1 file changed

+6
-1
lines changed
  • turbopack/crates/turbopack-json/src

1 file changed

+6
-1
lines changed

turbopack/crates/turbopack-json/src/lib.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::fmt::Write;
1414
use anyhow::{bail, Error, Result};
1515
use turbo_rcstr::RcStr;
1616
use turbo_tasks::{ResolvedVc, ValueToString, Vc};
17-
use turbo_tasks_fs::{FileContent, FileJsonContent};
17+
use turbo_tasks_fs::{glob::Glob, FileContent, FileJsonContent};
1818
use turbopack_core::{
1919
asset::{Asset, AssetContent},
2020
chunk::{ChunkItem, ChunkType, ChunkableModule, ChunkingContext},
@@ -86,6 +86,11 @@ impl EcmascriptChunkPlaceable for JsonModuleAsset {
8686
fn get_exports(&self) -> Vc<EcmascriptExports> {
8787
EcmascriptExports::Value.cell()
8888
}
89+
90+
#[turbo_tasks::function]
91+
fn is_marked_as_side_effect_free(&self, _side_effect_free_packages: Vc<Glob>) -> Vc<bool> {
92+
Vc::cell(true)
93+
}
8994
}
9095

9196
#[turbo_tasks::value]

0 commit comments

Comments
 (0)