amp

The Wolf, The Lamb, & The Cigar

I driving to meet a friend at the cigar shop when my stomach started grumbling. Which was odd since I had only eaten dinner an hour before – a healthy meal of baked chicken, brown rice and a gigantic salad. But since I had done an hour of fairly intense cardio after work, I figured […]

The post The Wolf, The Lamb, & The Cigar appeared first on Waiter Rant.




amp

Andre Harrell, founder of influential R&B label Uptown Records, dies aged 59

Harrell launched the careers of 90s R&B megastars Mary J Blige and Jodeci on his Bad Boy label with the Notorious BIG

Andre Harrell, founder of the influential R&B and hip-hop label Uptown Records, has died. He was 59. The cause of Harrell’s death, which was announced early on Saturday by DJ D-Nice and confirmed by media outlets, was not immediately known.

Harrell started out as half of the early-80s hip-hop duo Dr Jekyll and Mr Hyde but was best known for schooling an intern, Sean “Puff Daddy” Combs, in the music business.

Continue reading...




amp

Biden's lead over Trump widens – but strain on his virtual campaign grows

Coronavirus has robbed the Democrat of his typical back-slapping approach as he faces growing scrutiny and a third-party challenge

The Tampa, Florida, rally for Joe Biden on Thursday evening began as it normally might have, before a once-in-a-century pandemic transformed all aspects of American life, including the presidential campaign. A local high school student recited the pledge of allegiance, a campaign organizer pleaded with supporters to volunteer and a local DJ spun R&B music between speakers.

But in a sign of how profoundly the coronavirus crisis has reshaped American politics, that was where the similarities ended.

Continue reading...




amp

Berger & Wyse on flatulence in the solar system – cartoon

Continue reading...



  • Life and style

amp

the Vamps childhood experience

did yall ever watch hello kitty's furry tale theater??? just me???

also frog and toad... yes

the super mario bros super show was another good one.

what did yall watch?




amp

Bungo & Alchemist Anime's Episodes 5-7 Scheduled for Later This Month

Episode 4 was previously delayed to May 8








amp

Pocket-sized device tests DNA in blood samples for genetic conditions

A cheap, lightweight smartphone-heated device can test for DNA in blood, urine and other samples in a fraction of the time it takes to test in a lab




amp

We can't rely on rampant consumerism to get us out of this mess

Hyperconsumption adds to environmental destruction that brings people into contact with animal viruses that can spark pandemics. We have to avoid the temptation to rely on it to get us out, writes Graham Lawton




amp

Vampire bats practise social distancing when they feel ill

Vampire bats are social creatures that build relationships through grooming and food-sharing, but when they feel ill, they self-isolate and call out for contact far less




amp

'Amazingly good news': New York healthcare workers not testing positive for coronavirus at higher rate than general public

New York has released more details into who has tested positive for the coronavirus in the state, and Governor Andrew Cuomo said the per cent of healthcare workers with Covid-19 is not higher than the general public.“That is amazingly good news,” Mr Cuomo said during his press briefing on Thursday.





amp

White men accused of killing Ahmaud Arbery won't face Georgia hate crime charges. Here's why.

Gregory and Travis McMichael, who are accused of fatally shooting Ahmaud Arbery, a black man, will not face hate crime charges. Here's why.





amp

Sen. Joe Manchin forgot to mute a call with Senate Democrats while he went through an Arby's drive-through

