-
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
feat(remix-node)!: don't export fetch API #7293
feat(remix-node)!: don't export fetch API #7293
Conversation
2855f70
to
0c77a0e
Compare
🦋 Changeset detectedLatest commit: c3a37eb The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
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 |
0c77a0e
to
c409b47
Compare
I agree people should be calling |
@brophdawg11 I would disagree with this That's already a smaller public API we have to maintain |
IMO, this is breaking change that serves no functional purpose. What is the downside of continuing to allow folks to As much as I think we all want to - I don't think we are anywhere close to being able to use native So in my view - we need to allow folks to opt-into native |
Well that's the whole thing: once we want to drop, we can just make If we keep exporting these functions, we'll have to keep using them Apart from that: as part of V2 migration we're already telling people we won't call |
I think we want to keep using them, no? If we were to move to native That way folks still have the choice of using the polyfills in v2 until they are comfortable moving to the native implementation. We'd be deprecating the polyfill just like we deprecate any other feature - and give folks the same road of iterative adoption we aim for elsewhere. |
That's indeed also a possibility if you want to do so But still: imo we can still do this deprecation warning even if we don't have this functionality as the public API of the Node runtime The long term goal is to not use any adapter and/or runtime at all and we always do as much as possible to keep the public API of each adapter and runtime as much as possible the same |
I talked to @mjackson and he's OK with removing these exports and preventing folks from importing the polyfills. This means they'll only be able to use the global instances/types. This means polyfilled folks will be getting types from TS |
Let's get this rebased onto |
c409b47
to
2fa9c01
Compare
packages/remix-node/fetch.ts
Outdated
@@ -26,13 +22,6 @@ type NodeRequestInit = Omit< | |||
| Readable; |
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.
It looks like we've got a type issue coming from the Readable
here:
packages/remix-node/fetch.ts(59,25): error TS2345: Argument of type 'NodeRequestInit' is not assignable to parameter of type '(RequestInit & RequestExtraOptions) | undefined'.
Type 'NodeRequestInit' is not assignable to type 'RequestInit & RequestExtraOptions'.
Type 'NodeRequestInit' is not assignable to type 'RequestInit'.
Types of property 'body' are incompatible.
Type 'BodyInit | Readable | null | undefined' is not assignable to type 'BodyInit | null | undefined'.
Type 'Readable' is not assignable to type 'BodyInit | null | undefined'.
That came from #2736 which states "allow for ReadableStream's to be used as a body in node" so it sounds like it's relevant at first glance.
Internally, the WebRequest allows ReadableStream
bodies via:
type BodyInit = ReadableStream | XMLHttpRequestBodyInit;
But it feels like we need/want node's stream.Readable
to be able to be used too?
376235c
to
3077df2
Compare
Michael and I checked out this TS error above and he think's we can actually just get rid of the wrapper It seems right though since |
3077df2
to
c3a37eb
Compare
f79e6a5 now removes the |
Co-authored-by: Matt Brophy <[email protected]>
e2dfeaf
to
2a0819d
Compare
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
I know this issue is closed, but leaving as a breadcrumb link in case other folks upgrading from Remix V1 to V2 run into Follow up: #7567
|
Follow-up of #7271, #7205, #7294 & @jacob-ebey's #7230
People should call
installGlobals
instead