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

Got 12 planning #1466

Closed
1 of 2 tasks
sindresorhus opened this issue Sep 16, 2020 · 46 comments
Closed
1 of 2 tasks

Got 12 planning #1466

sindresorhus opened this issue Sep 16, 2020 · 46 comments
Milestone

Comments

@sindresorhus
Copy link
Owner

sindresorhus commented Sep 16, 2020

There are a few issues: https://github.com/sindresorhus/got/milestone/9

Anything else we want to change that is risky or breaking? It doesn't have to be a big breaking release though.

  • Rename lookup option to dnsLookup
  • Throw an error here:

    got/source/create.ts

    Lines 138 to 149 in 2b40da2

    // TODO: Remove this in Got 12.
    if (is.plainObject(url)) {
    const mergedOptions = {
    ...url as Options,
    ...options
    };
    setNonEnumerableProperties([url as Options, options], mergedOptions);
    options = mergedOptions;
    url = undefined as any;
    }

// @szmarczak @Giotino

@sindresorhus
Copy link
Owner Author

@szmarczak I believe there was a breaking change we wanted to do to improve Node.js 15 compatibility?

@szmarczak
Copy link
Collaborator

Yes. It would introduce a new error event: retryError.

@szmarczak szmarczak pinned this issue Sep 16, 2020
@szmarczak
Copy link
Collaborator

Should there be a separate branch for Got 12 development?

@sindresorhus
Copy link
Owner Author

I think #1353 would also be breaking.

@sindresorhus
Copy link
Owner Author

Should there be a separate branch for Got 12 development?

No, we can get out one more minor release and then switch the focus of master to v12.

@szmarczak szmarczak added this to the Got v12 milestone Sep 17, 2020
@Giotino
Copy link
Collaborator

Giotino commented Sep 17, 2020

What about this? #1306 (comment)

By not sending Got options directly to the request module we can have more control on the request, and we can swap the underlying request module without breaking Got (e.g. testing Undici and use it if it suits our needs).

This does not have to be breaking. I think we can achieve this without changing the options and the behavior.

@sindresorhus
Copy link
Owner Author

What about this? #1306 (comment)

👍🏻 Yes, we can do that one too.

@szmarczak
Copy link
Collaborator

Unless there's anything else I think we can release 11.7.0.

@sindresorhus
Copy link
Owner Author

Unless there's anything else I think we can release 11.7.0.

Done: https://github.com/sindresorhus/got/releases/tag/v11.7.0

We can start preparing for Got 12 now.

@Giotino
Copy link
Collaborator

Giotino commented Sep 22, 2020

Should there be a separate branch for Got 12 development?

I think we should use a new branch before the release, in order to continue patching the current release, if needed.

@sindresorhus
Copy link
Owner Author

I'd rather do a v11 branch for that, if we need to backport.

@kanongil
Copy link

kanongil commented Nov 4, 2020

There is note that http2 will be enabled by default for v12. Is this still the case, given the poor state of http2 support in node.js?

@szmarczak
Copy link
Collaborator

Is this still the case, given the poor state of http2 support in node.js?

I think we'll stick to HTTP/1.1. HTTP/2 is too much broken as of now and needs many improvements on the Node.js side, that's why the http2-wrapper development has stopped for a while.

@sffc
Copy link

sffc commented Jan 4, 2021

Thanks for maintaining this project!

Just as general feedback, the frequent major version bumps on Got are disruptive and make it hard to use. I'm currently juggling at least 3 versions of Got throughout my projects, and I am trying to migrate them all to version 11, but pretty soon they will all be out of date again. The differences between the versions are mostly small changes to option names (like "query" versus "searchParams", the semantics of the "json" option, etc). TypeScript helps this somewhat, but I thought I'd advocate for putting more of a priority on API stability and making minor version releases instead of major ones.

P.S. I support @sindresorhus on Patreon.

@sindresorhus
Copy link
Owner Author

sindresorhus commented Jan 5, 2021

@sffc Got 10 was a pretty large breaking release. Out of necessity. Got had amassed a lot of legacy and bloat and we felt we had to clean it up, otherwise, it would be too hard to maintain Got going forward. The JSON change was the most important change as the previous JSON behavior was both surprising to new users, limiting and buggy. I'm very glad we did that change. The querysearchParams change was probably not necessary, but it does help new users familiar with Fetch in the browser. Going forward we don't plan on doing a lot of breaking changes, but we do need to do some once in a while. Our release notes are always detailed with migration steps for every breaking change.

As you can see from the previous releases, we have done approximately one major release a year, which I think it's ok and what many larger projects do:

  • Got 9: Aug 4, 2018
  • Got 10: Dec 1, 2019
  • Got 11: Apr 20, 2020
  • Got 12: ~March 2021

Just know that we do care deeply about API stability.

@sffc
Copy link

sffc commented Jan 5, 2021

Thanks! I have versions 6, 8, and 11 that I was reconciling. Glad to hear that the project is maturing with better stability moving forward.

@bompus
Copy link

bompus commented Feb 17, 2021

Are there any plans to use undici for Got 12? I see it mentioned, but not sure what is involved with swapping in a different http request module.

@sindresorhus
Copy link
Owner Author

@bompus Not for Got 12, but we are closely following Undici development and might use it in the future.

@sindresorhus
Copy link
Owner Author

Just FYI. We're targeting Got v12 for the end of March.

@Nytelife26
Copy link

I would suggest a bit of clean up with this release if possible. Ultimately, Got is way bigger than it needs to be, and also lacking in the performance department.
Compared with a simple low level HTTP library that can do almost everything Got can,