Contrary to popular belief, people do order fish sandwiches at Arby's.Senate Democrats recently learned one of their own is among that rare crowd when Sen. Joe Manchin (D-W.V.) forgot to hit mute when driving through an Arby's drive-through last month. Manchin pulled up to the fast food spot in his home state, asked for a King’s Hawaiian Fish Deluxe sandwich, and later learned his mistake after staffers texted him, he tells The Wall Street Journal."It's a big piece of fish and it has a big slice of cheese," Manchin described to the Journal. "They were just jealous they weren't getting the good sandwich." Manchin himself may be jealous that unlike West Virginia Gov. Jim Justice, he doesn't have a sandwich named after him at his local Arby's.Manchin is far from the only lawmaker who's been "busted," as he put it, for forgetting to hit mute. Rep. Jamie Raskin (D-Md.) says his children have repeatedly walked by and told him to "tell [House] Speaker [Nancy] Pelosi to say now is the time to start forgiving student loans." Several described overhearing "colleagues exercising on ellipticals, doing sit-ups, dealing with children, or taking other phone calls," they tell the Journal. And many of them have admittedly skipped showers on days they know they don't have to be on camera. Read more about congressmembers' at-home habits at The Wall Street Journal.More stories from theweek.com The full-spectrum failure of the Trump revolution Unemployment is a catastrophe — but it could still be worse Trump reportedly got 'lava level mad' over potential exposure to coronavirus





amp

One of world's oldest men marks 116th birthday in South Africa

South African Fredie Blom celebrated his 116th birthday on Friday unfazed by the coronavirus crisis, over 100 years since the Spanish flu pandemic killed his sister. "I have lived this long because of God's grace," said Blom, possibly one of the oldest men in the world. Lighting a cigarette, he recalled the 1918 pandemic that left tens of millions dead worldwide including his sister.





amp

You Touch Public Surfaces All Day. Here's How to Stay Safe From Coronavirus.

From the moment COVID-19 started spreading in the U.S., you probably heard recommendations to wash your hands after contact with what are called high-touch surfaces: elevator buttons, public fauc...





amp

DNA samples lead to arrest in 1987 murder of 17-year-old Ohio girl: 'Great to see justice'

Using DNA to track down 67-year-old James E. Zastawnik, police made an arrest in the 1987 murder of an Ohio girl.





amp

Was the coronavirus made in a Wuhan lab? Here's what the genetic evidence shows

Despite President Trump's statements that the coronavirus was released from a laboratory in Wuhan, scientist say the evidence points to a natural origin.





amp

Idaho governor appeals to Supreme Court to stop trans inmate's surgery

A lower court had ruled that the prisoner’s gender-affirming surgery is a medical necessity, and denying it constituted a violation of the Eighth Amendment.





amp

Missing Idaho kids' uncle died of blood clot in Arizona

A pulmonary blood clot killed the brother of an Idaho woman who’s facing charges in the disappearance of her children — a case that attracted worldwide attention with revelations of her doomsday beliefs and connection to three mysterious deaths. Autopsy and toxicology reports were released Friday for Alex Cox, who died in Arizona in December. In July, Cox fatally shot his sister’s estranged husband, Charles Vallow, in what he said was self-defense.





amp

Biden's lead over Trump widens – but strain on his virtual campaign grows

