Skip to content

Rename from "proposal-upsert" to "proposal-getorinsert" #83

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

Open
styfle opened this issue Apr 14, 2025 · 5 comments
Open

Rename from "proposal-upsert" to "proposal-getorinsert" #83

styfle opened this issue Apr 14, 2025 · 5 comments

Comments

@styfle
Copy link
Contributor

styfle commented Apr 14, 2025

Generally "upsert" means your updating or creating.

But this method seems to be getting or creating.

Consider renaming this proposal from "proposal-upsert" to "proposal-getorinsert".

https://x.com/andrewqu_/status/1911830262528528468

@dminor
Copy link
Collaborator

dminor commented Apr 14, 2025

There was a time when this proposal was going to do something more along the lines of upsert. Then the design changed, and it was renamed to Map.prototype.emplace. We decided to change back to upsert when we moved away from the emplace design. We could have named it something that reflected the new design, but chose not to, in case the design changed again, causing another rename.

It's unlikely that that there will be another design change, and I agree the current name isn't great, but I'm not sure it's confusing enough to bring this back to committee to consider renaming it.

@styfle
Copy link
Contributor Author

styfle commented Apr 15, 2025

We could have named it something that reflected the new design, but chose not to, in case the design changed again, causing another rename.

I guess I don’t understand why there is any pushback to renaming. It should take no more than 10 minutes to find and replace all the places it’s used and then add redirects when necessary (renaming a GitHub repo already redirects automatically).

There was a time when this proposal was going to do something more along the lines of upsert.

That seems to be a stronger reason to rename because after this proposal lands, someone might make an upsert proposal and want to use the name.

@dminor
Copy link
Collaborator

dminor commented Apr 24, 2025

I think I would have to bring this back to the committee to ask for consensus for renaming it, which doesn't feel like the best use of committee time. If it was just about renaming this repository, I would do it.

Also, this will always be 'proposal-upsert' behind the scenes, we use the original repository name as a proposal identifier, so that name is unfortunately taken.

@ljharb
Copy link
Member

ljharb commented Apr 24, 2025

I don't think it requires consensus, but I also don't think it's worth any amount of churn at this point.

@styfle
Copy link
Contributor Author

styfle commented Apr 24, 2025

Yeah I guess the existing Map.prototype.set() already is a form of "upsert" since it will update or create.

I am curious about this though:

There was a time when this proposal was going to do something more along the lines of upsert

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

3 participants