Skip to content

Commit

Permalink
Make EcmascriptDevChunkContent public to other crates (vercel/turbo…
Browse files Browse the repository at this point in the history
…repo#7160)

This is needed to read source map data to trace sourcemaps in Next.js


Closes PACK-2317
  • Loading branch information
wbinnssmith authored Jan 30, 2024
1 parent 49628b2 commit 8891f6b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion crates/turbopack-dev/src/ecmascript/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use super::{
use crate::DevChunkingContext;

#[turbo_tasks::value(serialization = "none")]
pub(super) struct EcmascriptDevChunkContent {
pub struct EcmascriptDevChunkContent {
pub(super) entries: Vc<EcmascriptDevChunkContentEntries>,
pub(super) chunking_context: Vc<DevChunkingContext>,
pub(super) chunk: Vc<EcmascriptDevChunk>,
Expand All @@ -45,6 +45,13 @@ impl EcmascriptDevChunkContent {
}
.cell())
}

#[turbo_tasks::function]
pub async fn entries(
self: Vc<EcmascriptDevChunkContent>,
) -> Result<Vc<EcmascriptDevChunkContentEntries>> {
Ok(self.await?.entries)
}
}

#[turbo_tasks::value_impl]
Expand Down
2 changes: 2 additions & 0 deletions crates/turbopack-dev/src/ecmascript/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ pub(crate) mod list;
pub(crate) mod merged;
pub(crate) mod update;
pub(crate) mod version;

pub use content::EcmascriptDevChunkContent;
2 changes: 1 addition & 1 deletion crates/turbopack-dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#![feature(arbitrary_self_types)]

pub(crate) mod chunking_context;
pub(crate) mod ecmascript;
pub mod ecmascript;
pub mod react_refresh;

pub use chunking_context::{DevChunkingContext, DevChunkingContextBuilder};
Expand Down

0 comments on commit 8891f6b

Please sign in to comment.