Coronavirus has robbed the Democrat of his typical back-slapping approach as he faces growing scrutiny and a third-party challengeThe Tampa, Florida, rally for Joe Biden on Thursday evening began as it normally might have, before a once-in-a-century pandemic transformed all aspects of American life, including the presidential campaign. A local high school student recited the pledge of allegiance, a campaign organizer pleaded with supporters to volunteer and a local DJ spun R&B music between speakers.But in a sign of how profoundly the coronavirus crisis has reshaped American politics, that was where the similarities ended.With much of the US still in lockdown, the presumptive Democratic presidential nominee has been forced to take his campaign to unseat Donald Trump online. It has not always been easy.His campaign’s first attempt to recreate a traditional rally – part of a virtual swing through the battleground state of Florida – was later described by his opponents as an “unmitigated technological failure”. The video stream was glitchy and pixelated. The audio was choppy, rendering some remarks nearly incomprehensible. And there were lengthy delays between speakers and at one point, the feed went dark for several minutes.“Am I on?” asked Biden, beaming into the telecast from his home in Wilmington, Delaware, where he has been isolated since the middle of March. An off-camera voice replied that he was. Biden removed a pair of aviator sunglasses as he walked toward the camera.“Good evening, Tampa. Thanks so much for tuning in,” he continued, a hint of irritation in his voice. “I wish we could have done this together – and it had gone a little more smoothly.”For nearly two months, Biden has been the test subject in a novel political experiment: running for president in the age of Covid-19.Social distancing restrictions imposed to stop the spread of the virus have already starved the campaign of a victory tour to mark his ascent to the Democratic nomination. It may well deny Democrats the chance to formally nominate him in person at the party’s national convention this summer. Endorsements from former rivals and party leaders occur online to varying degrees of fanfare. . The remote set-up, anathema to Biden’s back-slapping, glad-handing approach to politics, has left the candidate walled off from voters and competing for visibility.Yet, technical difficulties aside, his campaign of confinement seems to be working.In recent weeks, Biden has widened his lead over Trump as the president’s support slips amid growing disapproval of his response to the pandemic. Surveys from Pennsylvania, Michigan, Wisconsin, Florida, North Carolina and Arizona – key battlegrounds that Trump won in 2016 – show Biden ahead. At a recent virtual fundraiser last week, Jennifer O’Malley Dillon, his new campaign manager, expressed optimism about Biden’s prospects in Florida and Arizona.“The natural state of this race is to be a referendum on Donald Trump and every time Donald Trump steps to the microphone he hurts himself,” said Mark Mellman, a veteran Democratic pollster. “That’s a pretty good position for Joe Biden to be in.”Biden initially struggled to adapt to his cloistered reality. In March, the campaign turned a recreation room in the basement of his home into a studio, though not fast enough for his critics, who launched a “Where’s Joe” campaign to mark the candidate’s relative disappearance from the national stage.But since then, Biden has been busy. Nearly every day he makes appearances on local TV news channels or national talkshows. He launched a podcast, where he has hosted conversations with prominent Democratic governors and potential vice-presidential candidates. He spends time each day speaking with a voter – a frontline worker, campaign volunteers – and he participated in what the campaign billed as a “virtual rope line”.“So what’s up?” he said to Ashley Ruiz of Fort Lauderdale, Florida, one of several voters on the rope line. “Tell me about your situation, Ash.”•••Biden’s rise in the polls comes as he contends with an allegation from Tara Reade, a former aide in his Senate office who accused him of sexual assault in 1993. In an interview this week with Megyn Kelly, the former Fox News and NBC television host, Reade said he should withdraw from the presidential race.Biden has forcefully denied the allegation. “It’s not true, I am saying unequivocally. It never, never happened,” he said last week, in an interview addressing her claim for the first time publicly.Publicly, Democrats, including prominent MeToo advocates, have rallied around Biden, though privately some in the party have expressed concern about the continuous drip of reporting on the matter.So far the allegation appears to have marginally dented his reputation, but not his lead. Most voters – 86% – are aware of the allegation, according to a Monmouth poll, which found the electorate divided over whether they viewed the claim as credible. At the same time, the poll showed Biden nine points ahead of Trump.Despite Trump’s falling electoral fortunes, many Democrats remain anxious about Biden’s position – and his strategy.David Axelrod and David Plouffe, two of Barack Obama’s top campaign strategists, implored Biden’s campaign to expand its digital footprint in a joint New York Times op-ed that compared the atmospherics of the candidate’s home videos to “an astronaut beaming back to earth from the International Space Station”.“Online speeches from his basement won’t cut it,” they wrote.Lis Smith, the former top adviser to Pete Buttigieg’s presidential campaign, followed with an op-ed on Thursday that offered a blueprint for turning Biden into the “hottest bad boy and disrupter in the media game”. She suggested his campaign use TV appearances and digital content to highlight Biden’s empathy, a trait even supporters say the president has lacked in response to the rising coronavirus death toll.Part of the campaign’s evolving digital strategy includes partnering with groups that already have an online presence, like JoeMamas2020, a national coalition of “moms, caregivers, moms to be, aunts & all the parental figures in between” with about 27,000 Facebook and 1,200 Twitter followers. The group has helped amplify Biden’s appearances and policy proposals while spreading the word about upcoming events.Julie Zebrak, the group’s co-founder, said the online army is growing with women energized to help elect a candidate who would end the Twitter presidency.“We are all extremely enthusiastic for Joe Biden to beat Donald Trump,” she said.Yet the same traits that endear Biden to a growing coalition of suburban women and Never Trump Republicans have largely failed to excite younger, progressive voters. It’s not that they prefer Trump – they don’t – but a lack of enthusiasm among those voters could spell trouble in November if they stay home or vote for a third-party candidate.The campaign has also ramped up its outreach to young people, who overwhelmingly supported Biden’s rival Bernie Sanders. On Friday, Biden presented his economic pitch in an appearance on NowThis, a social-media-heavy news outlet with a young, progressive audience.“This crisis hit harder and will last longer because Donald Trump spent the last three years undermining the core pillars of our economic strength,” Biden said in remarks that attacked Trump’s stimulus efforts a kind of “cronyism” and corporate welfare. Before he began speaking, Biden removed a face mask, a pointed rebuke of the president who had refused to wear one.Still, new research conducted on behalf of NextGen America found many young people weren’t convinced Biden’s policies meet the scale of the challenges bearing down on their generation.This makes the efforts of groups like Progressive Turnout Project, which endorsed him this week, all the more important. In the coming months, the group is investing more than $52m to turn out low-propensity Democratic voters – including young people and people of color – in 17 key battleground states.“The best thing we can do is go and knock on doors and have face-to-face conversations with voters,” said Alex Morgan, the group’s executive director. “We are still looking to do that. But it’ll be knocking on that door and then taking a few big steps back and having a more distant conversation.”•••Biden’s campaign also faces another looming threat. The Michigan congressman Justin Amash, who left the Republican party last year after voting to impeach Trump, recently announced that he would seek the Libertarian party nomination.His entrance has alarmed Democrats, who fear he could siphon off Never Trump voters who might otherwise back Biden, particularly in Amash’s home state of Michigan, where third-party candidates pulled away a combined 5% of the vote share in 2016. Hillary Clinton lost the state by just 10,704 votes, less than 0.25%.Many Democrats believe Biden’s fate may well rest on his ability to persuade their own side to vote.“Trump has shown no desire or ability to moderate for those swing voters in this election,” said Addisu Demissie, who served as Cory Booker’s presidential campaign manager. “So those voters are now likely going to end up either Biden voters or non-voters or third-party voters, and that’s the competition.”This week, Trump traveled to the battleground state of Arizona, where he toured a medical mask facility without wearing one himself. The visit was a symbolic show of his administration’s push to reopen the US economy but there were unmistakable elements of his signature campaign rallies, including the music that played when Trump finished his remarks (the Rolling Stones’ You Can’t Always Get What You Want).Trump’s cross-country venture stood in striking contrast to Biden’s virtual swing through Florida – which included a rally, a roundtable in Jacksonville and an appearance on the local news in Tampa. The technical glitches only further highlighted the limitations of his confinement.But the coronavirus has also upended Trump’s strategy, erasing the booming economy he has made a centerpiece of his re-election campaign. In recent weeks, his campaign has all but abandoned championing the president’s leadership, instead focusing its efforts on diminishing Biden.Trump’s campaign manager, Brad Parscale, previewed the onslaught on Twitter this week, comparing the Trump re-election juggernaut to the Death Star from the Star Wars movies. “In a few days we start pressing FIRE for the first time,” he wrote.As Trump prepares to make even greater use of the advantages of incumbency, Biden faces his biggest test yet. Can he really lead a Rebel Alliance from his basement?





