Photo: Maya Robinson and Photos by Justin Lubin/NBC and ABC/Getty

“Abed, stop being meta! Why do you always have to take whatever happens to us and shove it up its own ass?”

Community has been on the chopping block since its first season. (“We call that Wednesday,” Dean Pelton might say.) Its small but fervid cult following can’t compensate for the alleged mammoth budget or the certifiably miniscule viewership, series creator Dan Harmon’s alleged difficulty, or Chevy Chase’s certifiable difficulty. But it returns, doggedly, season after season. NBC fired Harmon, only to bring him back a season later. Then NBC dumped the show, only for Yahoo to swoop in and save it, promising no diminished budget and no creative constraints. (The sixth season of Community now airs Tuesdays on Yahoo! Screen.) Rare is the show that can survive so many near-death experiences; it’s almost as if Community has become one of the unkillable action heroes it lampoons. And in typical Community fashion, Harmon and Co. took the opportunity to turn their clinically endangered status into a running metajoke. The show’s pop-culture connoisseur Abed (Danny Pudi), whose grasp of reality is slightly wonky, assures us, “We’ll definitely be back next year,” before gazing lovingly into the camera. But as Abed surely knows, he isn’t the first television character to address his imminent demise to an audience. He’s approximately 30 years late to the party.

Community owes debts to myriad movies, as is the nature of a show that pilfers from the culturally revered (Die Hard, Bill Murray, John Belushi) and salvages scrap from the pop-culture junkyard (Robocop 2, Who’s the Boss, Jim Belushi). But the show to which it’s most indebted, one it has (to my knowledge) yet to directly acknowledge, is Glenn Gordon Caron’s Moonlighting — the show that did meta before meta was cool.

From its inauguration in March of 1985 until its finale five seasons later, Moonlighting played with pop-culture allusions. The basic premise concerns the exploits of David Addison (Bruce Willis pre–Die Hard), a slick slacker and deceivingly clever asshole, and Maddie Hayes (Cybill Shepherd), a former model whose ambiguous financial woes circuitously lead to her form the Blue Moon detective agency with David. The feature-length pilot, admittedly one of the worst episodes of the series, climaxes with a Harold Lloyd–inspired scene, an allusion that likely eluded the average Reagan-era TV watcher. For them, Caron threw in a Spock reference.

The will-they-won’t-they romantic tension between Willis and Shepherd galvanized viewers, but it wasn’t the heart of Moonlighting. The importance of the show stems not from the chemistry of its leads (who were constantly fighting behind the scenes) but from its willingness to play with form: From themed episodes to ornate gimmicks, it’s the progenitor of the type of self-aware, culturally conscious show Community epitomizes today.

Like Community, Moonlighting was critically admired; unlike it, it also enjoyed mainstream success, at one point ranking as one of ABC’s highest-rated shows. Along with Growing Pains and Who’s the Boss?, Moonlighting gave ABC a stranglehold on Tuesday nights in 1986. Caron had complete control and was allotted gigantic budgets from ABC, which produced the show in-house. Akin to Remington Steele, the homage-laden, Pierce Brosnan–starring show on which Caron cut his teeth, Moonlighting doesn’t just spew references — it plays with and expounds upon them. With consistent success, Moonlighting did a Claymation episode; a fake-clips episode; a hip, modern Shakespeare episode; and a Billy Joel dance segment:

Most impressively, Caron landed Orson Welles to provide an overture for the show’s iconic “The Dream Sequence Rings Twice,” which features two extended black-and-white sections. Welles intones, “Moonlighting is daring to be different, and share with you a monochromatic, monophonic hour of entertainment” (it was his final appearance before a camera; he died five days after the episode aired):

By its third season, however, Moonlighting’s ratings plummeted, and ABC’s brand new thirtysomething, which offered a then-unprecedented empathetic look at Reagan-era collegiate yuppies and their diurnal anxieties, usurped the metacomedy as the critical and commercial favorite. Stripped of Moonlighting’s navel-gazing, thirtysomething marked a new literary style to network television.

Unlike Community, Moonlighting didn’t have the internet to help save it when it got into trouble. A 1986 New York Times Magazine feature on the show notes, “Caron is the first to admit that his show pays a price for what New York Times television critic John J. O’Connor called ‘the courage of its offbeat goofiness.”’ Moonlighting had its share of problems behind the scenes as well, and it made fun of those problems onscreen — the quickly swelling egos of its leads, the feeling of betrayal felt by fans when new characters emerged in a pinch. The ever-assiduous Caron frequently turned in finished episodes just hours before airtime, if he turned them in at all. “No new episode again this week,” Rona Barrett scoffs in season-three episode “The Straight Poop”:

Eventually Caron was fired, but unlike Harmon, he stayed fired. A discernible schism between Willis and Shepherd, who did not get along, finally manifested as a literal schism between David and Maddie in the final two Caron-less seasons, which retrospective reviews concur are the show’s weakest ones. In the last episode in May 1989, the crew literally deconstructs the set while Willis and Shepherd reminisce about their adventures and ponder what went wrong.

Like Abed on Community bellowing, “Six seasons and a movie!” Moonlighting addressed its death sentence with characteristic mockery, smirking on its way to the grave. “People fell in love with you two kids falling in love,” a shadow-shrouded producer tells the duo. “You couldn’t keep falling forever. Sooner or later you had to land someplace.”

Tell it to the writers.

Correction: A previous version of this piece misspelled Cybill Shepherd’s name.