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

Finalize next-dev's DevBindingsOptions API (and remove __experimental__ prefix) #527

Closed
dario-piotrowicz opened this issue Nov 3, 2023 · 5 comments · Fixed by #612
Closed
Labels
blocked by external This can't be currently solved because of external factors (Vercel/Next, Pages, etc...)

Comments

@dario-piotrowicz
Copy link
Member

dario-piotrowicz commented Nov 3, 2023

In #486 we've added the next-dev submodule for adding local bindings to next dev.

The submodule exports the setupDevBindings function which accepts a DevBindingsOptions object for the various options.

Most of the options there follow Miniflare's API with the exception of textBindings (which in Miniflare is just bindings), adding a new term there could be worse/more confusing then just sticking with the (potentially confusing) bindings term (see #486 (comment)).

So before our next release we need to decide how the DevBindingsOptions object needs to look like, the alternatives are:

  • leave it as is (as it is clear enough)
  • leave it as is but replace textBindings with bindings (to align it more with Miniflare)
  • come up with some new structure that could make things more clear/intuitive (for example passing the bindings in an object structured like)
@dario-piotrowicz
Copy link
Member Author

dario-piotrowicz commented Nov 11, 2023

I had to make a release so that we could get this hot-fix in: #534

So I did release the next-dev submodule but I marked it as experimental: #537

So now what needs to be done is to revert #537 when we finalize the next-dev submodule's API

@dario-piotrowicz dario-piotrowicz changed the title Finalize next-dev's DevBindingsOptions API before the next stable release Finalize next-dev's DevBindingsOptions API (and remove __experimental__ prefix) Nov 11, 2023
@dario-piotrowicz
Copy link
Member Author

I think we should follow Wrangler's new API here

@dario-piotrowicz
Copy link
Member Author

dario-piotrowicz commented Nov 20, 2023

TODO after changing the API:

  • update the docs accordingly
  • in the docs add examples of usage of the supported supported resources (add env vars, DO, R2, etc...)
    (they could live in the examples documentation and have the next-dev docs link to them maybe)

@dario-piotrowicz
Copy link
Member Author

Note: the new Wrangler API accepts Uint8Array types for vars but Miniflare does not yet (but it's going to)

@dario-piotrowicz dario-piotrowicz added the blocked by external This can't be currently solved because of external factors (Vercel/Next, Pages, etc...) label Dec 1, 2023
@dario-piotrowicz
Copy link
Member Author

I've added the blocked by external label as this requires wrangler to be properly updated to surface the Bindings type (and potentially the getBindingsProxy utility) before we can proceed with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked by external This can't be currently solved because of external factors (Vercel/Next, Pages, etc...)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant