4 ms·
SECRET DOM DO Not USE OR YOU WILL BE FIRED
- alex95 11y agowhy is this top of HN?
- kr0 11y agoWhat is the point of making a private reference to (what I assume) is a public ReactDOM reference?
- ioquatix 11y agoDo not ask these questions you will be fired.
- buremba 11y agoDo not make fun of that statement or you will be fired.
- debacle 11y agoIt's a shunt so that people working with the current version of React don't have to know that ReactDOM exists until the refactor is complete. It's a good, simple refactoring strategy when you're trying to responsibly change an API.
- nxzero 11y agoAnyone able to offer an explanation of what this means?
- deleted 11y ago[deleted]
- miralabs 11y agoexplanation here https://www.reddit.com/r/ProgrammerHumor/comments/3nhk5e/secret_dom_do_not_use_or_you_will_be_fired/ https://www.reddit.com/r/ProgrammerHumor/comments/3nhk5e/sec...?
- mrdrozdov 11y agoFunny variable name for being part of Facebook's official React repo.
- Artemis2 11y agoExplanation on Reddit: https://www.reddit.com/r/javascript/comments/3m6wyu/found_this_line_in_the_react_codebase_made_me/cvcyo4a https://www.reddit.com/r/javascript/comments/3m6wyu/found_th...
- nothrabannosir 11y agoQuestion to HN: I'm trying to find the commit that originally added this line. How do you do this elegantly? Git blame: https://github.com/facebook/react/blame/80bff5397bf854750dbe7c286f61654ea58938c5/src/umd/ReactUMDEntry.js https://github.com/facebook/react/blame/80bff5397bf854750dbe... The last commit for this line: https://github.com/facebook/react/commit/d17091ddebf317173eb30e3ab4a8e28e124c8f50 https://github.com/facebook/react/commit/d17091ddebf317173eb... It says: src/React.js → src/umd/ReactUMDEntry.js and essentially, the line was moved two spots down. Now I want to see the git blame before this change. Here is where it gets messy... Best I can think of is go to the parent commit: https://github.com/facebook/react/commit/d8ee071c92994879fa82ba4d2775b4f38fb78f1d https://github.com/facebook/react/commit/d8ee071c92994879fa8... Then look for the original file, src/React.js. So I go to "browse files at this revision", browse to the src/ dir, click React.js, then blame again: https://github.com/facebook/react/blame/d8ee071c92994879fa82ba4d2775b4f38fb78f1d/src/React.js https://github.com/facebook/react/blame/d8ee071c92994879fa82... Alright, we're there. Is there an easier way? This feels very convoluted and hacky...
- tokenizerrr 11y agogit bisect with a grep?
- tokenizerrr 11y agoJust did this to make sure. My steps for the interested: Start with a file named `check` with the contents: grep "__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED" src/React.js && exit 1 exit 0 The commit is good if the line isn't there, the commit is bad if the line is there. Then find the first commit in the entire repository (it's 75897c2dcd1dd3a6ca46284dd37e13d22b4b16b4): git rev-list --max-parents=0 HEAD Then run: git bisect start HEAD 75897c2dcd1dd3a6ca46284dd37e13d22b4b16b4 git bisect run ./check And a few seconds later git will tell us that it was commit https://github.com/facebook/react/commit/b2ca3349c27b57b1e9462944cbe4aaaf76783d2b https://github.com/facebook/react/commit/b2ca3349c27b57b1e94...: b2ca3349c27b57b1e9462944cbe4aaaf76783d2b] Actually build react-dom file with the build running ./check React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOM; b2ca3349c27b57b1e9462944cbe4aaaf76783d2b is the first bad commit commit b2ca3349c27b57b1e9462944cbe4aaaf76783d2b Author: Paul O’Shannessy <paul@oshannessy.com> Date: Tue Sep 8 10:13:24 2015 -0700 Actually build react-dom file with the build :100644 100644 8b66781299e8980740f8f9a13ad31a0cb30fd684 c20a6aa20e3d3d26c63cf3ac7ee087c93dd8a7d6 M .eslintignore :100644 100644 e99175b6a10b11857f4c6242341731af6138c3ca 3f4a02e3e372af1b04b5bb2f1ee2b4384ef22295 M Gruntfile.js :040000 040000 7e99fe9ef7324209890325e2fd9a4a430a706814 1aeab86f880dbf4366709930d7134921bee9401e M grunt :040000 040000 357233750d2d661818a5ba70ab21fe8049ab9583 154a4f6f867aa8eddc8637aadae8bd3c38e794eb M src :040000 040000 4216cc98bca3b6d6276bdfbbb29a1ca14bed1972 1e90bf75ef899c6a0ed0484c5138f4d62f32b8d4 M vendor bisect run success `git log -S` might be better for this specific case, but `git bisect` is far more powerful so it's very useful to know how it works.
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]
- LukeB_UK 11y agoOff topic, but this is the second submission I've seen where the title was all in caps except "Not" and having just done a test it seems that HN converts "NOT" to "Not". I'm curious as to why... Other submission was this one: https://news.ycombinator.com/item?id=11411368 https://news.ycombinator.com/item?id=11411368
- _lce0 11y agoInteresting. This entry ... _NOT_ _NOT NOT_ ANOT NOTA ANOTA ... was changed into ... _NOT_ _Not NOT_ ANot NOTA ANOTA is the re `/\b\w*NOT\b/`? [0] https://news.ycombinator.com/item?id=11448402 https://news.ycombinator.com/item?id=11448402
- reustle 11y agoI think a lot of people like to post NOT in capitals, so they had to implement this. Things NOT to do if you are a developer. How NOT to apply for a job.
- dang 11y agoNo doubt one of pg's low-tech tricks from way back.