amp

Woman heartbroken by Smithfield Foods' response to grandfather's death from coronavirus

“I want you to know he died in the hospital alone, isolated, and scared,” she wrote in an Instagram message to Smithfield Foods.





amp

The 'mind-blowing' story of the ex-Green Beret who tried to oust Venezuela's Maduro

Jordan Goudreau once pushed a plan to protect U.S. schools. Then he moved on to a more daring pursuit, which also didn't end well.





amp

A 1996 court declaration written by Tara Reade's ex-husband shows she spoke of harassment in Biden's Senate office

"It was obvious that this event had a very traumatic effect on (Reade), and that she is still sensitive and effected (sic) by it today," Dronen wrote.





amp

Airline middle seats won't stay empty forever in the name of social distancing. Here's why

Permanently blocking middle seats and limiting the number of passengers per flight is a costly move for airlines and would increase ticket prices.





amp

'Never Seen Anything Like This': Experts Question Dropping of Flynn Prosecution

WASHINGTON -- The Justice Department's decision to drop the criminal case against Michael Flynn, President Donald Trump's former national security adviser, even though he had twice pleaded guilty to lying to investigators, was extraordinary and had no obvious precedent, a range of criminal law specialists said Thursday."I've been practicing for more time than I care to admit and I've never seen anything like this," said Julie O'Sullivan, a former federal prosecutor who now teaches criminal law at Georgetown University.The move is the latest in a series that the department, under Attorney General William Barr, has taken to undermine and dismantle the work of the investigators and prosecutors who scrutinized Russia's 2016 election interference operation and its links to people associated with the Trump campaign.The case against Flynn for lying to the FBI about his conversations with the Russian ambassador was brought by the office of the former special counsel, Robert Mueller. It had become a political cause for Trump and his supporters, and the president had signaled that he was considering a pardon once Flynn was sentenced. But Barr instead abruptly short-circuited the case.On Thursday, Timothy Shea, the interim U.S. attorney in the District of Columbia, told the judge overseeing the case, Emmet G. Sullivan, that prosecutors were withdrawing the case. They were doing so, he said, because the department could not prove to a jury that Flynn's admitted lies to the FBI about his conversations with the ambassador were "material" ones.The move essentially erases Flynn's guilty pleas. Because he was never sentenced and the government is unwilling to pursue the matter further, the prosecution is virtually certain to end, although the judge must still decide whether to grant the department's request to dismiss it "with prejudice," meaning it could not be refiled in the future.A range of former prosecutors struggled to point to any previous instance in which the Justice Department had abandoned its own case after obtaining a guilty plea. They portrayed the justification Shea pointed to -- that it would be difficult to prove to a jury beyond a reasonable doubt that the lies were material -- as dubious."A pardon would have been a lot more honest," said Samuel Buell, a former federal prosecutor who now teaches criminal law at Duke University.The law regarding what counts as "material" is extremely forgiving to the government, Buell added. The idea is that law enforcement is permitted to pursue possible theories of criminality and to interview people without having firmly established that there was a crime first.James G. McGovern, a defense lawyer at Hogan Lovells and a former federal prosecutor, said juries rarely bought a defendant's argument that a lie did not involve a material fact."If you are arguing 'materiality,' you usually lose, because there is a tacit admission that what you said was untrue, so you lose the jury," he said.No career prosecutors signed the motion. Shea is a former close aide to Barr. In January, Barr installed him as the top prosecutor in the district that encompasses the nation's capital after maneuvering out the Senate-confirmed former top prosecutor in that office, Jessie K. Liu.Soon after, in an extraordinary move, four prosecutors in the office abruptly quit the case against Trump's longtime friend Roger Stone. They did so after senior Justice Department officials intervened to recommend a more lenient prison term than standard sentencing guidelines called for in the crimes Stone was convicted of committing -- including witness intimidation and perjury -- to conceal Trump campaign interactions with WikiLeaks.It soon emerged that Barr had also appointed an outside prosecutor, Jeff Jensen, the U.S. attorney in St. Louis, to review the Flynn case files. The department then began turning over FBI documents showing internal deliberations about questioning Flynn, like what warnings to give -- even though such files are usually not provided to the defense.Flynn's defense team has mined such files for ammunition to portray the FBI as running amok in its decision to question Flynn in the first place. The questioning focused on his conversations during the transition after the 2016 election with the Russian ambassador about the Obama administration's imposition of sanctions on Russia for its interference in the American election.The FBI had already concluded that there was no evidence that Flynn, a former Trump campaign adviser, had personally conspired with Russia about the election, and it had decided to close out the counterintelligence investigation into him. Then questions arose about whether and why Flynn had lied to administration colleagues like Vice President Mike Pence about his conversations with the ambassador.Because the counterintelligence investigation was still open, the bureau used it as a basis to question Flynn about the conversations and decided not to warn him at its onset that it would be a crime to lie. Notes from Bill Priestap, then the head of the FBI's counterintelligence division, show that he wrote at one point about the planned interview: "What's our goal? Truth/admission or to get him to lie, so we can prosecute him or get him fired?"Barr has also appointed another outside prosecutor, John H. Durham, the U.S. attorney in Connecticut, to reinvestigate the Russia investigators even though the department's independent inspector general was already scrutinizing them.And his department has intervened in a range of other ways, from seeking more comfortable prison accommodations last year for Paul Manafort, Trump's former campaign chairman, to abruptly dropping charges in March against two Russian shell companies that were about to go to trial for financing schemes to interfere in the 2016 election using social media.Barr has let it be known that he does not think the FBI ever had an adequate legal basis to open its Russia investigation in the first place, contrary to the judgment of the Justice Department's inspector general.In an interview on CBS News on Thursday, Barr defended the dropping of the charges against Flynn on the grounds that the FBI "did not have a basis for a counterintelligence investigation against Flynn at that stage."Anne Milgram, a former federal prosecutor and former New Jersey attorney general who teaches criminal law at New York University, defended the FBI's decision to question Flynn in January 2017. She said that much was still a mystery about the Russian election interference operation at the time and that Flynn's lying to the vice president about his postelection interactions with a high-ranking Russian raised new questions.But, she argued, the more important frame for assessing the dropping of the case was to recognize how it fit into the larger pattern of the Barr-era department "undercutting the law enforcement officials and prosecutors who investigated the 2016 election and its aftermath," which she likened to "eating the Justice Department from the inside out."This article originally appeared in The New York Times.(C) 2020 The New York Times Company