Ultimately that is what has stopped me, all Kludge CS projects, Syrus, and many others from using Got. Just a bit of constructive criticism.

@szmarczak
Copy link
Collaborator

@Nytelife26 Most of the install size is TypeScript Node types. Consider opening an issue in the TypeScript repo.

@sindresorhus
Copy link
Owner Author

and also lacking in the performance department.

Any specifics or numbers to share? 🙏

Compared with a simple low-level HTTP library that can do almost everything Got can,

That is a common fallacy. From experience, the "almost" part eventually turns out to be much more. I'm talking from experience. Got actually started out as a 50 line package, but after years of being used in production, the messy reality of networking and countless of Node.js bugs has made Got larger than 50 lines.

@szmarczak
Copy link
Collaborator

I just noticed the more retries there are, the more errors will be created on promise.cancel():

reject(new CancelError(request));

The solution is to move it before makeRequest and use global request instead.

@szmarczak
Copy link
Collaborator

const request = new Request(undefined, normalizedOptions);
should reuse the previous request options on retry because promise.json() modifies the options

@Nytelife26
Copy link

Nytelife26 commented Mar 19, 2021

Any specifics or numbers to share?

Yes! I'm back with numbers, which you can see here, forked from your original Got benchmark suite (apologies for the delay).

off-topic

the "almost" part eventually turns out to be much more.

Name something you can do with Got and I'm certain I can do it with the other faster libraries too, even if it requires a little more effort (but then again such things tend to be out of scope at the library level anyway).

Got actually started out as a 50 line package

That's actually pretty impressive, I never would've guessed. A lot of your packages tend to be quite negatively impactful due to their oversharing amongst the ecosystem, however, you are definitely a competent developer in some respects.

@szmarczak

This comment has been minimized.

@szmarczak

This comment has been minimized.

@szmarczak

This comment has been minimized.

@szmarczak

This comment has been minimized.

@szmarczak

This comment has been minimized.

@Nytelife26

This comment has been minimized.

@szmarczak

This comment has been minimized.

@Nytelife26

This comment has been minimized.

@szmarczak
Copy link
Collaborator

szmarczak commented Mar 20, 2021

off-topic

when it doesn't include what we're talking about.

I thought we were talking about features, weren't we?

NPM installs every different version every package uses.

Every package manager does this. Forcing upgrades is breaking.

while they're not useless, the harm outweighs the good in such cases.

I disagree here, but I'm not going to continue about this.

the comparison table is irrelevant when it doesn't include what we're talking about.

"it doesn't include what we're talking about" doesn't make your point clear as well. I have directly mentioned the word "feature" and kept on linking to the comparison table which shows Got features.

I'm also picking up a fair amount of passive-aggressiveness, which isn't entirely appreciated.

I'm not arguing, nor I'm going to. You have your own opinion - and that's right. I don't have to agree nor disagree.

"Ok, cool" is hardly a valid response to concerns or constructive criticism.

I don't think

I could do a lot of those things with the other packages, even if not out of the box.

is constructive criticism. You just expressed what you are capable of and it isn't about Got.

So here's the same reply but more comprehensive: I acknowledge that you are capable of providing the same features Got has. I'm not saying you must not. I'm not saying Got is better. I'm not saying your solution is wrong. Feel free to use what you are comfortable with.

I'm going to mark our comments as off-topic now. If you wish to continue this discussion / start a new one, don't hesitate to open a new issue.

@szmarczak

This comment has been minimized.

@szmarczak
Copy link
Collaborator

@danm
Copy link

danm commented Oct 27, 2021

Hi!, any idea when v12 will land - is beta.4 safe to use? Thanks! ❤️

@szmarczak
Copy link
Collaborator

is beta.4 safe to use?

Yes, it's safe to use. It's been running in production for a long long time. We will do a release as soon as possible.

@sindresorhus
Copy link
Owner Author

Closing as we'll be releasing v12 soon.

@sindresorhus sindresorhus unpinned this issue Dec 10, 2021
@szmarczak
Copy link
Collaborator

Released [email protected] 🎉

@jfoclpf
Copy link

jfoclpf commented May 15, 2023

My app started breaking in v12. Did you stop supporting require?

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/joao/dev/geoapi.pt/node_modules/got/dist/source/index.js from /home/joao/dev/geoapi.pt/src/server/services/getNominatimData.js not supported.

@Shinigami92
Copy link

My app started breaking in v12. Did you stop supporting require?

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/joao/dev/geoapi.pt/node_modules/got/dist/source/index.js from /home/joao/dev/geoapi.pt/src/server/services/getNominatimData.js not supported.

Dude... NodeJS v14 reached EOL on 2023-04-30 https://github.com/nodejs/Release
Please upgrade to NodeJS v16 immediately!

@jfoclpf
Copy link

jfoclpf commented May 15, 2023

@Shinigami92 I'm using node 16, thus I don't get your comment

$ node -v
v16.20.0

and NodeJs has no plans for deprecating CommonsJS
nodejs/node#33954

@Shinigami92
Copy link

@Shinigami92 I'm using node 16, thus I don't get your comment


$ node -v

v16.20.0

Oh don't mind me, sorry. I thought you referring to NodeJS v12, my bad

@jfoclpf
Copy link

jfoclpf commented May 15, 2023

I meant that the app started breaking at got v 12. Downgraded to got v 11 and it worked again. Why remove support for CJS?

@modestfake
Copy link

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

No branches or pull requests