3 ms·
> How many different levels of interpretation and compilation does V8 do? This part is key to the OPs objection. They’re saying that V8 is a very capable optim
by afavour 2y ago
> How many different levels of interpretation and compilation does V8 do?
This part is key to the OPs objection. They’re saying that V8 is a very capable optimizer (which it is), so why can’t it optimize the things React Compiler optimizes? It’s a fair question.
> compilation steps don't cause cognitive load if they work
Personally I disagree. Any source code transformation adds cognitive load because my original source code now doesn’t match the source in the browser. Source maps are the traditional answer to that but if React is rewriting logic (like getting rid of arrays) you’re not going to be able to maintain a 1:1 source map.
- a_wild_dandan 2y ago> They’re saying that V8 is a very capable optimizer (which it is), so why can’t it optimize the things React Compiler optimizes? Because capable != exhaustive? All compiled languages can benefit from further optimizations. I genuinely don't understand the issue here. Help!
- andybak 2y agoI think OP is questioning whether these are optimizations or whether they are just redundant. I don't know the answer - I don't use React personally.