building Clothing firms Joe Fresh and Primark to compensate victims of Bangladesh building collapse By www.treehugger.com Published On :: Mon, 29 Apr 2013 17:57:00 -0400 Good for the Westons, owners of both, for doing the right thing by admitting their use of the factory and their willingness to help out. Full Article Business
building Woman transforming plastic waste into bricks for building 'silver houses' in Pakistan (Video) By www.treehugger.com Published On :: Wed, 07 Sep 2016 14:40:55 -0400 For the last two decades, Nargis Latif and her organization have been researching how to divert waste from landfills and reusing it as quick and cheap construction materials. Full Article Design
building The foxes are writing building codes for henhouses By www.treehugger.com Published On :: Mon, 28 Oct 2019 13:21:12 -0400 A secret deal lets the homebuilders dominate the committees that write the building codes for housing. Full Article Business
building Rooftop Mats Could Let Buildings Sweat to Cool Off By www.treehugger.com Published On :: Wed, 03 Oct 2012 02:39:00 -0400 A new material could be applied to roofs that would soak up rain and then "sweat" out the moisture when temperatures are high to cool down buildings without electricity. Full Article Technology
building Nanopad is a 236 sq. ft. micro-apartment in historic building (Video) By www.treehugger.com Published On :: Mon, 18 Feb 2019 15:05:29 -0500 This redesigned space in a 1920s Art Deco building features a new layout that better maximizes space and light. Full Article Design
building Smart! Cornell engages kids with nest box building workshops By www.treehugger.com Published On :: Tue, 04 Dec 2018 11:07:00 -0500 The Cornell Lab of Ornithology is a world leader in the study, appreciation, and conservation of birds. But the vast educational opportunities it offers aren’t reserved only for Ivy League students. Full Article Business
building Latest drone view of Apple HQ shows a building as shiny as a new iPhone By www.treehugger.com Published On :: Thu, 08 Sep 2016 10:37:59 -0400 Things are moving quickly; Apple employees might get updated offices before Mac users get updated computers. Full Article Design
building Is it time to rethink green building (and other) standards? By www.treehugger.com Published On :: Mon, 18 Feb 2019 13:21:50 -0500 Standards are supposed to make things easier and more consistent, but they keep proliferating. Full Article Design
building Net-zero building unveiled in Brooklyn’s Brighton Beach neighborhood By www.treehugger.com Published On :: Wed, 29 Oct 2014 17:23:29 -0400 The Bright ’N Green building is an experimental effort to combine sustainable technologies. Full Article Design
building Brooklyn townhouse retrofit embodies a “slow building” ethos By www.treehugger.com Published On :: Thu, 13 Nov 2014 15:50:24 -0500 There are many special things about the home of Gennaro Brooks-Church, the director of the green building firm Eco Brooklyn. Full Article Design
building Meet the woman building stunning sustainable homes from bamboo By www.treehugger.com Published On :: Wed, 20 May 2015 13:30:04 -0400 Elora Hardy and her team of designers, artisans, and builders at Ibuku are reimagining sustainable building, using one of nature's strongest and most versatile materials. Full Article Design
building Collaborative Tiny House Project is creating a tiny house building program for schools By www.treehugger.com Published On :: Fri, 07 Aug 2015 13:04:48 -0400 This tiny house project is developing a multidisciplinary curriculum and tutorial series for schools and for individuals, as well as giving away a "Dream Tiny House." Full Article Design
building Building an old-school green house from local materials with traditional tools (video) By www.treehugger.com Published On :: Fri, 11 Mar 2016 18:09:03 -0500 If you like craftsmanship, woodworking, and traditional hand tools, or you just enjoy watching somebody else do all the work, you'll love this short film. Full Article Design
building Can TWIN elevators make buildings more energy efficient? By www.treehugger.com Published On :: Mon, 25 Apr 2016 14:11:23 -0400 Thyssenkrupp's TWIN elevators have a very unique feature that could save buildings energy and space. Full Article Business
building How to make a building using bottles By www.treehugger.com Published On :: Mon, 10 Jun 2013 12:20:00 -0400 You've seen the photos of homes made from old bottles, but did you ever think you could make your own? You can, and here's how. Full Article Design
building Is cork the perfect green building material? By www.treehugger.com Published On :: Wed, 05 Dec 2018 08:32:36 -0500 It's all natural, renewable, healthy and has zero embodied carbon. What's not to love? Full Article Design
building Reborn as a Restaurant, a Berlin Building Overcomes its Dark History By www.treehugger.com Published On :: Thu, 05 Jul 2012 05:00:00 -0400 A building that once housed a Jewish girls' school, shut down by the Nazis, is now home to a fashionable restaurant. Full Article Design
building World's largest vertical garden hosts 115,000 plants to create "living building" (Video) By www.treehugger.com Published On :: Thu, 08 Jun 2017 14:14:06 -0400 This vertical garden on a residential high-rise in Bogotá reuses greywater from its residents and helps to clean the air. Full Article Design
building Restored church building has a growing congregation – of bees By www.treehugger.com Published On :: Tue, 16 Oct 2018 11:02:39 -0400 ZGF builds interesting hives on the roof of a fascinating building. Full Article Design
building Why we need airtight buildings: Outdoor air quality is getting worse By www.treehugger.com Published On :: Fri, 20 Dec 2019 10:26:07 -0500 What's the best approach for dealing with this? Full Article Design
building Building a clean energy economy that works By www.treehugger.com Published On :: Mon, 11 Nov 2013 12:45:27 -0500 Why Greens Should Support the Fight for Economic and Racial Justice Full Article Business
building New study says we have to stop building CO2 emitting infrastructure right now By www.treehugger.com Published On :: Thu, 04 Jul 2019 14:14:53 -0400 We also have to start retiring what we already have and replacing it with cleaner power plants, furnaces and vehicles. Now. Full Article Business
building Bjarke Ingels Group and Toyota are building a wild, woven and wooden city of the future By www.treehugger.com Published On :: Wed, 08 Jan 2020 12:43:38 -0500 It's actually rather elegant and understated for the Danish superstar. Full Article Design
building European engineers' recommendation: Stop recirculating air in buildings By www.treehugger.com Published On :: Wed, 22 Apr 2020 18:14:27 -0400 Almost every American office building and home has this. Full Article Design
building Amsterdam apartment building is a modern "ship on land" By www.treehugger.com Published On :: Tue, 28 Apr 2020 10:20:05 -0400 But let's not oversell wood construction. Full Article Design
building After the coronavirus, we have to throw out The American Way of Building By www.treehugger.com Published On :: Thu, 30 Apr 2020 13:51:05 -0400 Why now, more than ever, all new building should be Passive House. Full Article Design
building Why building density matters as much as building efficiency By www.treehugger.com Published On :: Thu, 09 Jan 2020 08:47:28 -0500 We'll always have Paris. Full Article Design
building IKEA is building a big new store in Vienna with no parking By www.treehugger.com Published On :: Wed, 15 Jan 2020 14:30:08 -0500 They say it's the new megatrend: customers without cars. Full Article Design
building Buildings by superstar engineer Ove Arup in a new exhibition By www.treehugger.com Published On :: Mon, 27 Jun 2016 05:00:00 -0400 You've heard of starchitects, well here's a super-star engineer: welcome to Ove Arup's world. Full Article Design
building BuildingGreen top ten products of the year are not boring at all By www.treehugger.com Published On :: Tue, 03 Dec 2019 10:53:27 -0500 I am beside myself with excitement over drywall and linoleum. Full Article Design
building In the face of a changing climate, our buildings need thermal resilience. By www.treehugger.com Published On :: Wed, 12 Jun 2019 13:51:41 -0400 The Thermal Resilience Design Guide from Ted Kesik could be a new standard. Full Article Design
building Photo: Lessons in nest building By www.treehugger.com Published On :: Thu, 07 May 2020 06:00:00 -0400 Our photo of the day comes from Jackson County, Oregon. Full Article Science
building Broad Sustainable Buildings builds a COVID hospital in two days By www.treehugger.com Published On :: Wed, 01 Apr 2020 07:49:28 -0400 This is the way you mix shipping container transport tech with spaces that work for human beings. Full Article Design
building Jedi Performers Engage in Epic Lightsaber Challenge at the Top of the World's Tallest Building - Dubai's Burj Khalifa - as Star Wars: The Force Awakens Becomes Available for Digital Download - Two Jedi performers ascend the world’s tallest buildin By feedproxy.google.com Published On :: 08 Apr 2016 10:25:00 EDT Two Jedi performers ascend the world’s tallest building Full Article Entertainment Film & Motion picture Travel Amusement Parks and Tourist Attractions New Products Services MultiVu Video
building Jedi Performers Engage in Epic Lightsaber Challenge at the Top of the World's Tallest Building - Dubai's Burj Khalifa - as Star Wars: The Force Awakens Becomes Available for Digital Download - Two Jedi performers ascend the world’s tallest buildin By feedproxy.google.com Published On :: 08 Apr 2016 10:25:00 EDT Two Jedi performers ascend the world’s tallest building Full Article Entertainment Film & Motion picture Travel Amusement Parks and Tourist Attractions New Products Services MultiVu Video
building Camp Invention Teaches Coding And Prototype Building With New "Epic" Curriculum - An Epic Summer Adventure Awaits By feedproxy.google.com Published On :: 27 Apr 2016 11:10:00 EDT An Epic Summer Adventure Awaits Full Article Education New Products Services Children-related News Broadcast Feed Announcements MultiVu Video
building New Study Shows Inner-City Asthma Care Program Reduces Student Absenteeism by up to 20 Percent - Building Bridges for Asthma Care By feedproxy.google.com Published On :: 19 May 2015 20:10:00 EDT Building Bridges for Asthma Care is a GSK-funded school-based collaboration that addresses the risk of asthma-related absenteeism and its impact on academic achievement for inner city students. Full Article Education Healthcare Hospitals Medical Pharmaceuticals Children-related News Broadcast Feed Announcements Corporate Social Responsibility MultiVu Video
building In Milan, tall buildings covered in trees offer a glimpse of what urban living could look like in the future By www.cnbc.com Published On :: Fri, 01 May 2020 08:14:08 GMT Milan is home to the Bosco Verticale, or Vertical Forest, a striking development of residential buildings. Full Article
building Why one host is striking back at Airbnb by building her own direct booking website By www.cnbc.com Published On :: Fri, 08 May 2020 10:55:30 GMT Polina Raygorodskaya, the co-founder and CEO of direct booking site Wanderu, discusses her and other hosts' frustration with Airbnb policies, and why she decided to build her own site in an effort to diversify her business. Full Article
building What we learned from Hank Green about building community online By feedproxy.google.com Published On :: Fri, 08 May 2020 16:00:00 +0000 Tech Exchange is a student exchange program between Google and 11 Historically Black Colleges and Universities (HBCUs) and Hispanic-Serving Institutions (HSIs). During the program, students spend a semester at Google’s Mountain View Campus, taking computer science courses and learning about professional development. With Tech Exchange students now learning from home, we brought in a speaker who has made a name for himself by engaging with people online: Hank Green, author and YouTube creator. Hank began his journey as a YouTube Creator in 2007 when he and his brother John decided to communicate with each other through video blogs every day for a year. As more people started watching the Vlogbrothers, Hank and John went on to create 32 YouTube channels including Crash Course and SciShow. In a virtual Q&A with Tech Exchange students, Hank shared his insights on how to build community online. Here’s what we learned.Understand the problem that you’re trying to solveHank is often asked, “How does one become a YouTuber?” He says the first step is to understand the question you’re actually trying to solve. “Is it that I want to have a job where I get to be creative all day? Is it that I want to make a specific kind of content that I know is going to be high impact ? Is it that I want to have an audience or that I want to have influence?”Once you actually know that answer, think about the first step on that path (this applies to content creation but also in everything in life!). It’s important to understand what tools you bring to the table. Put the problem that you’re trying to solve in a bucket with your tools and see what falls out. There are other people like you in the world, create for them.Hank shared three strategies that he and John learned when building the Vlogbrothers community. The first is to find common values and interests. “You just have to say, ‘What is the stuff that I would like to see made in the world?’ There are other people who, it turns out, are somewhat like you in the world, and they will be there for it.” The second is to build a feeling of actual connection and the third piece is what I call the "touchstone," which is the YouTube creator building a relationship with the viewer. You have to make people feel like this person is worthy of being the nexus of a community.Put the problem that you’re trying to solve in a bucket with your tools and see what falls out.Create content that represents various perspectivesThrough Hank’s channels, he hopes to put out more content that is representative of a variety of voices and perspectives. To do this, he says you have to find hosts who don’t all look the same. But you have to go beyond that too, and give them full ownership of the creative process. The writing, the editing, the style need to be informed culturally all the way through. For more tips on building community, check out YouTube Creator Academy and Hank’s YouTube Channel, Vlogbrothers. Full Article YouTube Diversity and Inclusion
building Infrared-reflecting paint can cool buildings even when it is black By www.newscientist.com Published On :: Fri, 24 Apr 2020 19:00:01 +0000 Black paint usually absorbs heat, but a new two-layer polymer paint reflects infrared light and keeps objects 16°C cooler, which could help make buildings more energy efficient Full Article
building Tiger survival threatened by mass road-building in precious habitats By www.newscientist.com Published On :: Wed, 29 Apr 2020 19:00:36 +0000 Over half the world’s wild tigers now live 5 kilometres from a road, and infrastructure projects planned in Asia could fragment their habitat further Full Article
building 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
building Building Redux Middleware By reactjsnews.com Published On :: Sun, 13 Mar 2016 23:00:09 +0000 After writing my post a few months ago on building your own redux app, I have been asked a couple times to write a guide on creating redux middleware and how it works. This will be a quick post on how you can acheive anything with your own middleware! ##Basic middleware const customMiddleware = store => next => action => { if(action.type !== 'custom') return next(action) //do stuff! } Applying it: import { createStore, applyMiddleware, } from 'redux' import reducer from './reducer' import customMiddleware from './customMiddleware' const store = createStore( reducer, applyMiddleware(customMiddleware) ) Whaaa? store => next => action => I know that looks confusing. Essentially you are building a chain of functions, it will look like this when it gets called: //next looks something like this: let dispatched = null let next = actionAttempt => dispatched = actionAttempt const dispatch = customMiddleware(store)(next) dispatch({ type: 'custom', value: 'test' }) All you are doing is chaining function calls and passing in the neccesary data. When I first saw this I was confused a little due to the long chain, but it made perfect sense after reading the article on writing redux tests. So now that we understand how those chained functions work, let’s explain the first line of our middleware. if(action.type !== 'custom') return next(action) There should be some way to tell what actions should go through your middleware. In this example, we are saying if the action’s type is not custom call next, which will pass it to any other middleware and then to the reducer. ##Doing Cool stuff The official guide on redux middleware covers a few examples on this, I’m going to try to explain it in a more simple way. Say we want an action like this: dispatch({ type: 'ajax', url: 'http://api.com', method: 'POST', body: state => ({ title: state.title description: state.description }), cb: response => console.log('finished!', response) }) We want this to do a post request, and then call the cb function. It would look something like this: import fetch from 'isomorphic-fetch' const ajaxMiddleware = store => next => action => { if(action.type !== 'ajax') return next(action) fetch(action.url, { method: action.method, body: JSON.stringify(action.body(store.getState())) }) .then(response => response.json()) .then(json => action.cb(json)) } It’s pretty simple really. You have access to every method redux offers in middleware. What if we wanted the cb function to have access to dispatching more actions? We could change that last line of the fetch function to this: .then(json => action.cb(json, store.dispatch)) Now in the callback, we can do: cb: (response, dispatch) => dispatch(newAction(response)) As you can see, middleware is very easy to write in redux. You can pass store state back to actions, and so much more. If you need any help or if I didn’t go into detail enough, feel free to leave a comment below! Full Article
building Bhutan building for new highs By www.fifa.com Published On :: Mon, 13 Apr 2020 07:30:00 GMT Full Article
building Fire in three-storey building in Palghar; one feared killed By www.mid-day.com Published On :: 14 Mar 2018 08:55:51 GMT Representation pic A massive fire broke out in a three-storey building in the Kasa area here in the wee hours today, the district rural police said. One person was feared dead, but there was no official confirmation yet, they said. The police received a call around 3.30 am about the blaze in the residential-cum-commercial building, located near a temple in the Kasa area of the Dahanu taluka. The building's ground floor and the first floor, which housed a provisions store and its godown, were completely gutted in the fire, the police said in a release issued here. However, residents of the four apartments on the building's second floor were evacuated, the police said, adding that one person was feared killed in the fire, but there was no official confirmation yet. Three fire engines were rushed to the spot. The flames were doused but the cooling work was still on, the police added. Catch up on all the latest Crime, National, International and Hatke news here. Also download the new mid-day Android and iOS apps to get latest updates This story has been sourced from a third party syndicated feed, agencies. Mid-day accepts no responsibility or liability for its dependability, trustworthiness, reliability and data of the text. Mid-day management/mid-day.com reserves the sole right to alter, delete or remove (without notice) the content in its absolute discretion for any reason whatsoever Full Article
building Mumbai worker falls off 20th floor of under-construction building, dies By www.mid-day.com Published On :: 10 Apr 2018 16:59:41 GMT Representational Image A 28-year-old labourer died after he fell off the 20th floor of an under-construction building in suburban Malad, police said on Tuesday. The incident occurred when Abu Tahir was doing a plastering work on the 20th floor of the high-rise in a Malwani area, said a police official. Tahir was rushed to a hospital by locals where doctors declared him brought dead. A case was registered under section 304 (A) (causing death due to negligence) against two persons for not ensuring the safety of the labourer, he said, adding that further investigation is on. Catch up on all the latest Crime, National, International and Hatke news here. Also download the new mid-day Android and iOS apps to get latest updates The inputs from agencies have been sourced from a third party syndicated feed. Mid-day accepts no responsibility or liability for its dependability, trustworthiness, reliability and data of the text Full Article
building Mumbai Crime: Human flesh pieces found in drain of Virar building By www.mid-day.com Published On :: 23 Jan 2019 01:38:07 GMT Hundreds of micro-pieces of human flesh were recovered from the blocked drainage of a housing society in Virar West on Tuesday morning. The matter came to light after the residents of Bachraj Paradise of Evershine Avenue complained of a choked drainage system and saw three pieces of human fingers floating in the drain, when it was opened for repair. However, the police are yet to trace the head and bones of the body, and the gender of the deceased is to be ascertained. The pieces have been sent to Forensic Science Laboratory in Kalina where "scientists will conduct a dactylography of the chopped fingers to ascertain its identity", said a source in the Palghar police station. (Dactylography is the scientific study of fingerprints to ascertain identity) "Prima facie probe indicates that the killer has cut the body of the victim into pieces and flushed these down the toilet. The gradual accumulation and decomposition of flesh choked the drainage," said Gaurav Singh, superintendent of police, Palghar district. A local resident, requesting anonymity, told mid-day that there had been a foul smell in the locality for 10 days. "We initially mistook it for the smell of an animal carcass from the nearby drain but we were shocked to see small pieces of human flesh floating in the drain when it was opened," the resident said. The government hospital in-charge Dr Rugved R Dudhat, who visited the spot along with a forensic team, too said that his team has mistaken the pieces of animal flesh. "The overall weight of these pieces could be nearly 40 kg," he said. The incident has terrorised locals but the police have said there's "nothing to fear as the local area is being properly scanned." Vijaykant Sagar, additional superintendent of police, Vasai division, said, "A case under section murder (302) and disappearance of evidence (201) has been registered at Arnala police station." "More of them will be taken out from the drain on Wednesday. We have called in a team of fire brigade on the spot," Jayant Bajbhale, Deputy SP said. Arnala police have recorded the statements of many people and the suspect has been detained, said the source. Catch up on all the latest Mumbai news, crime news, current affairs, and also a complete guide on Mumbai from food to things to do and events across the city here. Also download the new mid-day Android and iOS apps to get latest updates Full Article
building Mumbai: Fire breaks out in building in Mulund By www.mid-day.com Published On :: 31 Mar 2019 15:00:50 GMT According to reports, a fire broke out in a building in Mulund area in central Mumbai. The fire took place at Sheetal Chhaya building located at JN Nagar situated in Mulund. Three fire engines were immediately rushed to the spot. More details are awaited. On Friday, a massive fire had broken out in a mobile shop near Ghatkopar Railway Station. The incident occurred around 2.40 PM at Top Ten Mobile Shop, Near Ghatkopar Guest House, Opposite Platform no.1. Soon four fire engines and ambulances were rushed to the spot. Four fire tenders also deployed. As per the initial report, no casualties were reported in the incident. Also Read: Mumbai: Massive fire broke out in mobile shop in Ghatkopar, no casualties reported Catch up on all the latest Crime, National, International and Hatke news here. Also download the new mid-day Android and iOS apps to get latest updates Full Article
building Watch video: Fire breaks out at south Mumbai building, doused By www.mid-day.com Published On :: 20 Feb 2019 03:34:53 GMT A fire broke out at a building in South Mumbai in the wee hours of Wednesday and firefighters managed to douse the flames. No injuries or casualties have been reported in the fire. A blaze broke out at the Dharam Villa building situated on Bhulabhai Desai Marg at around midnight. The first call to the fire station was received at 12:36 am and eight fire tenders were rushed to the spot. According to fire officials, the level III fire was confined to doors, lift, and staircases on the fourth, fifth, seventh and eighth floor of the nine-floor building, which includes a basement. Fire breaks out at Dharam Villa building, a high-rise on Bhulabhai Desai Marg, #Mahalaxmi past mid-night. Eight fire engines have been rushed to the spot. #Fire fighting work is in progress. Cause of fire is yet to be ascertained. #Mumbai @mid_day pic.twitter.com/VOQm5lPvv0 — Diwakar Sharma (@DiwakarSharmaa) February 19, 2019 Mumbai: A level III fire has broken out in Dharam Villa building at Bhulabhai Desai Marg. 8 fire tenders are present at the spot. Fire fighting operation is underway. More details awaited. pic.twitter.com/fUA1OOtWd0 — ANI (@ANI) February 19, 2019 Catch up on all the latest Crime, National, International and Hatke news here. Also download the new mid-day Android and iOS apps to get latest updates This story has been sourced from a third party syndicated feed, agencies. Mid-day accepts no responsibility or liability for its dependability, trustworthiness, reliability and data of the text. Mid-day management/mid-day.com reserves the sole right to alter, delete or remove (without notice) the content in its absolute discretion for any reason whatsoever Full Article