Subscribe

From Record Bankruptcies to Walmart's E-Commerce Leaps, the Year In Retail

Getty Images

For the retail sector, it’s been the best of times and it’s been the worst of times this year.

The year 2017 will go down as one of the most brutal in the industry’s history in terms of bankruptcy filings and store closings (8,000 across various national chains.) Major retailers such as Toys R Us, The Limited and Hhgregg filed for Chapter 11 bankruptcy, their financials unable to withstand declining sales and heavy debt loads. (Some, like Hhgregg liquidated, while others hope to re-emerge as leaner companies.)

And many other chains closed enormous numbers of stores, including J.C. Penney jcp , Macy’s m , Sears Holdings shld and even Michael Kors. kors to “rightsize” their fleets in reaction to weaker sales and the shift of much of their business online.

More from FORTUNE

But for all the talk of deep, chronic deep malaise in the sector, this is hardly the retail apocalypse described in countless headlines. Indeed, there have been plenty of reasons to be optimistic, especially with the strong end to the year.

Retailers as disparate as Dollar General dg and Neiman Marcus, not to mention giants like Walmart wmt , Home Depot and Costco Wholesale, have been reporting strong sales gains, showing that they are adapting to the era of Amazon.com amzn and in many cases, successfully reinventing themselves.

Walmart has proven itself to be a formidable competitor to Amazon, Target’s new private label clothing brands have quickly won over customers, and even apparel retailers like Gap Inc gps and Abercrombie & Fitch anf seem just about poised to end years of weak business at their respective flagship brands.

To be sure, stores have been enjoying a perfect storm of conditions conducive to consumer spending, with unemployment at multi-year lows and wages finally starting to rise. And expect a certain number of retail bankruptcies next year. But on the whole, 2017 may prove to be the year retail finally finished its shakeout and showed it could adapt to its new reality.

Here is a look back at some of the big retail stories of the last year.

1) Store Closings Galore

On the heels of a weak 2016 holiday season, J.C. Penney jcp , Macy’s m and Sears Holdings shld , announced store closings by the dozen, in a harbinger for the ongoing unwinding of a wild retail expansion in the 1990s and 2000s. And don’t expect store closings to abate much: retail square footage per capita in the U.S. remains far greater than what it is in other markets like Canada and Britain. By some counts, 8,000 stores run by national chains have closed this year, a record. America is still “overstored” and in a big way.

2) Walmart Emerges As a Real Amazon Counterweight

It didn’t take long for Walmart’s wmt 2016 $3 billion acquisition of Jet.com to re-energize its slumbering dot com operations. In 2017, Walmart snapped up brands like Bonobos, Modcloth, and Moosejaw; enjoyed the benefits of a vastly expanded online marketplace; and struck innovative deals such as hosting an online store for HBC’s hbc Lord & Taylor department store chain. The result has been outsized growth and proof to the market that Amazon won’t necessarily run away with the e-commerce prize.

3) Big Bankruptcies

One after the next, household retailer names sought Chapter 11 bankruptcy protection to try to get out of leases and fix their debt-laden finances this year: The Limited, Radio Shack, Gymboree, Wet Seal, Rue 21, Payless ShoeSource, Gander Mountain and of course Toys R Us, among many others. Many of these bankruptcies were a long time coming, the result of lower interest rates that allowed retailers and the creditors to kick the can down the road. But at one point, with sales declines too acute, the day of reckoning comes, as these chains have discovered and as others will undoubtedly discover in 2018 and 2019.

4) Getting Into Bed With Amazon

After years of Amazon.com amzn being seen as retail’s Public Enemy No. 1, the online giant became a surprising new partner to a number of brands. Most notably, Kohl’s is testing handling Amazon returns at 82 stores and is opening mini-shops at some locations, while Nike nke is overcoming its aversion by selling a small assortment directly via Amazon. And PVH’s Calvin Klein brand decided for the first time to bypass department stores and go straight to Amazon for some new merchandise this year. Best Buy has also been giving Amazon more space in its stores for its rival’s smart home products.

5) Amazon’s Acquisition of Whole Foods

Few things shook up with world of grocery retail more than Amazon’s $13 billion acquisition of Whole Foods this year. The move sent shockwaves in the c-suites of everyone from Walmart to Kroger to Target and set off a price war. The big deal also prompted Amazon rivals to redouble their efforts to beef up their delivery and order pickup firepower and led to a slew of deals including Target’s $550 million acquisition of Shipt. And as if that weren’t enough, German deep discount grocer Lidl opened its first U.S. stores, while Aldi overhauled many of its existing stores, signaling that the grocery price war won’t be over any time soon.

6) Department Store Woes Continue

Despite a lot of wind in retail’s sails, department stores proved to be the weakest spot in the sector. Macy’s comparable sales kept declining even as it took steps such as relaunching its loyalty program, while JC Penney struggled to keep its head above water, with many of its initiatives falling flat. Even on the high end, the format struggled: Neiman Marcus finally shook a long losing streak in the autumn, while Nordstrom continued to see soft business at its full-service department stores.

7) Changes in the Corner Office

The big CEO changes were at Macy’s where longtime executive Jeff Gennette took the reins from Terry Lundgren, while Barnes & Noble, Tiffany & Co, and Ralph Lauren also brought in new chief executives after each company experienced some drama. Kohl’s announced the departure of veteran CEO Kevin Mansell next year, to be replaced by chief merchant and customer officer Michelle Gass. All these executives face the same challenge: how to give their chains new relevance in a radically different retail environment.

8) Some Green Shoots for Apparel Chains

While the travails of J.Crew grabbed many headlines, some of its peers showed that apparel retailers can start to get back on track. Gap Inc gps return to comparable sales growth is due to Old Navy but its namesake brand is showing signs of life again. And over at Abercrombie & Fitch, Hollister is cruising along and beginning to take A&F with it for the ride. Both chains are benefiting from faster and nimbler production times as they chase Zara, Uniqlo and H&M.

Outbrain

More from FORTUNE