jiebi/CodeConvo huggingface dataset:
Change:
<!-- Note: if the issue is about documentation or the website, please file it at: --Do you want to request a feature or report a bug? Bug. Behavior regression. What is the current behavior? Package throws when being required in Node. If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle () or CodeSandbox () example below: What is the expected behavior? should not throw in "pure" node (without providing fake document on global). Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? happens on 16.8.0 previous versions work.
We also got this issue after upgrading to 16.8.0
Found the fix and putting together a PR now edit: now on the case

Discussion:
); } <del> // stub element used by act() when flushing effects let actContainerElement = document.createElement('div'); </del> <ins> // a stub element, lazily initialized, used by act() when flushing effects let actContainerElement = null; </ins> /** * Utilities for making it easy to test React components.

SimulateNative: {}, act(callback: () => void): Thenable { <ins> if (actContainerElement === null) { // warn if we can't actually create the stub element if (__DEV__) { warningWithoutStack( typeof document !== 'undefined' && document !== null && typeof document.createElement === 'function', 'It looks like you called TestUtils.act(...) in a non-browser environment. ' + "If you're using TestRenderer for your tests, you should call " + 'TestRenderer.act(...) instead of TestUtils.act(...).', ); } // then make it actContainerElement = document.createElement('div'); } const result = ReactDOM.unstable_batchedUpdates(callback); </ins> // note: keep these warning messages in sync with // createReactNoop.js and ReactTestRenderer.js <del> const result = ReactDOM.unstable_batchedUpdates(callback); </del> if (__DEV__) { if (result !== undefined) { let addendum;

}); describe('act', () => { <del> it('works', () => { </del> <ins> it('can use .act() to batch updates and effects', () => { </ins> function App(props) { React.useEffect(() => { props.callback();

expect(called).toBe(true); }); <ins> it('warns and throws if you use TestUtils.act instead of TestRenderer.act in node', () => { // we warn when you try to load 2 renderers in the same 'scope' // so as suggested, we call resetModules() to carry on with the test jest.resetModules(); const {act} = require('react-dom/test-utils'); expect(() => { expect(() => act(() => {})).toThrow('document is not defined'); }).toWarnDev( [ 'It looks like you called TestUtils.act(...) in a non-browser environment', ], {withoutStack: 1}, ); }); </ins> }); });
Change:
Feature requested GitHub has just released the Security Policy feature, by writing the file a new tab with security informations should appear in the repository. You can check the It will really improve people trusting in open source security standards
Added in the above commit

Discussion:
<ins> # Reporting Security Issues If you believe you have found a security vulnerability in React, we encourage you to let us know right away. We will investigate all legitimate reports and do our best to quickly fix the problem. Please refer to the following page for our responsible disclosure policy, reward guidelines, and those things that should not be reported: https://www.facebook.com/whitehat </ins>
Change:
<!-- Note: if the issue is about documentation or the website, please file it at: --Do you want to request a feature or report a bug? bug What is the current behavior? In shallow renderer, The returned callback from is not the same one between two rerendering even though the dependencies are the same. But will work as expected. For example, the following test won't work: If returned the same callback between two rendering (I think) the assertion should pass. but the same (almost) logic will work with , in the shallow renderer test suite (See ). If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle () or CodeSandbox () example below: I created a branch in and you can run the failed shallow renderer test in . What is the expected behavior? should return the memoized callback when the dependencies unchanged even in shallow renderer. I tried to look into this and I found out that in shallow renderer just returns the original callback argument (See ) but will compare the dependencies between rendering. I'm not sure if it's intended (So it's expected that will not memoize callback in shallow renderer). If it's triaged as a bug I'm glad to send a pr for this :) Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? react
yup, this looks like a miss on our part. Would you like to send a PR? :)
thanks for reply :-) I'd try to make a PR in a few days.
I don't think it's a miss on our part. It was an intentional decision since it's mostly an optimization, and unclear why it would be important for shallow rendering to do that. Can you explain why it matters?
It’s important for shallow rendering to match production as much as possible, since shallow rendering is a testing tool.
Agree to Even it's optimization I think there might be still case that we want to make sure we've really do the optimization (though not guaranteed in production) in code.
Is this still open to be worked on?
For this code and statement: Isn't it creating two instances, and then rendering each of them independently? AFAIK this is not two renderings of the same, but instead two different elements. If I have a component rendered in different places those are independent of each other. They keep the same callback between re-renders, but not across all the instances.
The shallow renderer has moved to If this is still relevant, please feel free to file this issue there. Thanks!

Discussion:
Let's call the callback from the `CommentForm` when the user submits the form: <del> ```javascript{6} </del> <ins> ```javascript{10} </ins> // tutorial18.js var CommentForm = React.createClass({ handleSubmit: function(e) {
Change:
Currently the simple event plugin defines a priority for the event but not all events go through the SimpleEventPlugin. That's just one of several EventPlugins. The remaining ones now get the wrong priority associated with them. E.g. I think all of these should be discrete: change compositionend compositionstart compositionupdate selectionchange textinput These show up too but I don't know if they're even bridged. dblclick pointerenter pointerleave Flare defines its own priorities.

Discussion:
// eslint-disable-next-line no-fallthrough case 'mouseenter': case 'mouseleave': <ins> case 'pointerenter': case 'pointerleave': </ins> return ContinuousEventPriority; case 'message': { // We might be in the Scheduler callback.
Change:
Hi, long time user, first time issuer. I think I found a bug with the Profiler component. When I click on the button at the top nothing happens and there appears to be no new files in my Downloads folder. I think it might be silently failing and that's why I am not getting any response. Has anyone else ran into this issue? Another thing I would like to mention is that I haven't looked through all of the documentation material about the new Profiler. I only read , so if this issue is addressed elsewhere I apologize and also request the source to that solution. Thank you for your time! Versions: *
It seems that this is happening because of the call in the util function. I'll investigate this further.
I fixed the issue. I'll open a PR later today :)

Discussion:
const {profilerStore} = store; const inputRef = useRef<HTMLInputElement | null>(null); <ins> const downloadRef = useRef<HTMLAnchorElement | null>(null); </ins> const {dispatch: modalDialogDispatch} = useContext(ModalDialogContext);

return; } <del> if (profilingData !== null) { </del> <ins> if (profilingData !== null && downloadRef.current !== null) { </ins> const profilingDataExport = prepareProfilingDataExport(profilingData); const date = new Date(); const dateString = date

}) .replace(/:/g, '-'); downloadFile( <ins> downloadRef.current, </ins> `profiling-data.${dateString}.${timeString}.json`, JSON.stringify(profilingDataExport, null, 2), );

onChange={handleFiles} tabIndex={-1} /> <ins> <a ref={downloadRef} className={styles.Input} /> </ins> <Button disabled={isProfiling} onClick={uploadData}

// Without this, we would see a "Download failed: network error" failure. let downloadUrl = null; <del> export function downloadFile(filename: string, text: string): void { </del> <ins> export function downloadFile( element: HTMLAnchorElement, filename: string, text: string, ): void { </ins> const blob = new Blob([text], {type: 'text/plain;charset=utf-8'}); if (downloadUrl !== null) {

downloadUrl = URL.createObjectURL(blob); <del> const element = document.createElement('a'); </del> element.setAttribute('href', downloadUrl); element.setAttribute('download', filename); <del> element.style.display = 'none'; ((document.body: any): HTMLBodyElement).appendChild(element); </del> element.click(); <del> ((document.body: any): HTMLBodyElement).removeChild(element); </del> } export function truncateText(text: string, maxLength: number): string {
Change:
Using 0.4.0 is giving me this error on a large number of files: I narrowed down that file to the simplest thing that causes it: Originally posted by in
Fixed in 0.4.1

Discussion:
// The signature call is split in two parts. One part is called inside the function. // This is used to signal when first render happens. <ins> if (path.node.body.type !== 'BlockStatement') { path.node.body = t.blockStatement([ t.returnStatement(path.node.body), ]); } </ins> path .get('body') .unshiftContainer(

`), ).toMatchSnapshot(); }); <ins> it('can handle implicit arrow returns', () => { expect( transform(` export default () => useContext(X); export const Foo = () => useContext(X); module.exports = () => useContext(X); const Bar = () => useContext(X); const Baz = memo(() => useContext(X)); const Qux = () => (0, useContext(X)); `), ).toMatchSnapshot(); }); </ins> });

// Jest Snapshot v1, https://goo.gl/fbAQLP <ins> exports[`ReactFreshBabelPlugin can handle implicit arrow returns 1`] = ` var _s = $RefreshSig$(), _s2 = $RefreshSig$(), _s3 = $RefreshSig$(), _s4 = $RefreshSig$(), _s5 = $RefreshSig$(), _s6 = $RefreshSig$(); export default _s(() => { _s(); return useContext(X); }, "useContext{}"); export const Foo = () => { _s2(); return useContext(X); }; _s2(Foo, "useContext{}"); _c = Foo; module.exports = _s3(() => { _s3(); return useContext(X); }, "useContext{}"); const Bar = () => { _s4(); return useContext(X); }; _s4(Bar, "useContext{}"); _c2 = Bar; const Baz = _c4 = memo(_c3 = _s5(() => { _s5(); return useContext(X); }, "useContext{}")); const Qux = () => { _s6(); return 0, useContext(X); }; _s6(Qux, "useContext{}"); _c5 = Qux; var _c, _c2, _c3, _c4, _c5; $RefreshReg$(_c, "Foo"); $RefreshReg$(_c2, "Bar"); $RefreshReg$(_c3, "Baz$memo"); $RefreshReg$(_c4, "Baz"); $RefreshReg$(_c5, "Qux"); `; </ins> exports[`ReactFreshBabelPlugin does not consider require-like methods to be HOCs 1`] = ` const A = require('A');
Change:
<!-- Note: if the issue is about documentation or the website, please file it at: --Do you want to request a feature or report a bug? Bug What is the current behavior? Throw exception, don't run tests. SyntaxError: missing ) after argument list If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle () or CodeSandbox () example below: one of the commands: yarn debug-test yarn debug-test-persistent yarn debug-test-build-devtools chrome://inspect and press “Inspect”. What is the expected behavior? Possibility debug tests. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? React 16.2.0 and higher. Chrome 77.0.3865.120 Windows 10. Older version React hasn't this feature.
fixed in

Discussion:
"lint": "node ./scripts/tasks/eslint.js", "lint-build": "node ./scripts/rollup/validate/index.js", "postinstall": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json", <ins> "debug-test": "cross-env NODE_ENV=development node --inspect-brk node_modules/.bin/jest --config ./scripts/jest/config.source.js --runInBand", </ins> "test": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source.js", "test-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.source.js", "test-prod-build": "yarn test-build-prod",
Change:
<!-- Note: if the issue is about documentation or the website, please file it at: --Do you want to request a feature or report a bug? Bug What is the current behavior? Throw exception, don't run tests. SyntaxError: missing ) after argument list If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle () or CodeSandbox () example below: one of the commands: yarn debug-test yarn debug-test-persistent yarn debug-test-build-devtools chrome://inspect and press “Inspect”. What is the expected behavior? Possibility debug tests. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? React 16.2.0 and higher. Chrome 77.0.3865.120 Windows 10. Older version React hasn't this feature.
fixed in

Discussion:
"lint-build": "node ./scripts/rollup/validate/index.js", "extract-errors": "yarn build --type=dev --extract-errors", "postinstall": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json && node ./scripts/flow/createFlowConfigs.js && node ./scripts/yarn/downloadReactIsForPrettyFormat.js", <del> "debug-test": "cross-env NODE_ENV=development node --inspect-brk node_modules/.bin/jest --config ./scripts/jest/config.source.js --runInBand", </del> <ins> "debug-test": "cross-env NODE_ENV=development node --inspect-brk node_modules/jest/bin/jest.js --config ./scripts/jest/config.source.js --runInBand", </ins> "test": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source.js", "test-persistent": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source-persistent.js", <del> "debug-test-persistent": "cross-env NODE_ENV=development node --inspect-brk node_modules/.bin/jest --config ./scripts/jest/config.source-persistent.js --runInBand", </del> <ins> "debug-test-persistent": "cross-env NODE_ENV=development node --inspect-brk node_modules/jest/bin/jest.js --config ./scripts/jest/config.source-persistent.js --runInBand", </ins> "test-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.source.js", "test-prod-build": "yarn test-build-prod", "test-build": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.build.js", "test-build-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.build.js", "test-build-devtools": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.build-devtools.js", <del> "debug-test-build-devtools": "cross-env NODE_ENV=development node --inspect-brk node_modules/.bin/jest --config ./scripts/jest/config.build-devtools.js", </del> <ins> "debug-test-build-devtools": "cross-env NODE_ENV=development node --inspect-brk node_modules/jest/bin/jest.js --config ./scripts/jest/config.build-devtools.js", </ins> "test-dom-fixture": "cd fixtures/dom && yarn && yarn prestart && yarn test", "flow": "node ./scripts/tasks/flow.js", "flow-ci": "node ./scripts/tasks/flow-ci.js",
Change:
Do you want to request a feature or report a bug? Feature Right now babel plugin emits globals: It would be nice to have them configurable. That would allow to use in environments like SystemJS and have simpler implementation: If you don't mind I could create PR with changes to react-refresh/babel next week. environment:
Happy to take a PR.

Discussion:
} const {types: t} = babel; <ins> const refreshReg = t.identifier(opts.refreshReg || '$RefreshReg$'); const refreshSig = t.identifier(opts.refreshSig || '$RefreshSig$'); </ins> const registrationsByProgramPath = new Map(); function createRegistration(programPath, persistentID) {

const sigCallID = path.scope.generateUidIdentifier('_s'); path.scope.parent.push({ id: sigCallID, <del> init: t.callExpression(t.identifier('$RefreshSig$'), []), </del> <ins> init: t.callExpression(refreshSig, []), </ins> }); // The signature call is split in two parts. One part is called inside the function.

path.pushContainer( 'body', t.expressionStatement( <del> t.callExpression(t.identifier('$RefreshReg$'), [ </del> <ins> t.callExpression(refreshReg, [ </ins> handle, t.stringLiteral(persistentID), ]),

skipEnvCheck: true, // To simplify debugging tests: emitFullSignatures: true, <ins> ...options.freshOptions, </ins> }, ], ...(options.plugins || []),

`), ).toMatchSnapshot(); }); <ins> it('uses custom identifiers for $RefreshReg$ and $RefreshSig$', () => { expect( transform( `export default function Bar () { useContext(X) return <Foo /> };`, { freshOptions: { refreshReg: 'import.meta.refreshReg', refreshSig: 'import.meta.refreshSig', }, }, ), ).toMatchSnapshot(); }); </ins> });

$RefreshReg$(_c2, "Bar"); `; <ins> exports[`ReactFreshBabelPlugin uses custom identifiers for $RefreshReg$ and $RefreshSig$ 1`] = ` var _s = import.meta.refreshSig(); export default function Bar() { _s(); useContext(X); return <Foo />; } _s(Bar, "useContext{}"); _c = Bar; ; var _c; import.meta.refreshReg(_c, "Bar"); `; </ins> exports[`ReactFreshBabelPlugin uses original function declaration if it get reassigned 1`] = ` function Hello() { return <h1>Hi</h1>;
Change:
Steps to reproduce: 1) Disable all add-ons in Firefox 2) Open an URL that points to a XML file 3) AS EXPECTED: A pretty-printed XML is shown 4) Enable the React DevTools Add-on 5) Open the XML file again 6) FAIL: Only the content inside the XML tags are shown Using Firefox Developer Edition 72.0b6 on macOS 10.15.2
I am able to reproduce the behavior described using Firefox Developer Edition (72.0b1) but regular Firefox (71.0) does not exhibit the buggy behavior. I don't believe this is something that the React DevTools add-on should be able to cause, since syntax highlighting is a built-in browser feature. There is no error in the console (or the add-on if I inspect it). Just enabling the extension is enough to immediately "break" pretty-print for XML files, e.g. I believe that this may be a Firefox Developer Edition bug. It's probably not something that an extension should be able to cause. I'll open a bug on their end: cc
Thanks! I see the same with and the LastPass add-on
It's unclear what Firefox is going to do on their end about this, but it seems like we can make this better by checking in the content script if is "text/xml" before injecting any tags.
This will be fixed in the next release.
FYI this issue should be fixed in v4.4 (released today)

Discussion:
injectCode(rendererCode); } <del> // Inject a `__REACT_DEVTOOLS_GLOBAL_HOOK__` global so that React can detect that the // devtools are installed (and skip its suggestion to install the devtools). injectCode( ';(' + installHook.toString() + '(window))' + saveNativeValues + detectReact, ); </del> <ins> // Inject a __REACT_DEVTOOLS_GLOBAL_HOOK__ global for React to interact with. // Only do this for HTML documents though, to avoid e.g. breaking syntax highlighting for XML docs. if (document.contentType === 'text/html') { injectCode( ';(' + installHook.toString() + '(window))' + saveNativeValues + detectReact, ); } </ins>
Change:
React version: 16.8.0 an app that toggles between rendering a text input and a date input. the of each to some arbitrary input, valid for either one toggling occurs that the value of the date input is not preserved upon toggle The date input's value is not preserved The date input's value should be preserved We discovered a simple workaround--add a unique property to each input, and the value will be respected.
It seems to be the default correct behaviour. You can read more about how works here. The reason it seems to work by adding the key prop is because the component gets re-rendered from scratch and therefore the "works". I think what you want to achieve is pretty date display when not in edit mode. Maybe something like this. Demo Prototype code
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

Discussion:
var args = [ "bin/jsx", "--cache-dir", ".module-cache", <ins> "--relativize", </ins> config.sourceDir, config.outputDir ];

}, "dependencies": { "base62": "~0.1.1", <del> "commoner": "~0.6.8", </del> <ins> "commoner": "~0.7.0", </ins> "esprima": "git://github.com/facebook/esprima#fb-harmony", <del> "recast": "~0.3.3", </del> <ins> "recast": "~0.4.5", </ins> "source-map": "~0.1.22" }, "devDependencies": {
Change:
I don't see the selection at all. My version is 4.5.0. I think this regressed. <img width="266" alt="Screenshot 2020-03-11 at 23 40 37" src="https://user-"
This is interesting. The extension seems to have a shorter toolbar height than I would expect, which is clipping the current index. Here's what the test harness/shell looks like: <img width="437" alt="Screen Shot 2020-03-11 at 6 11 50 PM" src="https://user-"
Looks like something is going wrong with the relative height of the list items in the extension. Works fine in Chrome but it's overflowing in the extension.
Ah, it looks like the style isn't cascading correctly in the extension.
I think this probably regressed with , because the extension uses portals to mount (so they don't get mounted underneath of the class).
Yay! Fixed. <img width="369" alt="Screen Shot 2020-03-11 at 6 35 52 PM" src="https://user-"

Discussion:
font-family: var(--font-family-sans); } <ins> .Components, .Components * { box-sizing: border-box; -webkit-font-smoothing: var(--font-smoothing); } </ins> .TreeWrapper { flex: 0 0 var(--horizontal-resize-percentage); overflow: auto;

.DevTools, .DevTools * { box-sizing: border-box; -webkit-font-smoothing: var(--font-smoothing); }

color: var(--color-text); } <ins> .Profiler, .Profiler * { box-sizing: border-box; -webkit-font-smoothing: var(--font-smoothing); } </ins> .LeftColumn { display: flex; flex-direction: column;