amp

Trump calls Ahmaud Arbery killing 'very disturbing' but says he trusts Georgia justice

President Trump said he had watched the video of Ahmaud Arbery being shot and found it “heartbreaking,” but he has confidence in the Georgia legal system.





amp

Anti-abortion campaigner loses Stella Creasy poster ban appeal

A judge dismisses Christian Hacking's bid to overturn a ban on posters put up around Waltham Forest.




amp

Met Police end probe into pro-Brexit campaigners

Leave campaigners were accused by the Electoral Commission of breaking the law over spending limits.




amp

Coronavirus: 'My parents' campervan has become my office'

A marketing manager explains why she turned a campervan into her office during coronavirus.




amp

React Router & Webpack in Production

I’ve been working on a pretty large react-router codebase at work. Currently it has around 50~ code splits, which as you can imagine, is a lot of routes. This is going to be a post on the things I’ve learned throughout building out my development / production config and how we are using webpack in production.

###Initial Setup

Before I really dive into how my webpack config is setup and the problems I’ve found, I’ll quickly go over how this app is setup. Currently, there’s one entry point and it looks like this:

import React from 'react'
import { render } from 'react-dom'
import { match, Router, browserHistory } from 'react-router'
import AsyncProps from 'async-props'
import routes from '../routes/index'
/* globals document, window */

