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

How to understand the word "taint" in the new APIs taintObjectReference and taintUniqueValue? #6343

Open
Yucohny opened this issue Oct 7, 2023 · 9 comments

Comments

@Yucohny
Copy link

Yucohny commented Oct 7, 2023

When I'm translating the docs reference/react/experimental_taintObjectReference and reference/react/experimental_taintUniqueValue into Chinese, I'm thinking the deep meaning of the word "taint".
The explanation of the "taint" is to damage or spoil the quality, or the effect of something bad or unpleasant that spoils the quality, which carries a somewhat negative connotation. However, considering the documentations' description of the APIs, it's difficult to detect any negative sentiment. In terms of meaning, it appears that "taint" simply signifies the marking of something with some special behavior.
I understand that Kubernetes has related concepts regarding "taint", but I feel that these two cannot be directly equated. I would like to know how React describes the meaning of "taint"?
Thanks a lot.

@eps1lon
Copy link
Collaborator

eps1lon commented Oct 7, 2023

I'd look at how tain checking or related concepts in Computer Science are translated. Does that help?

@Yucohny
Copy link
Author

Yucohny commented Oct 7, 2023

@eps1lon Thanks for you response.
In traditional computer science, the meaning of taint may be consistent with its original meaning - taint means the effect of something bad or unpleasant that spoils the quality (as a noun).
It is true that it can be understood and translated in this way in the experimental_taintObjectReference document, but it still feels a bit far-fetched.
What makes me really confused is that the word taint seems to have a certain negative emotion (in computer science, the term taint is indeed more used in such scenarios), but in the React docs it feels It's less of a negative emotion and more of a neutral meaning.

@loveloki
Copy link

loveloki commented Oct 7, 2023

The word taint reminds me of dirty.

Dirty is used to set a tag, which marks the state needs update, so it can be updated in future updates, and enables unnecessary updates to be skipped.

So is taint a tag similar to dirty?

It seems to be used to mark the object with special behavior, such as in the taintUniqueValue api, it marks objects which should not be sent to the client?

@awxiaoxian2020
Copy link
Contributor

The point is that why does React use taint rather than label or mark and so on?

@lunaleaps
Copy link
Contributor

taint offers more insight into why we're tracking certain object/values due to the CS concepts linked. I think to address the question of translation, you can explain its usage as "marking" as you mention. I don't believe the subtle difference between taint and label is something that needs to be emphasized.

@Yucohny Yucohny closed this as completed Oct 18, 2023
@Huxpro
Copy link
Member

Huxpro commented Oct 25, 2023

The point is that why does React use taint rather than label or mark and so on?

It seems like "Taint checking" already has its own Chinese terminologies for us to use according to wiki: https://zh.wikipedia.org/wiki/%E6%B1%A1%E7%82%B9%E6%A3%80%E9%AA%8C

@Huxpro
Copy link
Member

Huxpro commented Oct 25, 2023

What makes me really confused is that the word taint seems to have a certain negative emotion (in computer science, the term taint is indeed more used in such scenarios), but in the React docs it feels It's less of a negative emotion and more of a neutral meaning.

@Yucohny in fact, it IS used for marking something negative (potentially hurting security) and that is the motivation for introducing these APIs

@Huxpro
Copy link
Member

Huxpro commented Oct 25, 2023

taint offers more insight into why we're tracking certain object/values due to the CS concepts linked. I think to address the question of translation, you can explain its usage as "marking" as you mention. I don't believe the subtle difference between taint and label is something that needs to be emphasized.

Hi @lunaleaps, it's been a while ;)

According to the docs and tweets from Seb's and Matt's (e.g. https://x.com/mattcarrollcode/status/1716599758025093546?s=20), the taint API was introduced for security and privacy reasons, notably accessing data in undesirable context. The uses of the term "taint" in React, as well as Computer Science in general (e.g. "taint checking"), are both connotated with its very literal meaning in English: "a trace of bad or undesirable quality or substance", not to mention that it already has a canonical translation in the Chinese programming community: https://zh.wikipedia.org/wiki/%E6%B1%A1%E7%82%B9%E6%A3%80%E9%AA%8C

So I strongly suggest that we should emphasize the intended difference and separate it with much more neutral and generalized words like "mark" or "label".

@lunaleaps
Copy link
Contributor

lunaleaps commented Oct 25, 2023

Sure, that sounds fine to me. I think this is the call of the translator at this point. I do stand by using the terms "label" or "mark" to conceptually explain what taint-checking means here. But for the naming of the actual feature, a more distinguished term makes sense to me!

Also hi @Huxpro!!

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

6 participants