Commit 96bfd47a authored by Niklas Mischkulnig's avatar Niklas Mischkulnig

remove __NEXT_BUILD_ID for edge functions

parent edc8b9d4
......@@ -1350,15 +1350,19 @@ impl Project {
}
#[turbo_tasks::function]
pub(super) fn edge_env(&self) -> Vc<EnvMap> {
let edge_env = fxindexmap! {
rcstr!("__NEXT_BUILD_ID") => self.build_id.clone(),
pub(super) async fn edge_env(&self) -> Result<Vc<EnvMap>> {
let mut edge_env = fxindexmap! {
rcstr!("NEXT_SERVER_ACTIONS_ENCRYPTION_KEY") => self.encryption_key.clone(),
rcstr!("__NEXT_PREVIEW_MODE_ID") => self.preview_props.preview_mode_id.clone(),
rcstr!("__NEXT_PREVIEW_MODE_ENCRYPTION_KEY") => self.preview_props.preview_mode_encryption_key.clone(),
rcstr!("__NEXT_PREVIEW_MODE_SIGNING_KEY") => self.preview_props.preview_mode_signing_key.clone(),
};
Vc::cell(edge_env)
if !*self.next_config.has_deployment_id().await? {
// The build id is only needed at runtime when there is no deployment id.
edge_env.insert(rcstr!("__NEXT_BUILD_ID"), self.build_id.clone());
}
Ok(Vc::cell(edge_env))
}
#[turbo_tasks::function]
......
......@@ -1874,6 +1874,11 @@ impl NextConfig {
)
}
#[turbo_tasks::function]
pub fn has_deployment_id(&self) -> Vc<bool> {
Vc::cell(self.deployment_id.is_some())
}
#[turbo_tasks::function]
pub fn cache_kinds(&self) -> Vc<CacheKinds> {
let mut cache_kinds = CacheKinds::default();
......
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