const { pathname, search, hash } = window.location
const location = `${pathname}${search}${hash}`

match({ routes, location }, () => {
  render(
    <Router
      render={props => <AsyncProps {...props}/>}
      routes={routes}
      history={browserHistory}
    />,
    document.getElementById('app')
  )
})

It looks like a standard react-router setup, except a couple things are different. For one, there’s way too many routes to have them all in this file, so we are importing the main route object into this file. Second, we are using match on the client side. Without matching first, the client side would try to render before the splits were downloaded causing an error. You can read a little more about match on the client here.

Next, we are using Ryan Florence’s awesome async-props library for loading data into components. It allows me to load data from an api before the server renders components. It will pass the data down to the client for the client-side render, and then data will load as you navigate to new pages automatically.

###Routes

Our main routes file looks like this:


export default {
  component: 'div',
  path: '/',
  indexRoute: require('./index'),
  childRoutes: [
    require('./login'),
    require('./account'),
    ...
  ]
}

There’s a lot more require’s in our app of course. And these are nested pretty deep. The files referenced in the root file have more child routes, and those use require.ensure which you can read about in the webpack docs on code splitting. It tells webpack to make a new bundle, and then load that bundle when require.ensure is called on the client. Here’s an example:

if(typeof require.ensure !== "function") require.ensure = function(d, c) { c(require) }

