academic and careers Touch By plato.stanford.edu Published On :: Wed, 06 May 2020 18:27:49 -0800 [Revised entry by Matthew Fulkerson on May 6, 2020. Changes to: Main text, Bibliography] The sense of touch is one of the central forms of perceptual experience, though it has often been overshadowed by vision in both philosophy and psychology. Thought to be one of the first senses to develop, touch occurs across the whole body using a variety of receptors in the skin. It often combines these signals with feedback from the muscles and tendons as we actively move and explore the world, and with proprioceptive information about the position of our tactual surfaces. These unique features of touch raise many interesting philosophical issues. In particular, it is a central topic of discussion in debates about the multisensory nature of perception, the relation between perception and action, and the connection between touch and bodily awareness.... Full Article
academic and careers A Priori Justification and Knowledge By plato.stanford.edu Published On :: Wed, 06 May 2020 19:00:08 -0800 [Revised entry by Bruce Russell on May 6, 2020. Changes to: Main text, Bibliography] A priori justification is a type of epistemic justification that is, in some sense, independent of experience. Gettier examples have led most philosophers to think that having a justified true belief is not sufficient for knowledge (see Section 4.4, below, and the examples there), but many still believe that it is necessary. In this entry, it will be assumed, for the most part, that even though justification is not sufficient for knowledge it is necessary and that... Full Article
academic and careers Intensional Transitive Verbs By plato.stanford.edu Published On :: Thu, 07 May 2020 17:53:42 -0800 [Revised entry by Graeme Forbes on May 7, 2020. Changes to: Main text, Bibliography] A verb is transitive iff it usually occurs with a direct object, and in such occurrences it is said to occur transitively. Thus 'ate' occurs transitively in 'I ate the meat and left the vegetables', but not in 'I ate then left' (perhaps it is not the same verb 'left' in these two examples, but it seems to be the same 'ate'). A verb is intensional if the verb phrase (VP) it forms with its complement is anomalous in at least one of... Full Article
academic and careers Philosophy of Immunology By plato.stanford.edu Published On :: Thu, 07 May 2020 18:12:03 -0800 [Revised entry by Bartlomiej Swiatczak and Alfred I. Tauber on May 7, 2020. Changes to: Main text, Bibliography] Philosophy of immunology is a subfield of philosophy of biology dealing with ontological and epistemological issues related to the studies of the immune system. While speculative investigations and abstract analyses have always been part of immune theorizing, until recently philosophers have largely ignored immunology. Yet the implications for understanding the philosophical basis of organismal functions framed by immunity offer new perspectives on fundamental questions of biology and medicine. Developed in the context of history... Full Article
academic and careers al-Ghazali By plato.stanford.edu Published On :: Fri, 08 May 2020 17:20:57 -0800 [Revised entry by Frank Griffel on May 8, 2020. Changes to: Main text, Bibliography] Al-Ghazali (c.1056 - 1111) was one of the most prominent and influential philosophers, theologians, jurists, and mystics of Sunni Islam. He was active at a time when Sunni theology had just passed through its consolidation and entered a period of intense challenges from Shiite Isma'ilite theology and the Arabic tradition of Aristotelian philosophy (falsafa). Al-Ghazali understood the importance of falsafa and developed a complex response that rejected and... Full Article
academic and careers So Many, So Few. By languagehat.com Published On :: Sun, 19 Apr 2020 19:36:11 +0000 Back in 2017, we discussed Michael Gavin’s attempt to answer the questions: “Why is it that humans speak so many languages? And why are they so unevenly spread across the planet?” At that time he and his coworkers were investigating language diversity patterns in Australia; last year there was an update by Gavin and Marco […] Full Article Uncategorized
academic and careers Six Degrees of Deuteronomy. By languagehat.com Published On :: Mon, 20 Apr 2020 14:21:37 +0000 A.Z. Foreman (to quote his blog profile) “is a translator and poet who has been obsessed with languages and literature since childhood”; you should check out his translation blog, with lots of poems accompanied by his translations (and sometimes audio files of him reading the original) in languages from Arabic to Yiddish. But right now […] Full Article Uncategorized
academic and careers The Sting of Fleas on Him! By languagehat.com Published On :: Tue, 21 Apr 2020 21:18:32 +0000 Luí fada gan faoilte air! Seacht n-aicíd déag agus fiche na hÁirce air! Calcadh fíodáin agus stopainn air! Camroillig agus goile treasna air! An ceas naon air! An Bhuí Chonaill air! Pláigh Lasaras air! Eagnach Job air! Calar na muc air! Snadhm ar bundún air! Galra trua, bios brún, péarsalaí, sioráin, maotháin agus magag air! […] Full Article Uncategorized
academic and careers Tim Robinson, RIP. By languagehat.com Published On :: Wed, 22 Apr 2020 18:49:43 +0000 Trevor Joyce alerted me to the passing of author and cartographer Tim Robinson a couple of weeks ago, but what with one thing and another I haven’t gotten around to posting about it; now per incuriam has reminded me and linked to a fine tribute by Fintan O’Toole: The word “geography” means in its origins […] Full Article Uncategorized
academic and careers Novgorod. By languagehat.com Published On :: Thu, 23 Apr 2020 21:00:47 +0000 Poemas del río Wang has a doozy of a post about the fabled city of Novgorod and its long and contentious history; it’s probably superfluous to say it has many splendid illustrations, since that’s the spécialité de la maison. The main focus of the post is icons, and there are fascinating details like this: The […] Full Article Uncategorized
academic and careers Refugee. By languagehat.com Published On :: Fri, 24 Apr 2020 14:50:39 +0000 From Michael Marrus, The Unwanted: European Refugees in the Twentieth Century, pp. 8-9: One sign that refugees as a category did not impinge on the European consciousness is the absence of a general term to designate them until the nineteenth century, the starting point for this study. Before this time, “refugees” almost exclusively denoted the […] Full Article Uncategorized
academic and careers Pure D. By languagehat.com Published On :: Sat, 25 Apr 2020 18:34:48 +0000 I’m back to reading Norwood (see this post), and I just ran across a sentence that made me happier than it had any right to: “It’s pure d. meanness is what is it.” (I’m not sure whether “what is it” is an error for “what it is,” which sounds far more natural to me, or […] Full Article Uncategorized
academic and careers West Wind Keen. By languagehat.com Published On :: Sun, 26 Apr 2020 20:35:31 +0000 Back in 2018 the Paris Review published a piece by Anthony Madrid called Guy Davenport’s Translation of Mao that’s so irresistible I can barely resist quoting the whole thing. But I am strong, so I will just quote the start: In 1979, Guy Davenport’s second book of “stories” appeared: Da Vinci’s Bicycle. He was fifty-one. […] Full Article Uncategorized
academic and careers Language Barrier II. By languagehat.com Published On :: Mon, 27 Apr 2020 22:20:43 +0000 My wife and I are almost finished with Rachel Cusk’s Outline (our latest bedtime reading), and we’ve just gotten to the passage Stan Carey quoted recently at Sentence first (a woman is describing her feelings about being hired to teach English in Athens): She wasn’t quite sure how the language barrier was going to work: […] Full Article Uncategorized
academic and careers Bastable. By languagehat.com Published On :: Tue, 28 Apr 2020 22:07:16 +0000 I ran across a reference to a “bastable” that perplexed me; it turns out there’s a fuller form “bastable oven,” and the OED has an entry from 2019: 1. attributive. Especially in Ireland: designating an earthenware or (in later use) cast-iron pot with three short legs and a lid, used for baking over a fire; […] Full Article Uncategorized
academic and careers Bolze. By languagehat.com Published On :: Wed, 29 Apr 2020 17:40:57 +0000 Molly Harris writes for BBC Travel about an unusual language: The Sarine River skirts the edge of Basse-Ville (lower town), dividing both the canton of Fribourg and the city of Fribourg into two sectors: German-speaking and French-speaking. The city of around 40,000 people is clearly one of duality: street signs are all in two languages; […] Full Article Uncategorized
academic and careers Sologub’s Bad Dreams. By languagehat.com Published On :: Thu, 30 Apr 2020 19:04:49 +0000 As promised in my review of The Petty Demon, I’ve spent the last couple of weeks reading Sologub’s first novel, the 1895 Тяжёлые сны [Bad Dreams], and while it’s not nearly as good, I’m not sorry I read it — it illuminated the world of what Blok, and after him Mandelstam, called Russia’s глухие годы […] Full Article Uncategorized
academic and careers Famous People’s Bookshelves. By languagehat.com Published On :: Fri, 01 May 2020 21:52:04 +0000 Gal Beckerman has a NY Times piece on celebrity bookshelves (“With celebrities now frequently speaking on television in front of their home libraries, a voyeuristic pleasure presents itself”) that might not be worth a post except that 1) I myself certainly focus on those shelves when they show people talking from home, and 2) Cate […] Full Article Uncategorized
academic and careers At Home in the Russian Kasbah. By languagehat.com Published On :: Sat, 02 May 2020 18:15:58 +0000 I’m finally getting around to reading a book that a kind Hatter got me almost a decade ago (thanks, Andrei!), Stalin’s Children: Three Generations of Love, War, and Survival by Owen Matthews, and am enjoying it greatly; the first chapter has material of clear LH interest: I spoke Russian before I spoke English. Until I […] Full Article Uncategorized
academic and careers Hobo Jake and a Counterfactual Universe. By languagehat.com Published On :: Sun, 03 May 2020 22:14:35 +0000 Philip Jenkins’ Jesus Wars: How Four Patriarchs, Three Queens, and Two Emperors Decided What Christians Would Believe for the Next 1,500 Years looks like a really good book judging from the sample I had Amazon send me; I’ll probably wind up getting the whole thing. Here are a couple of piquant excerpts from the part […] Full Article Uncategorized
academic and careers How to Understand Aliens. By languagehat.com Published On :: Mon, 04 May 2020 15:16:39 +0000 Last night, having just watched a documentary on the Connecticut River flood of 1936, my wife and I discovered that our basement had flooded — apparently the sump pump had failed. So this morning we called the Barstows (it’s great to have contractors you can rely on in emergencies) and they sent a crew over […] Full Article Uncategorized
academic and careers Some Links. By languagehat.com Published On :: Tue, 05 May 2020 17:39:49 +0000 A few tidbits of interest: 1) Via Laudator Temporis Acti, W.S. Merwin describes a visit to Ezra Pound at St. Elizabeth’s: He told me he imagined I was serious, and that if I was I should learn languages, “so as not to be at the mercy of translators.” And then I should translate, myself. “If […] Full Article Uncategorized
academic and careers Misused Terms in Linguistics. By languagehat.com Published On :: Wed, 06 May 2020 21:56:36 +0000 Evelina Leivada, a psycholinguist at the Universitat Rovira i Virgili in Tarragona, has an article in Inference, Misused Terms in Linguistics, that begins: The evolutionary biologist Eörs Szathmáry observed that linguists “would rather share each other’s toothbrush than each other’s terminology.” This is far from an isolated view. Peter Hagoort, an eminent cognitive neuroscientist, voiced […] Full Article Uncategorized
academic and careers Bely’s Second Symphony. By languagehat.com Published On :: Thu, 07 May 2020 20:01:23 +0000 I’ve long been intrigued by Andrei Bely’s first published prose works, his set of four “symphonies,” and since everyone seems to agree that the first to be published, Симфония (2-я, драматическая) [Symphony: Second, Dramatic], is without question the best of them and perhaps the only one really worth spending time on, I bought a copy […] Full Article Uncategorized
academic and careers A Frustrating Article. By languagehat.com Published On :: Fri, 08 May 2020 21:27:38 +0000 Kelly Grovier at BBC Culture writes a piece that perfectly illustrates the pitfalls of the popular belief that earliest attestation is the same thing as word creation. Her thesis is that “it was often female writers who sculpted the fresh coinages that kept language rippling with poignancy and power.” She illustrates it by combing the […] Full Article Uncategorized
academic and careers Belsen 1945: Remembering the medical students who saved lives By www.bbc.co.uk Published On :: Wed, 15 Apr 2020 16:37:23 GMT Two weeks after liberation, 95 London medical students arrived at Belsen to help care for survivors. Full Article
academic and careers Coronavirus: How do you social distance in schools? By www.bbc.co.uk Published On :: Fri, 24 Apr 2020 23:00:54 GMT If pupils are allowed to return to school after the lockdown, how would they keep 2m apart? Full Article
academic and careers ‘Justice not charity’ - the blind marchers who made history By www.bbc.co.uk Published On :: Thu, 30 Apr 2020 11:40:33 GMT Remembering the maverick blind campaigners who walked to London a century ago to demand equality. Full Article
academic and careers Lockdown homeschooling: The parents who have forgotten what they learned at school By www.bbc.co.uk Published On :: Fri, 01 May 2020 00:04:01 GMT Parents have been turning to Google to help them teach the things they’ve forgotten. Full Article
academic and careers Coronavirus: Lockdown life 'a challenge' for vulnerable children By www.bbc.co.uk Published On :: Mon, 04 May 2020 19:59:02 GMT Charities warn some children who are missing out on additional support at school are falling into crisis. Full Article
academic and careers Coronavirus: ‘The nursery I run may not survive’ By www.bbc.co.uk Published On :: Mon, 04 May 2020 23:01:09 GMT Thousands of nurseries and childminders may shut permanently due to the pandemic, research suggests. Full Article
academic and careers Coronavirus: Online students face full tuition fees By www.bbc.co.uk Published On :: Mon, 04 May 2020 12:24:13 GMT If universities are teaching online next term students will still have to pay full tuition fees. Full Article
academic and careers Coronavirus: Teachers warn of early school return 'spike' By www.bbc.co.uk Published On :: Tue, 05 May 2020 13:39:06 GMT Teaching unions across UK and Ireland say test and trace measures must be fully operational before reopening. Full Article
academic and careers Coronavirus schools return: Can you really keep children 2m apart? By www.bbc.co.uk Published On :: Wed, 06 May 2020 00:14:17 GMT What's it like in a school that has re-opened? Denmark and Germany show how it might look. Full Article
academic and careers Coronavirus: Concerns for wellbeing of babies born in lockdown By www.bbc.co.uk Published On :: Thu, 07 May 2020 01:16:50 GMT New mothers are missing out on support for their babies amidst lockdown restrictions. Full Article
academic and careers Coronavirus: 'Humiliation' as school meal vouchers fail at till By www.bbc.co.uk Published On :: Thu, 07 May 2020 01:15:34 GMT "We had to leave all our shopping," a mother tells BBC News. Full Article
academic and careers Coronavirus: Schools in Wales not reopening on 1 June By www.bbc.co.uk Published On :: Thu, 07 May 2020 16:19:46 GMT The situation for schools in Wales will not change on 1 June, the education minister says. Full Article
academic and careers Students 'being ignored' over fee-refund claim By www.bbc.co.uk Published On :: Thu, 07 May 2020 18:39:25 GMT MPs consider a petition signed by 330,000, asking for students to get money back on fees this year. Full Article
academic and careers Coronavirus: Key safeguards needed for schools to reopen - unions By www.bbc.co.uk Published On :: Sat, 09 May 2020 08:32:57 GMT Education unions say they want scientific evidence it is safe for teachers and pupils to return. Full Article
academic and careers React v16.9.0 and the Roadmap Update By reactjs.org Published On :: Thu, 08 Aug 2019 00:00:00 GMT Today we are releasing React 16.9. It contains several new features, bugfixes, and new deprecation warnings to help prepare for a future major release. New Deprecations Renaming Unsafe Lifecycle Methods Over a year ago, we announced that unsafe lifecycle methods are getting renamed: componentWillMount → UNSAFE_componentWillMount componentWillReceiveProps → UNSAFE_componentWillReceiveProps componentWillUpdate → UNSAFE_componentWillUpdate React 16.9 does not contain breaking changes, and the old names continue to work in this release. But you will now see a warning when using any of the old names: As the warning suggests, there are usually better approaches for each of the unsafe methods. However, maybe you don’t have the time to migrate or test these components. In that case, we recommend running a “codemod” script that renames them automatically: cd your_project npx react-codemod rename-unsafe-lifecycles (Note that it says npx, not npm. npx is a utility that comes with Node 6+ by default.) Running this codemod will replace the old names like componentWillMount with the new names like UNSAFE_componentWillMount: The new names like UNSAFE_componentWillMount will keep working in both React 16.9 and in React 17.x. However, the new UNSAFE_ prefix will help components with problematic patterns stand out during the code review and debugging sessions. (If you’d like, you can further discourage their use inside your app with the opt-in Strict Mode.) Note Learn more about our versioning policy and commitment to stability. Deprecating javascript: URLs URLs starting with javascript: are a dangerous attack surface because it’s easy to accidentally include unsanitized output in a tag like <a href> and create a security hole: const userProfile = { website: "javascript: alert('you got hacked')", }; // This will now warn: <a href={userProfile.website}>Profile</a> In React 16.9, this pattern continues to work, but it will log a warning. If you use javascript: URLs for logic, try to use React event handlers instead. (As a last resort, you can circumvent the protection with dangerouslySetInnerHTML, but it is highly discouraged and often leads to security holes.) In a future major release, React will throw an error if it encounters a javascript: URL. Deprecating “Factory” Components Before compiling JavaScript classes with Babel became popular, React had support for a “factory” component that returns an object with a render method: function FactoryComponent() { return { render() { return <div />; } } } This pattern is confusing because it looks too much like a function component — but it isn’t one. (A function component would just return the <div /> in the above example.) This pattern was almost never used in the wild, and supporting it causes React to be slightly larger and slower than necessary. So we are deprecating this pattern in 16.9 and logging a warning if it’s encountered. If you rely on it, adding FactoryComponent.prototype = React.Component.prototype can serve as a workaround. Alternatively, you can convert it to either a class or a function component. We don’t expect most codebases to be affected by this. New Features Async act() for Testing React 16.8 introduced a new testing utility called act() to help you write tests that better match the browser behavior. For example, multiple state updates inside a single act() get batched. This matches how React already works when handling real browser events, and helps prepare your components for the future in which React will batch updates more often. However, in 16.8 act() only supported synchronous functions. Sometimes, you might have seen a warning like this in a test but could not easily fix it: An update to SomeComponent inside a test was not wrapped in act(...). In React 16.9, act() also accepts asynchronous functions, and you can await its call: await act(async () => { // ... }); This solves the remaining cases where you couldn’t use act() before, such as when the state update was inside an asynchronous function. As a result, you should be able to fix all the remaining act() warnings in your tests now. We’ve heard there wasn’t enough information about how to write tests with act(). The new Testing Recipes guide describes common scenarios, and how act() can help you write good tests. These examples use vanilla DOM APIs, but you can also use React Testing Library to reduce the boilerplate code. Many of its methods already use act() internally. Please let us know on the issue tracker if you bump into any other scenarios where act() doesn’t work well for you, and we’ll try to help. Performance Measurements with <React.Profiler> In React 16.5, we introduced a new React Profiler for DevTools that helps find performance bottlenecks in your application. In React 16.9, we are also adding a programmatic way to gather measurements called <React.Profiler>. We expect that most smaller apps won’t use it, but it can be handy to track performance regressions over time in larger apps. The <Profiler> measures how often a React application renders and what the “cost” of rendering is. Its purpose is to help identify parts of an application that are slow and may benefit from optimizations such as memoization. A <Profiler> can be added anywhere in a React tree to measure the cost of rendering that part of the tree. It requires two props: an id (string) and an onRender callback (function) which React calls any time a component within the tree “commits” an update. render( <Profiler id="application" onRender={onRenderCallback}> <App> <Navigation {...props} /> <Main {...props} /> </App> </Profiler>); To learn more about the Profiler and the parameters passed to the onRender callback, check out the Profiler docs. Note: Profiling adds some additional overhead, so it is disabled in the production build. To opt into production profiling, React provides a special production build with profiling enabled. Read more about how to use this build at fb.me/react-profiling. Notable Bugfixes This release contains a few other notable improvements: A crash when calling findDOMNode() inside a <Suspense> tree has been fixed. A memory leak caused by retaining deleted subtrees has been fixed too. An infinite loop caused by setState in useEffect now logs an error. (This is similar to the error you see when you call setState in componentDidUpdate in a class.) We’re thankful to all the contributors who helped surface and fix these and other issues. You can find the full changelog below. An Update to the Roadmap In November 2018, we have posted this roadmap for the 16.x releases: A minor 16.x release with React Hooks (past estimate: Q1 2019) A minor 16.x release with Concurrent Mode (past estimate: Q2 2019) A minor 16.x release with Suspense for Data Fetching (past estimate: mid 2019) These estimates were too optimistic, and we’ve needed to adjust them. tldr: We shipped Hooks on time, but we’re regrouping Concurrent Mode and Suspense for Data Fetching into a single release that we intend to release later this year. In February, we shipped a stable 16.8 release including React Hooks, with React Native support coming a month later. However, we underestimated the follow-up work for this release, including the lint rules, developer tools, examples, and more documentation. This shifted the timeline by a few months. Now that React Hooks are rolled out, the work on Concurrent Mode and Suspense for Data Fetching is in full swing. The new Facebook website that’s currently in active development is built on top of these features. Testing them with real code helped discover and address many issues before they can affect the open source users. Some of these fixes involved an internal redesign of these features, which has also caused the timeline to slip. With this new understanding, here’s what we plan to do next. One Release Instead of Two Concurrent Mode and Suspense power the new Facebook website that’s in active development, so we are confident that they’re close to a stable state technically. We also now better understand the concrete steps before they are ready for open source adoption. Originally we thought we would split Concurrent Mode and Suspense for Data Fetching into two releases. We’ve found that this sequencing is confusing to explain because these features are more related than we thought at first. So we plan to release support for both Concurrent Mode and Suspense for Data Fetching in a single combined release instead. We don’t want to overpromise the release date again. Given that we rely on both of them in production code, we expect to provide a 16.x release with opt-in support for them this year. An Update on Data Fetching While React is not opinionated about how you fetch data, the first release of Suspense for Data Fetching will likely focus on integrating with opinionated data fetching libraries. For example, at Facebook we are using upcoming Relay APIs that integrate with Suspense. We will document how other opinionated libraries like Apollo can support a similar integration. In the first release, we don’t intend to focus on the ad-hoc “fire an HTTP request” solution we used in earlier demos (also known as “React Cache”). However, we expect that both we and the React community will be exploring that space in the months after the initial release. An Update on Server Rendering We have started the work on the new Suspense-capable server renderer, but we don’t expect it to be ready for the initial release of Concurrent Mode. This release will, however, provide a temporary solution that lets the existing server renderer emit HTML for Suspense fallbacks immediately, and then render their real content on the client. This is the solution we are currently using at Facebook ourselves until the streaming renderer is ready. Why Is It Taking So Long? We’ve shipped the individual pieces leading up to Concurrent Mode as they became stable, including new context API, lazy loading with Suspense, and Hooks. We are also eager to release the other missing parts, but trying them at scale is an important part of the process. The honest answer is that it just took more work than we expected when we started. As always, we appreciate your questions and feedback on Twitter and in our issue tracker. Installation React React v16.9.0 is available on the npm registry. To install React 16 with Yarn, run: yarn add react@^16.9.0 react-dom@^16.9.0 To install React 16 with npm, run: npm install --save react@^16.9.0 react-dom@^16.9.0 We also provide UMD builds of React via a CDN: <script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script> <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script> Refer to the documentation for detailed installation instructions. Changelog React Add <React.Profiler> API for gathering performance measurements programmatically. (@bvaughn in #15172) Remove unstable_ConcurrentMode in favor of unstable_createRoot. (@acdlite in #15532) React DOM Deprecate old names for the UNSAFE_* lifecycle methods. (@bvaughn in #15186 and @threepointone in #16103) Deprecate javascript: URLs as a common attack surface. (@sebmarkbage in #15047) Deprecate uncommon “module pattern” (factory) components. (@sebmarkbage in #15145) Add support for the disablePictureInPicture attribute on <video>. (@eek in #15334) Add support for onLoad event for <embed>. (@cherniavskii in #15614) Add support for editing useState state from DevTools. (@bvaughn in #14906) Add support for toggling Suspense from DevTools. (@gaearon in #15232) Warn when setState is called from useEffect, creating a loop. (@gaearon in #15180) Fix a memory leak. (@paulshen in #16115) Fix a crash inside findDOMNode for components wrapped in <Suspense>. (@acdlite in #15312) Fix pending effects from being flushed too late. (@acdlite in #15650) Fix incorrect argument order in a warning message. (@brickspert in #15345) Fix hiding Suspense fallback nodes when there is an !important style. (@acdlite in #15861 and #15882) Slightly improve hydration performance. (@bmeurer in #15998) React DOM Server Fix incorrect output for camelCase custom CSS property names. (@bedakb in #16167) React Test Utilities and Test Renderer Add act(async () => ...) for testing asynchronous state updates. (@threepointone in #14853) Add support for nesting act from different renderers. (@threepointone in #16039 and #16042) Warn in Strict Mode if effects are scheduled outside an act() call. (@threepointone in #15763 and #16041) Warn when using act from the wrong renderer. (@threepointone in #15756) Full Article
academic and careers Introducing the New React DevTools By reactjs.org Published On :: Thu, 15 Aug 2019 00:00:00 GMT We are excited to announce a new release of the React Developer Tools, available today in Chrome, Firefox, and (Chromium) Edge! What’s changed? A lot has changed in version 4! At a high level, this new version should offer significant performance gains and an improved navigation experience. It also offers full support for React Hooks, including inspecting nested objects. Visit the interactive tutorial to try out the new version or see the changelog for demo videos and more details. Which versions of React are supported? react-dom 0-14.x: Not supported 15.x: Supported (except for the new component filters feature) 16.x: Supported react-native 0-0.61: Not supported 0.62: Will be supported (when 0.62 is released) How do I get the new DevTools? React DevTools is available as an extension for Chrome and Firefox. If you have already installed the extension, it should update automatically within the next couple of hours. If you use the standalone shell (e.g. in React Native or Safari), you can install the new version from NPM: npm install -g react-devtools@^4 Where did all of the DOM elements go? The new DevTools provides a way to filter components from the tree to make it easier to navigate deeply nested hierarchies. Host nodes (e.g. HTML <div>, React Native <View>) are hidden by default, but this filter can be disabled: How do I get the old version back? If you are working with React Native version 60 (or older) you can install the previous release of DevTools from NPM: npm install --dev react-devtools@^3 For older versions of React DOM (v0.14 or earlier) you will need to build the extension from source: # Checkout the extension source git clone https://github.com/facebook/react-devtools cd react-devtools # Checkout the previous release branch git checkout v3 # Install dependencies and build the unpacked extension yarn install yarn build:extension # Follow the on-screen instructions to complete installation Thank you! We’d like to thank everyone who tested the early release of DevTools version 4. Your feedback helped improve this initial release significantly. We still have many exciting features planned and feedback is always welcome! Please feel free to open a GitHub issue or tag @reactjs on Twitter. Full Article
academic and careers Preparing for the Future with React Prereleases By reactjs.org Published On :: Tue, 22 Oct 2019 00:00:00 GMT To share upcoming changes with our partners in the React ecosystem, we’re establishing official prerelease channels. We hope this process will help us make changes to React with confidence, and give developers the opportunity to try out experimental features. This post will be most relevant to developers who work on frameworks, libraries, or developer tooling. Developers who use React primarily to build user-facing applications should not need to worry about our prerelease channels. React relies on a thriving open source community to file bug reports, open pull requests, and submit RFCs. To encourage feedback, we sometimes share special builds of React that include unreleased features. Because the source of truth for React is our public GitHub repository, it’s always been possible to build a copy of React that includes the latest changes. However it’s much easier for developers to install React from npm, so we occasionally publish prerelease builds to the npm registry. A recent example is the 16.7 alpha, which included an early version of the Hooks API. We would like to make it even easier for developers to test prerelease builds of React, so we’re formalizing our process with three separate release channels. Release Channels The information in this post is also available on our Release Channels page. We will update that document whenever there are changes to our release process. Each of React’s release channels is designed for a distinct use case: Latest is for stable, semver React releases. It’s what you get when you install React from npm. This is the channel you’re already using today. Use this for all user-facing React applications. Next tracks the master branch of the React source code repository. Think of these as release candidates for the next minor semver release. Use this for integration testing between React and third party projects. Experimental includes experimental APIs and features that aren’t available in the stable releases. These also track the master branch, but with additional feature flags turned on. Use this to try out upcoming features before they are released. All releases are published to npm, but only Latest uses semantic versioning. Prereleases (those in the Next and Experimental channels) have versions generated from a hash of their contents, e.g. 0.0.0-1022ee0ec for Next and 0.0.0-experimental-1022ee0ec for Experimental. The only officially supported release channel for user-facing applications is Latest. Next and Experimental releases are provided for testing purposes only, and we provide no guarantees that behavior won’t change between releases. They do not follow the semver protocol that we use for releases from Latest. By publishing prereleases to the same registry that we use for stable releases, we are able to take advantage of the many tools that support the npm workflow, like unpkg and CodeSandbox. Latest Channel Latest is the channel used for stable React releases. It corresponds to the latest tag on npm. It is the recommended channel for all React apps that are shipped to real users. If you’re not sure which channel you should use, it’s Latest. If you’re a React developer, this is what you’re already using. You can expect updates to Latest to be extremely stable. Versions follow the semantic versioning scheme. Learn more about our commitment to stability and incremental migration in our versioning policy. Next Channel The Next channel is a prerelease channel that tracks the master branch of the React repository. We use prereleases in the Next channel as release candidates for the Latest channel. You can think of Next as a superset of Latest that is updated more frequently. The degree of change between the most recent Next release and the most recent Latest release is approximately the same as you would find between two minor semver releases. However, the Next channel does not conform to semantic versioning. You should expect occasional breaking changes between successive releases in the Next channel. Do not use prereleases in user-facing applications. Releases in Next are published with the next tag on npm. Versions are generated from a hash of the build’s contents, e.g. 0.0.0-1022ee0ec. Using the Next Channel for Integration Testing The Next channel is designed to support integration testing between React and other projects. All changes to React go through extensive internal testing before they are released to the public. However, there are myriad environments and configurations used throughout the React ecosystem, and it’s not possible for us to test against every single one. If you’re the author of a third party React framework, library, developer tool, or similar infrastructure-type project, you can help us keep React stable for your users and the entire React community by periodically running your test suite against the most recent changes. If you’re interested, follow these steps: Set up a cron job using your preferred continuous integration platform. Cron jobs are supported by both CircleCI and Travis CI. In the cron job, update your React packages to the most recent React release in the Next channel, using next tag on npm. Using the npm cli: npm update react@next react-dom@next Or yarn: yarn upgrade react@next react-dom@next Run your test suite against the updated packages. If everything passes, great! You can expect that your project will work with the next minor React release. If something breaks unexpectedly, please let us know by filing an issue. A project that uses this workflow is Next.js. (No pun intended! Seriously!) You can refer to their CircleCI configuration as an example. Experimental Channel Like Next, the Experimental channel is a prerelease channel that tracks the master branch of the React repository. Unlike Next, Experimental releases include additional features and APIs that are not ready for wider release. Usually, an update to Next is accompanied by a corresponding update to Experimental. They are based on the same source revision, but are built using a different set of feature flags. Experimental releases may be significantly different than releases to Next and Latest. Do not use Experimental releases in user-facing applications. You should expect frequent breaking changes between releases in the Experimental channel. Releases in Experimental are published with the experimental tag on npm. Versions are generated from a hash of the build’s contents, e.g. 0.0.0-experimental-1022ee0ec. What Goes Into an Experimental Release? Experimental features are ones that are not ready to be released to the wider public, and may change drastically before they are finalized. Some experiments may never be finalized — the reason we have experiments is to test the viability of proposed changes. For example, if the Experimental channel had existed when we announced Hooks, we would have released Hooks to the Experimental channel weeks before they were available in Latest. You may find it valuable to run integration tests against Experimental. This is up to you. However, be advised that Experimental is even less stable than Next. We do not guarantee any stability between Experimental releases. How Can I Learn More About Experimental Features? Experimental features may or may not be documented. Usually, experiments aren’t documented until they are close to shipping in Next or Stable. If a feature is not documented, they may be accompanied by an RFC. We will post to the React blog when we’re ready to announce new experiments, but that doesn’t mean we will publicize every experiment. You can always refer to our public GitHub repository’s history for a comprehensive list of changes. Full Article
academic and careers Building Great User Experiences with Concurrent Mode and Suspense By reactjs.org Published On :: Wed, 06 Nov 2019 00:00:00 GMT At React Conf 2019 we announced an experimental release of React that supports Concurrent Mode and Suspense. In this post we’ll introduce best practices for using them that we’ve identified through the process of building the new facebook.com. This post will be most relevant to people working on data fetching libraries for React. It shows how to best integrate them with Concurrent Mode and Suspense. The patterns introduced here are based on Relay — our library for building data-driven UIs with GraphQL. However, the ideas in this post apply to other GraphQL clients as well as libraries using REST or other approaches. This post is aimed at library authors. If you’re primarily an application developer, you might still find some interesting ideas here, but don’t feel like you have to read it in its entirety. Talk Videos If you prefer to watch videos, some of the ideas from this blog post have been referenced in several React Conf 2019 presentations: Data Fetching with Suspense in Relay by Joe Savona Building the New Facebook with React and Relay by Ashley Watkins React Conf Keynote by Yuzhi Zheng This post presents a deeper dive on implementing a data fetching library with Suspense. Putting User Experience First The React team and community has long placed a deserved emphasis on developer experience: ensuring that React has good error messages, focusing on components as a way to reason locally about app behavior, crafting APIs that are predictable and encourage correct usage by design, etc. But we haven’t provided enough guidance on the best ways to achieve a great user experience in large apps. For example, the React team has focused on framework performance and providing tools for developers to debug and tune application performance (e.g. React.memo). But we haven’t been as opinionated about the high-level patterns that make the difference between fast, fluid apps and slow, janky ones. We always want to ensure that React remains approachable to new users and supports a variety of use-cases — not every app has to be “blazing” fast. But as a community we can and should aim high. We should make it as easy as possible to build apps that start fast and stay fast, even as they grow in complexity, for users on varying devices and networks around the world. Concurrent Mode and Suspense are experimental features that can help developers achieve this goal. We first introduced them at JSConf Iceland in 2018, intentionally sharing details very early to give the community time to digest the new concepts and to set the stage for subsequent changes. Since then we’ve completed related work, such as the new Context API and the introduction of Hooks, which are designed in part to help developers naturally write code that is more compatible with Concurrent Mode. But we didn’t want to implement these features and release them without validating that they work. So over the past year, the React, Relay, web infrastructure, and product teams at Facebook have all collaborated closely to build a new version of facebook.com that deeply integrates Concurrent Mode and Suspense to create an experience with a more fluid and app-like feel. Thanks to this project, we’re more confident than ever that Concurrent Mode and Suspense can make it easier to deliver great, fast user experiences. But doing so requires rethinking how we approach loading code and data for our apps. Effectively all of the data-fetching on the new facebook.com is powered by Relay Hooks — new Hooks-based Relay APIs that integrate with Concurrent Mode and Suspense out of the box. Relay Hooks — and GraphQL — won’t be for everyone, and that’s ok! Through our work on these APIs we’ve identified a set of more general patterns for using Suspense. Even if Relay isn’t the right fit for you, we think the key patterns we’ve introduced with Relay Hooks can be adapted to other frameworks. Best Practices for Suspense It’s tempting to focus only on the total startup time for an app — but it turns out that users’ perception of performance is determined by more than the absolute loading time. For example, when comparing two apps with the same absolute startup time, our research shows that users will generally perceive the one with fewer intermediate loading states and fewer layout changes as having loaded faster. Suspense is a powerful tool for carefully orchestrating an elegant loading sequence with a few, well-defined states that progressively reveal content. But improving perceived performance only goes so far — our apps still shouldn’t take forever to fetch all of their code, data, images, and other assets. The traditional approach to loading data in React apps involves what we refer to as “fetch-on-render”. First we render a component with a spinner, then fetch data on mount (componentDidMount or useEffect), and finally update to render the resulting data. It’s certainly possible to use this pattern with Suspense: instead of initially rendering a placeholder itself, a component can “suspend” — indicate to React that it isn’t ready yet. This will tell React to find the nearest ancestor <Suspense fallback={<Placeholder/>}>, and render its fallback instead. If you watched earlier Suspense demos this example may feel familiar — it’s how we originally imagined using Suspense for data-fetching. It turns out that this approach has some limitations. Consider a page that shows a social media post by a user, along with comments on that post. That might be structured as a <Post> component that renders both the post body and a <CommentList> to show the comments. Using the fetch-on-render approach described above to implement this could cause sequential round trips (sometimes referred to as a “waterfall”). First the data for the <Post> component would be fetched and then the data for <CommentList> would be fetched, increasing the time it takes to show the full page. There’s also another often-overlooked downside to this approach. If <Post> eagerly requires (or imports) the <CommentList> component, our app will have to wait to show the post body while the code for the comments is downloading. We could lazily load <CommentList>, but then that would delay fetching comments data and increase the time to show the full page. How do we resolve this problem without compromising on the user experience? Render As You Fetch The fetch-on-render approach is widely used by React apps today and can certainly be used to create great apps. But can we do even better? Let’s step back and consider our goal. In the above <Post> example, we’d ideally show the more important content — the post body — as early as possible, without negatively impacting the time to show the full page (including comments). Let’s consider the key constraints on any solution and look at how we can achieve them: Showing the more important content (the post body) as early as possible means that we need to load the code and data for the view incrementally. We don’t want to block showing the post body on the code for <CommentList> being downloaded, for example. At the same time we don’t want to increase the time to show the full page including comments. So we need to start loading the code and data for the comments as soon as possible, ideally in parallel with loading the post body. This might sound difficult to achieve — but these constraints are actually incredibly helpful. They rule out a large number of approaches and spell out a solution for us. This brings us to the key patterns we’ve implemented in Relay Hooks, and that can be adapted to other data-fetching libraries. We’ll look at each one in turn and then see how they add up to achieve our goal of fast, delightful loading experiences: Parallel data and view trees Fetch in event handlers Load data incrementally Treat code like data Parallel Data and View Trees One of the most appealing things about the fetch-on-render pattern is that it colocates what data a component needs with how to render that data. This colocation is great — an example of how it makes sense to group code by concerns and not by technologies. All the issues we saw above were due to when we fetch data in this approach: upon rendering. We need to be able to fetch data before we’ve rendered the component. The only way to achieve that is by extracting the data dependencies into parallel data and view trees. Here’s how that works in Relay Hooks. Continuing our example of a social media post with body and comments, here’s how we might define it with Relay Hooks: // Post.js function Post(props) { // Given a reference to some post - `props.post` - *what* data // do we need about that post? const postData = useFragment(graphql` fragment PostData on Post @refetchable(queryName: "PostQuery") { author title # ... more fields ... } `, props.post); // Now that we have the data, how do we render it? return ( <div> <h1>{postData.title}</h1> <h2>by {postData.author}</h2> {/* more fields */} </div> ); } Although the GraphQL is written within the component, Relay has a build step (Relay Compiler) that extracts these data-dependencies into separate files and aggregates the GraphQL for each view into a single query. So we get the benefit of colocating concerns, while at runtime having parallel data and view trees. Other frameworks could achieve a similar effect by allowing developers to define data-fetching logic in a sibling file (maybe Post.data.js), or perhaps integrate with a bundler to allow defining data dependencies with UI code and automatically extracting it, similar to Relay Compiler. The key is that regardless of the technology we’re using to load our data — GraphQL, REST, etc — we can separate what data to load from how and when to actually load it. But once we do that, how and when do we fetch our data? Fetch in Event Handlers Imagine that we’re about to navigate from a list of a user’s posts to the page for a specific post. We’ll need to download the code for that page — Post.js — and also fetch its data. Waiting until we render the component has problems as we saw above. The key is to start fetching code and data for a new view in the same event handler that triggers showing that view. We can either fetch the data within our router — if our router supports preloading data for routes — or in the click event on the link that triggered the navigation. It turns out that the React Router folks are already hard at work on building APIs to support preloading data for routes. But other routing frameworks can implement this idea too. Conceptually, we want every route definition to include two things: what component to render and what data to preload, as a function of the route/url params. Here’s what such a route definition might look like. This example is loosely inspired by React Router’s route definitions and is primarily intended to demonstrate the concept, not a specific API: // PostRoute.js (GraphQL version) // Relay generated query for loading Post data import PostQuery from './__generated__/PostQuery.graphql'; const PostRoute = { // a matching expression for which paths to handle path: '/post/:id', // what component to render for this route component: React.lazy(() => import('./Post')), // data to load for this route, as function of the route // parameters prepare: routeParams => { // Relay extracts queries from components, allowing us to reference // the data dependencies -- data tree -- from outside. const postData = preloadQuery(PostQuery, { postId: routeParams.id, }); return { postData }; }, }; export default PostRoute; Given such a definition, a router can: Match a URL to a route definition. Call the prepare() function to start loading that route’s data. Note that prepare() is synchronous — we don’t wait for the data to be ready, since we want to start rendering more important parts of the view (like the post body) as quickly as possible. Pass the preloaded data to the component. If the component is ready — the React.lazy dynamic import has completed — the component will render and try to access its data. If not, React.lazy will suspend until the code is ready. This approach can be generalized to other data-fetching solutions. An app that uses REST might define a route like this: // PostRoute.js (REST version) // Manually written logic for loading the data for the component import PostData from './Post.data'; const PostRoute = { // a matching expression for which paths to handle path: '/post/:id', // what component to render for this route component: React.lazy(() => import('./Post')), // data to load for this route, as function of the route // parameters prepare: routeParams => { const postData = preloadRestEndpoint( PostData.endpointUrl, { postId: routeParams.id, }, ); return { postData }; }, }; export default PostRoute; This same approach can be employed not just for routing, but in other places where we show content lazily or based on user interaction. For example, a tab component could eagerly load the first tab’s code and data, and then use the same pattern as above to load the code and data for other tabs in the tab-change event handler. A component that displays a modal could preload the code and data for the modal in the click handler that triggers opening the modal, and so on. Once we’ve implemented the ability to start loading code and data for a view independently, we have the option to go one step further. Consider a <Link to={path} /> component that links to a route. If the user hovers over that link, there’s a reasonable chance they’ll click it. And if they press the mouse down, there’s an even better chance that they’ll complete the click. If we can load code and data for a view after the user clicks, we can also start that work before they click, getting a head start on preparing the view. Best of all, we can centralize that logic in a few key places — a router or core UI components — and get any performance benefits automatically throughout our app. Of course preloading isn’t always beneficial. It’s something an application would tune based on the user’s device or network speed to avoid eating up user’s data plans. But the pattern here makes it easier to centralize the implementation of preloading and the decision of whether to enable it or not. Load Data Incrementally The above patterns — parallel data/view trees and fetching in event handlers — let us start loading all the data for a view earlier. But we still want to be able to show more important parts of the view without waiting for all of our data. At Facebook we’ve implemented support for this in GraphQL and Relay in the form of some new GraphQL directives (annotations that affect how/when data is delivered, but not what data). These new directives, called @defer and @stream, allow us to retrieve data incrementally. For example, consider our <Post> component from above. We want to show the body without waiting for the comments to be ready. We can achieve this with @defer and <Suspense>: // Post.js function Post(props) { const postData = useFragment(graphql` fragment PostData on Post { author title # fetch data for the comments, but don't block on it being ready ...CommentList @defer } `, props.post); return ( <div> <h1>{postData.title}</h1> <h2>by {postData.author}</h2> {/* @defer pairs naturally with <Suspense> to make the UI non-blocking too */} <Suspense fallback={<Spinner/>}> <CommentList post={postData} /> </Suspense> </div> ); } Here, our GraphQL server will stream back the results, first returning the author and title fields and then returning the comment data when it’s ready. We wrap <CommentList> in a <Suspense> boundary so that we can render the post body before <CommentList> and its data are ready. This same pattern can be applied to other frameworks as well. For example, apps that call a REST API might make parallel requests to fetch the body and comments data for a post to avoid blocking on all the data being ready. Treat Code Like Data But there’s one thing that’s still missing. We’ve shown how to preload data for a route — but what about code? The example above cheated a bit and used React.lazy. However, React.lazy is, as the name implies, lazy. It won’t start downloading code until the lazy component is actually rendered — it’s “fetch-on-render” for code! To solve this, the React team is considering APIs that would allow bundle splitting and eager preloading for code as well. That would allow a user to pass some form of lazy component to a router, and for the router to trigger loading the code alongside its data as early as possible. Putting It All Together To recap, achieving a great loading experience means that we need to start loading code and data as early as possible, but without waiting for all of it to be ready. Parallel data and view trees allow us to load the data for a view in parallel with loading the view (code) itself. Fetching in an event handler means we can start loading data as early as possible, and even optimistically preload a view when we have enough confidence that a user will navigate to it. Loading data incrementally allows us to load important data earlier without delaying the fetching of less important data. And treating code as data — and preloading it with similar APIs — allows us to load it earlier too. Using These Patterns These patterns aren’t just ideas — we’ve implemented them in Relay Hooks and are using them in production throughout the new facebook.com (which is currently in beta testing). If you’re interested in using or learning more about these patterns, here are some resources: The React Concurrent docs explore how to use Concurrent Mode and Suspense and go into more detail about many of these patterns. It’s a great resource to learn more about the APIs and use-cases they support. The experimental release of Relay Hooks implements the patterns described here. We’ve implemented two similar example apps that demonstrate these concepts: The Relay Hooks example app uses GitHub’s public GraphQL API to implement a simple issue tracker app. It includes nested route support with code and data preloading. The code is fully commented — we encourage cloning the repo, running the app locally, and exploring how it works. We also have a non-GraphQL version of the app that demonstrates how these concepts can be applied to other data-fetching libraries. While the APIs around Concurrent Mode and Suspense are still experimental, we’re confident that the ideas in this post are proven by practice. However, we understand that Relay and GraphQL aren’t the right fit for everyone. That’s ok! We’re actively exploring how to generalize these patterns to approaches such as REST, and are exploring ideas for a more generic (ie non-GraphQL) API for composing a tree of data dependencies. In the meantime, we’re excited to see what new libraries will emerge that implement the patterns described in this post to make it easier to build great, fast user experiences. Full Article
academic and careers React v16.13.0 By reactjs.org Published On :: Wed, 26 Feb 2020 00:00:00 GMT Today we are releasing React 16.13.0. It contains bugfixes and new deprecation warnings to help prepare for a future major release. New Warnings Warnings for some updates during render A React component should not cause side effects in other components during rendering. It is supported to call setState during render, but only for the same component. If you call setState during a render on a different component, you will now see a warning: Warning: Cannot update a component from inside the function body of a different component. This warning will help you find application bugs caused by unintentional state changes. In the rare case that you intentionally want to change the state of another component as a result of rendering, you can wrap the setState call into useEffect. Warnings for conflicting style rules When dynamically applying a style that contains longhand and shorthand versions of CSS properties, particular combinations of updates can cause inconsistent styling. For example: <div style={toggle ? { background: 'blue', backgroundColor: 'red' } : { backgroundColor: 'red' } }> ... </div> You might expect this <div> to always have a red background, no matter the value of toggle. However, on alternating the value of toggle between true and false, the background color start as red, then alternates between transparent and blue, as you can see in this demo. React now detects conflicting style rules and logs a warning. To fix the issue, don’t mix shorthand and longhand versions of the same CSS property in the style prop. Warnings for some deprecated string refs String Refs is an old legacy API which is discouraged and is going to be deprecated in the future: <Button ref="myRef" /> (Don’t confuse String Refs with refs in general, which remain fully supported.) In the future, we will provide an automated script (a “codemod”) to migrate away from String Refs. However, some rare cases can’t be migrated automatically. This release adds a new warning only for those cases in advance of the deprecation. For example, it will fire if you use String Refs together with the Render Prop pattern: class ClassWithRenderProp extends React.Component { componentDidMount() { doSomething(this.refs.myRef); } render() { return this.props.children(); } } class ClassParent extends React.Component { render() { return ( <ClassWithRenderProp> {() => <Button ref="myRef" />} </ClassWithRenderProp> ); } } Code like this often indicates bugs. (You might expect the ref to be available on ClassParent, but instead it gets placed on ClassWithRenderProp). You most likely don’t have code like this. If you do and it is intentional, convert it to React.createRef() instead: class ClassWithRenderProp extends React.Component { myRef = React.createRef(); componentDidMount() { doSomething(this.myRef.current); } render() { return this.props.children(this.myRef); } } class ClassParent extends React.Component { render() { return ( <ClassWithRenderProp> {myRef => <Button ref={myRef} />} </ClassWithRenderProp> ); } } Note To see this warning, you need to have the babel-plugin-transform-react-jsx-self installed in your Babel plugins. It must only be enabled in development mode. If you use Create React App or have the “react” preset with Babel 7+, you already have this plugin installed by default. Deprecating React.createFactory React.createFactory is a legacy helper for creating React elements. This release adds a deprecation warning to the method. It will be removed in a future major version. Replace usages of React.createFactory with regular JSX. Alternately, you can copy and paste this one-line helper or publish it as a library: let createFactory = type => React.createElement.bind(null, type); It does exactly the same thing. Deprecating ReactDOM.unstable_createPortal in favor of ReactDOM.createPortal When React 16 was released, createPortal became an officially supported API. However, we kept unstable_createPortal as a supported alias to keep the few libraries that adopted it working. We are now deprecating the unstable alias. Use createPortal directly instead of unstable_createPortal. It has exactly the same signature. Other Improvements Component stacks in hydration warnings React adds component stacks to its development warnings, enabling developers to isolate bugs and debug their programs. This release adds component stacks to a number of development warnings that didn’t previously have them. As an example, consider this hydration warning from the previous versions: While it’s pointing out an error with the code, it’s not clear where the error exists, and what to do next. This release adds a component stack to this warning, which makes it look like this: This makes it clear where the problem is, and lets you locate and fix the bug faster. Notable bugfixes This release contains a few other notable improvements: In Strict Development Mode, React calls lifecycle methods twice to flush out any possible unwanted side effects. This release adds that behaviour to shouldComponentUpdate. This shouldn’t affect most code, unless you have side effects in shouldComponentUpdate. To fix this, move the code with side effects into componentDidUpdate. In Strict Development Mode, the warnings for usage of the legacy context API didn’t include the stack for the component that triggered the warning. This release adds the missing stack to the warning. onMouseEnter now doesn’t trigger on disabled <button> elements. ReactDOM was missing a version export since we published v16. This release adds it back. We don’t recommend using it in your application logic, but it’s useful when debugging issues with mismatching / multiple versions of ReactDOM on the same page. We’re thankful to all the contributors who helped surface and fix these and other issues. You can find the full changelog below. Installation React React v16.13.0 is available on the npm registry. To install React 16 with Yarn, run: yarn add react@^16.13.0 react-dom@^16.13.0 To install React 16 with npm, run: npm install --save react@^16.13.0 react-dom@^16.13.0 We also provide UMD builds of React via a CDN: <script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script> <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script> Refer to the documentation for detailed installation instructions. Changelog React Warn when a string ref is used in a manner that’s not amenable to a future codemod (@lunaruan in #17864) Deprecate React.createFactory() (@trueadm in #17878) React DOM Warn when changes in style may cause an unexpected collision (@sophiebits in #14181, #18002) Warn when a function component is updated during another component’s render phase (@acdlite in #17099) Deprecate unstable_createPortal (@trueadm in #17880) Fix onMouseEnter being fired on disabled buttons (@AlfredoGJ in #17675) Call shouldComponentUpdate twice when developing in StrictMode (@bvaughn in #17942) Add version property to ReactDOM (@ealush in #15780) Don’t call toString() of dangerouslySetInnerHTML (@sebmarkbage in #17773) Show component stacks in more warnings (@gaearon in #17922, #17586) Concurrent Mode (Experimental) Warn for problematic usages of ReactDOM.createRoot() (@trueadm in #17937) Remove ReactDOM.createRoot() callback params and added warnings on usage (@bvaughn in #17916) Don’t group Idle/Offscreen work with other work (@sebmarkbage in #17456) Adjust SuspenseList CPU bound heuristic (@sebmarkbage in #17455) Add missing event plugin priorities (@trueadm in #17914) Fix isPending only being true when transitioning from inside an input event (@acdlite in #17382) Fix React.memo components dropping updates when interrupted by a higher priority update (@acdlite in #18091) Don’t warn when suspending at the wrong priority (@gaearon in #17971) Fix a bug with rebasing updates (@acdlite and @sebmarkbage in #17560, #17510, #17483, #17480) Full Article
academic and careers No RSS Feed Item Available By feeds.equitymaster.com Published On :: Thu, 23 Nov 2017 11:36:33 GMT Full Article
academic and careers CEA partners with IWMI to improve Colombo’s municipal waste management and farmers’ access to organic fertilizers By www.iwmi.cgiar.org Published On :: Wed, 11 Dec 2013 09:36:12 +0000 Colombo, December 10, 2013. At the request of the Colombo Municipal Council (CMC), the Central Environmental Authority (CEA), in collaboration with the International Water Management Institute (IWMI), organized a stakeholder meeting to discuss improvements that can be made to the management of municipal waste in the City of Colombo. The meeting was held at the […] Full Article Asia News Media Releases Regional News South Asia News Sri Lanka News Z-News CEA CMC fertilizers waste management
academic and careers CGIAR doubles funding to $1 billion in five years By www.iwmi.cgiar.org Published On :: Wed, 18 Dec 2013 02:30:37 +0000 Fruits of new investments in CGIAR could include big boost in rice production for Asia, sustainable irrigation for millions of parched farms in Africa, and dramatic drop in forest destruction tied to agriculture. Washington, D.C. and Montpellier, France — CGIAR, the world’s largest agriculture research partnership, today announced its funding has doubled from $500 million […] Full Article Media Releases CGIAR
academic and careers President Rajapaksa launches new water information system during visit to IWMI By www.iwmi.cgiar.org Published On :: Fri, 17 Jan 2014 06:00:00 +0000 17th January 2014 – Colombo, Sri Lanka – His Excellency Mahinda Rajapaksa, President of the Democratic Socialist Republic of Sri Lanka, has officially launched a new, hi-tech information system that promises to enhance water management in the South Asian country. Download the full media release Full Article Media Releases Information System Mahinda Rajapaksa President SLWater Water Resources
academic and careers Millions affected, billions at stake: Scientists urge ‘wiser’ use of wetlands to tackle poverty and conserve ecosystems By www.iwmi.cgiar.org Published On :: Wed, 29 Jan 2014 10:17:50 +0000 2nd February 2014 – Colombo, Sri Lanka Agriculture and wetlands should be managed in unison in order to conserve vital ecosystems and support the livelihoods of millions of people, according to a new report published to coincide with World Wetlands Day, today. Download the full media release Download the report Full Article Media Releases ecosystems wetlands
academic and careers Indian water policy initiative receives World Water Day global award By www.iwmi.cgiar.org Published On :: Fri, 21 Mar 2014 06:09:08 +0000 Tokyo, Japan (March 21, 2014): A research program that pinpointed how perverse subsidies were causing India to export virtual water has won the coveted ‘Water for Life’ UN-Water Best Practices Award. The IWMI-Tata Water Policy Research Program (ITP), a partnership between the International Water Management Institute (IWMI), Colombo, Sri Lanka, and the Sir Ratan Tata […] Full Article Asia News Awards India News Media Releases Regional News South Asia News Z-News Tushaar Shah UN-Water Water for Life