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

feat: support passing options to init open-next cloudflare dev function #469

Merged
merged 7 commits into from
Apr 1, 2025

Conversation

Juuldamen
Copy link
Contributor

To allow same behaviour as setupDevPlatform() from next-on-pages. In this case I assume the removal of passing options was not intended. If not, are there any alternatives to the below?

import { initOpenNextCloudflareForDev } from "@opennextjs/cloudflare";

initOpenNextCloudflareForDev({
  persist: {
    path: "../../.wrangler/state/v3/custom-dir",
  },
});

When testing with pnpm --filter playground15 preview the .wrangler directory is correctly created in the root of the project. But a .wrangler directory also appears within the playground15 directory. So I'm creating this PR so I can use a preview deployment to be able to test in my own app with D1. Or are there better ways to test in this repo itself?

image

Copy link

changeset-bot bot commented Mar 17, 2025

🦋 Changeset detected

Latest commit: 0de0116

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

This PR includes changesets to release 1 package
Name Type
@opennextjs/cloudflare 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

@vicb
Copy link
Contributor

vicb commented Mar 17, 2025

@dario-piotrowicz or @james-elicx do you have history/insights from next on pages?

Copy link

pkg-pr-new bot commented Mar 17, 2025

Open in Stackblitz

pnpm add https://pkg.pr.new/@opennextjs/cloudflare@469

commit: 0de0116

@james-elicx
Copy link
Collaborator

do you have history/insights from next on pages?

Nothing too much, it was just that some people wanted the ability to further configure what wrangler was going to do, e.g. where data was persisted like in the example above.

@vicb vicb requested a review from dario-piotrowicz March 19, 2025 11:07
Copy link
Contributor

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

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

Thanks a bunch @Juuldamen, overall looks good to me 😄

Just a couple of quick non-blocking suggestions:

  • we should also update the open-next docs accordingly (we can take care of it if you don't want to 🙂)
  • ideally this should also be tested (in next-on-pages we didn't have anything set up for dev e2es but here we do, so it would be quite nice if this could be somehow tested)

PS: you have some merge conflicts to resolve

@Juuldamen Juuldamen force-pushed the feature/platform-proxy-options branch from 3ab2f75 to b22548a Compare March 21, 2025 09:27
Copy link
Contributor

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

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

Thanks for the ping @Juuldamen 🙏 , sorry I didn't realize this PR was waiting for my review

I'll keep an eye on if from now on 🙂

(I just left one last small comment)

@Juuldamen Juuldamen force-pushed the feature/platform-proxy-options branch from 1a630aa to ee1712e Compare March 27, 2025 11:14
@vicb vicb merged commit aef8e51 into opennextjs:main Apr 1, 2025
7 checks passed
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.

5 participants