-
Notifications
You must be signed in to change notification settings - Fork 27.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'canary' into wbinnssmith/fix-safari
- Loading branch information
Showing
35 changed files
with
5,465 additions
and
5,475 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,5 @@ | |
"registry": "https://registry.npmjs.org/" | ||
} | ||
}, | ||
"version": "13.4.20-canary.13" | ||
"version": "13.4.20-canary.14" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,7 +108,7 @@ | |
"@typescript-eslint/eslint-plugin": "6.1.0", | ||
"@typescript-eslint/parser": "6.1.0", | ||
"@vercel/fetch": "6.1.1", | ||
"@vercel/og": "0.5.9", | ||
"@vercel/og": "0.5.12", | ||
"@zeit/next-typescript": "1.1.2-canary.0", | ||
"abort-controller": "3.0.0", | ||
"alex": "9.1.0", | ||
|
@@ -208,7 +208,7 @@ | |
"request-promise-core": "1.1.2", | ||
"resolve-from": "5.0.0", | ||
"sass": "1.54.0", | ||
"satori": "0.10.1", | ||
"satori": "0.10.3", | ||
"scheduler-builtin": "npm:[email protected]", | ||
"scheduler-experimental-builtin": "npm:[email protected]", | ||
"seedrandom": "3.0.5", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
use anyhow::Result; | ||
use indexmap::indexmap; | ||
use indoc::formatdoc; | ||
use turbo_tasks::{Value, Vc}; | ||
use turbo_tasks_fs::{File, FileSystemPath}; | ||
use turbopack_binding::turbopack::{ | ||
core::{ | ||
asset::AssetContent, context::AssetContext, module::Module, reference_type::ReferenceType, | ||
virtual_source::VirtualSource, | ||
}, | ||
ecmascript::utils::StringifyJs, | ||
}; | ||
|
||
#[turbo_tasks::function] | ||
pub async fn wrap_edge_entry( | ||
context: Vc<Box<dyn AssetContext>>, | ||
project_root: Vc<FileSystemPath>, | ||
entry: Vc<Box<dyn Module>>, | ||
pathname: String, | ||
) -> Result<Vc<Box<dyn Module>>> { | ||
let source = formatdoc!( | ||
r#" | ||
import * as module from "MODULE" | ||
self._ENTRIES ||= {{}} | ||
self._ENTRIES[{}] = module | ||
"#, | ||
StringifyJs(&format_args!("middleware_{}", pathname)) | ||
); | ||
let file = File::from(source); | ||
|
||
// TODO(alexkirsz) Figure out how to name this virtual asset. | ||
let virtual_source = VirtualSource::new( | ||
project_root.join("edge-wrapper.js".to_string()), | ||
AssetContent::file(file.into()), | ||
); | ||
|
||
let inner_assets = indexmap! { | ||
"MODULE".to_string() => entry | ||
}; | ||
|
||
Ok(context.process( | ||
Vc::upcast(virtual_source), | ||
Value::new(ReferenceType::Internal(Vc::cell(inner_assets))), | ||
)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod context; | ||
pub mod entry; | ||
pub mod page_transition; | ||
pub mod route_regex; | ||
pub mod route_transition; |
Oops, something went wrong.