module.exports = {
  path: 'account',
  getComponent(location, cb) {
    require.ensure([], (require) => {
      cb(null, require('../../views/master/index.jsx'))
    })
  },
  childRoutes: [
    require('./settings'),
  ]
}

There’s a few things going on here. First, we have a function at the top that will polyfill require.ensure. Why? Well, on this project we are server rendering our whole site as well, which I would rather not do, but due to the type of site we are building: we have to. The next thing is the relative require path. I’m using this awesome babel resolver plugin along with webpack’s resolve paths so that I can import files like this:

import Header from '../../master/header'
//becomes
import Header from 'master/header'

Why do I have to use a babel plugin AND webpack’s resolve feature? Once again, doing a server rendered app, the code is ran on the server and also through webpack. In this particular app, I haven’t had time to experiment with webpacking the server. Anyways, if I didn’t use the babel plugin, errors would be thrown on the server, but webpack would work fine. This is one of the common things I have ran into while building this app.

Realizing some things need to be done slightly different on the server or client. You may still be wondering why I am referencing the component as a relative path in the above route example, and that’s because the babel plugin I’m using only works with import and not require. My route objects are the one place that I have these “nasty” looking paths.

##Webpack

I was prompted to make this article after tweeting this out:

A couple people wanted a better explanation as to what’s happening here. When I was first building my production webpack config, even after using all of these plugins:

new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
  compress: { warnings: false },
  comments: false,
  sourceMap: false,
  mangle: true,
  minimize: true
}),

My bundle looked like this:

That’s pretty huge if you think about it. And I’m not talking about the amount of bundles. I’m talking about the file size. After searching everywhere for a solution to get the bundle size down further, I found webpack’s AggressiveMergingPlugin. This thing is a life saver. As you may have seen from the tweet, the output turns into this:

Just having the main, vendor, and one other bundle brings the whole site under 1MB. I’m using the plugin to only merge files if the size reduction is more than 50%, which is the default.

People talk about code splitting in webpack and think it’s really amazing to load the JS for the page you’re on and nothing more. It sounds great. The problem is that the file size is immensely bigger. If someone more familiar with webpack has a better idea as to why this is, I’d like a better explanation. It isn’t feasable to keep the splits instead of merging them. This site is pretty large, with a lot of routes as you can tell from the screenshots. Codesplitting without merging would cause way more waiting on the client side every time you navigate to a new page. Even if the JS was heavily cached, the first time you hit these pages it will have to load a 300kb bundle for some of them.

##Caching

That takes us to caching. We are about a month away from publicly launching this site, so we haven’t setup the workflow for pushing updates through a cdn, but that will be the end result. For now, in my webpack config, my output object looks like this:

output: {
  path: __dirname + '/public/assets/js/[hash]/',
  filename: '[name].js',
  chunkFilename: '[id].js',
  publicPath: '/assets/js/[hash]/'
},

This is in the production config of course. This way I can cache the files and when I update the code, the hash will change and the browser won’t be caching the old code. I pass in the hash as an env variable at runtime to that the server has the correct path to the assets folder.

##Problems

There were a few big problems I came across while building out a server rendered app with dynamic routes. The first was page titles. How am I supposed to have the right title on the client and on the initial server render? Thankfully, Ryan has yet another solution. react-title-component solves this perfectly.

