Unverified Commit bc2c5bc1 authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

Turbopack: JSON is always side effect free (#76869)

I think this should be safe to assume?
parent ffe56640
......@@ -14,7 +14,7 @@ use std::fmt::Write;
use anyhow::{bail, Error, Result};
use turbo_rcstr::RcStr;
use turbo_tasks::{ResolvedVc, ValueToString, Vc};
use turbo_tasks_fs::{FileContent, FileJsonContent};
use turbo_tasks_fs::{glob::Glob, FileContent, FileJsonContent};
use turbopack_core::{
asset::{Asset, AssetContent},
chunk::{ChunkItem, ChunkType, ChunkableModule, ChunkingContext},
......@@ -86,6 +86,11 @@ impl EcmascriptChunkPlaceable for JsonModuleAsset {
fn get_exports(&self) -> Vc<EcmascriptExports> {
EcmascriptExports::Value.cell()
}
#[turbo_tasks::function]
fn is_marked_as_side_effect_free(&self, _side_effect_free_packages: Vc<Glob>) -> Vc<bool> {
Vc::cell(true)
}
}
#[turbo_tasks::value]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment