Skip to content
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

improve bundled assets handling #325

Merged

Conversation

dario-piotrowicz
Copy link
Member

@dario-piotrowicz dario-piotrowicz commented Jun 23, 2023

This PR allows us to handle vercel asset fetches such as the one present in this example: https://vercel.com/docs/concepts/functions/edge-functions/og-image-generation/og-image-examples#using-a-custom-font

Which makes it possible to use @vercel/og 🚀 😄

Result:
simple-wasm-pages-13.3.1 deployed at: https://a9aeda25.next-on-pages-test-5h3.pages.dev

resolves #39

@changeset-bot
Copy link

changeset-bot bot commented Jun 23, 2023

🦋 Changeset detected

Latest commit: 871f784

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@cloudflare/next-on-pages Patch
eslint-plugin-next-on-pages Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jun 23, 2023

🧪 Prereleases are available for testing 🧪

@cloudflare/next-on-pages

You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/next-on-pages/runs/5552609824/npm-package-next-on-pages-325

@cloudflare/eslint-plugin-next-on-pages

You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/next-on-pages/runs/5552609824/npm-package-eslint-plugin-next-on-pages-325

@dario-piotrowicz dario-piotrowicz force-pushed the improve-bin-assets-handling branch 2 times, most recently from d555515 to 25e5902 Compare June 27, 2023 09:48
@dario-piotrowicz dario-piotrowicz marked this pull request as ready for review June 27, 2023 10:41
@dario-piotrowicz dario-piotrowicz force-pushed the improve-bin-assets-handling branch 3 times, most recently from 60c88bc to a5d4b8b Compare July 6, 2023 21:15
@dario-piotrowicz
Copy link
Member Author

PS: these changes should replicate the fetchInlineAsset's functionality (I think they do)

@dario-piotrowicz dario-piotrowicz force-pushed the improve-bin-assets-handling branch from a5d4b8b to 8680420 Compare July 11, 2023 11:04
const assetsDir = join(distDir, 'assets');
await mkdir(assetsDir);
for (const { filename, originalFileLocation } of bundledAssetsInfo.values()) {
const newLocation = join(assetsDir, `${filename}.bin`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This saddens me :(

We need to give frameworks a way to emit a manifest with content-types which Wrangler can pick up cc. @RamIdeas .

Copy link
Member

@GregBrimble GregBrimble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tentatively approved, pending comments in DM

@dario-piotrowicz dario-piotrowicz force-pushed the improve-bin-assets-handling branch from 659249c to 146cc26 Compare July 13, 2023 10:59
@dario-piotrowicz dario-piotrowicz merged commit 619beea into cloudflare:main Jul 14, 2023
@dario-piotrowicz dario-piotrowicz deleted the improve-bin-assets-handling branch July 14, 2023 09:33
Kebab11noel pushed a commit to Likespace-Kft/next-on-pages that referenced this pull request Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: @vercel/og doesn't work
2 participants