The next was, how do I hit an api, wait for the response on server render, load new data on route changes, and of course, do this at the component level. As I mentioned before, async-props solves this problem too. It will give you route info so that you can make requests based on things in the url.

The next problem is one that I haven’t fully solved. Webpack is getting really slow. It takes around 20 seconds on a maxed out macbook 15” to build code in production. On the server, it takes more like a minute! If I’m in development mode, it takes around 10 seconds to make the initial build, and sometimes it lags on building the splits on code change. If anyone has insight into this I would love to hear it.

This one goes along with the webpack one, and it is reloading the server. I haven’t tried to webpack the server but I hear doing so works great for this. I don’t think it would fix the problem with webpack being slow though, and in fact it would probably make it even slower.

##Folder structure

I almost forgot to throw this one in here! I’m really happy with the structure of this project. I have a views folder that has all of the same folders and file names as the routes folder. It makes it really easy to find things. These also correspond with the URL to the page. /account/settings will be in views/account/settings.jsx and routes/account/settings.js. The same is true for my tests folder.

##Conclusion

I hope this gave you a good glimpse at how webpack and react router work at a larger scale than you see most blog posts cover. If you have any questions or things that you would like me to talk about that I haven’t already, please leave a comment below and I will update this post! I’m sure that I forgot a few problems and tips writing this. I was thinking this would be a short post but it blew up on me!




amp

2000 FIFA Club World Championship: Corinthians 0-0 Vasco da Gama (4-3 PSO)

Corinthians-Vasco da Gama, FIFA Club World Cup Brazil 2000 Final: The all-Brazilian final had a plethora of familiar names - including legend Romario, Edmundo, Gilberto Melo, Ricardinho and Dida - and ended in a dramatic penalty shootout.




amp

FIFA President Gianni Infantino delivers the champion trophy

KOLKATA, INDIA - OCTOBER 28: FIFA President Gianni Infantino delivers the champion trophy to the captain Angel Gomes of England after the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Buda Mendes - FIFA/FIFA via Getty Images)




amp

FIFA President Gianni Infantino delivers the champion trophy

KOLKATA, INDIA - OCTOBER 28: FIFA President Gianni Infantino delivers the champion trophy to the captain Angel Gomes of England after the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Buda Mendes - FIFA/FIFA via Getty Images)




amp

FIFA President Gianni Infantino delivers the champion trophy to the captain Angel Gomes of England

KOLKATA, INDIA - OCTOBER 28: FIFA President Gianni Infantino delivers the champion trophy to the captain Angel Gomes of England after the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Jan Kruger - FIFA/FIFA via Getty Images)




amp

Rhian Brewster of England poses with Sol Campbell

KOLKATA, INDIA - OCTOBER 28: Rhian Brewster of England poses with Sol Campbell after victory during the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Jan Kruger - FIFA/FIFA via Getty Images)




amp

Rampant Argentina advance to final

Perennial tournament participants Argentina reached their first-ever Futsal World Cup final by beating Portugal 5-2 in the semi-finals of the FIFA Futsal World Cup Colombia 2016.




amp

Solomons stamp ticket to Lithuania




amp

Vaporaki: World Champions badge brings great responsibility

Vaporaki: the badge of world champion brings great responsibility




amp

New FIFA Club World Cup™ champions to be crowned at Khalifa International Stadium




amp

Hosts take on Oceania champions in curtain-raiser




amp

Carrillo: We’ll play with the same determination as the Champions League




amp

Champions versus aspirants for a place in the final




amp

Goa: Sun, Sand, Sea & Football

Football fans turned out in huge numbers in Goa. Relive the best of the FIFA U17 World Cup action.




amp

Brazil, Spain, England & Mali seal Semi-Final berths

Revisit the best action from Quarter-Finals stage at the FIFA U-17 World Cup.




amp

England: U-17 World Champions

What a remarkable turnaround it was by the Three Lions in Kolkata! England clinched their maiden FIFA U-17 world title, beating Spain comprehensively. Catch all the glimpses of England's historic win and the celebrations that followed.