-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(astrojs/cloudflare): SSR split file renaming misses ts endpoints #7555
Closed
alexanderniebuhr
wants to merge
12
commits into
withastro:main
from
alexanderniebuhr:alexanderniebuhr/hotfix-cloudflare-ssr-split-endpoint
+73
−34
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d9be04e
fix bug, where ts files where not renamed correctly
alexanderniebuhr 02df9c3
try to make rename logic more robust
alexanderniebuhr c051389
remove log
alexanderniebuhr 653a594
update tests
alexanderniebuhr fc7e764
update changeset
alexanderniebuhr 7d43623
cleanup
alexanderniebuhr f22a4c5
fix lint
alexanderniebuhr 8b17eb2
debug windows tests
alexanderniebuhr 27d69b7
fix windows support
alexanderniebuhr 509de8d
fix cloudflare directory code
alexanderniebuhr 5b2ebef
Merge branch 'main' into alexanderniebuhr/hotfix-cloudflare-ssr-split…
alexanderniebuhr 45c39e5
fix bug for cloudflare assets redirect
alexanderniebuhr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,5 @@ | ||
--- | ||
'@astrojs/cloudflare': patch | ||
--- | ||
|
||
fix bug where asset redirects caused Cloudflare error |
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,5 @@ | ||
--- | ||
'@astrojs/cloudflare': patch | ||
--- | ||
|
||
fix bug where `.ts` files are not renamed to `.js` |
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 |
---|---|---|
|
@@ -24,7 +24,13 @@ export function createExports(manifest: SSRManifest) { | |
const { pathname } = new URL(request.url); | ||
// static assets fallback, in case default _routes.json is not used | ||
if (manifest.assets.has(pathname)) { | ||
return next(request); | ||
// we need this so the page does not error | ||
// https://developers.cloudflare.com/pages/platform/functions/advanced-mode/#set-up-a-function | ||
return (runtimeEnv.env as unknown & { | ||
ASSETS: { | ||
fetch: typeof fetch; | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is already done for |
||
}).ASSETS.fetch(request); | ||
} | ||
|
||
let routeData = app.match(request, { matchNotFound: true }); | ||
|
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
Empty file.
Empty file.
Empty file.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This loop has a lot of memory allocation, let me know if I should consolidate the steps into more abstract steps?
@ematipico @matthewp