ByJoe Reid,
who has been covering movies and pop culture since 2007
Photo: Katie Yu/FX
By the time Sunday night’s Emmy Awards were finished, FX’s literary epic Shōgun had snagged its 18th and final award: Outstanding Drama Series. The show had already broken the record for most Emmys won by a single series — set by HBO’s John Adams in 2009 — earning 14 trophies during the Creative Arts Emmys the weekend before. Adding four more, including the last award of the night, was just gravy.
But as recently as five months ago, a Shōgun streak like this was not in the cards for the 2024 Emmys. The FX show had just aired its finale, and as far as anybody knew, was a limited series. That assumption tracked with the show’s source material, a closed-ended 1975 novel by James Clavell, as well as the previous TV incarnation of Shōgun, which ran as a five-part miniseries on ABC in 1980. FX’s Shōgun was widely predicted to lord over the year’s other limited series (including Baby Reindeer, which ended up with six trophies across the two ceremonies this year).
Then FX announced plans for a second season, forcing Shōgun into the drama category, and sending it to compete against shows like The Morning Show, The Gilded Age, and Fallout. That Shōgun wound up the winner among this field wasn’t surprising either, but the extent to which the show dominated the Emmys is certainly notable. It’s ironic that an Emmys ceremony that expelled so much energy recruiting the stars of TV’s recent past to represent the medium’s most successful archetypes (the doctors, the lawyers, the moms, the dads, the cops, the villains) didn’t acknowledge the characters in massive epics that have frequently captivated Emmy voters, and in whose footsteps Shōgun walked.
People often point to Game of Thrones as a game-changer for the Emmys — the moment when television pivoted from grounded, career-based dramas like Mad Men, The West Wing, even The Sopranos (say what you will about Tony Soprano, the man had a career) into the realm of big-budget, genre-based, event television. And while not every show that followed Game of Thrones to Emmy success took its lead in all aspects, Emmy voters definitely started to look toward big-idea genre stories like Watchmen or The Last of Us; tony British dramas needed to be as big as The Crown; Succession was smaller in scope, but I don’t think that show would have been as big of an Emmys hit if it wasn’t trafficking in Masters-of-the-Universe amounts of money, influence, and power.
Shōgun isn’t a fantasy epic, though. It’s a period piece set halfway around the world from FX’s American audiences, and featuring vast and intricate production design. Creators Rachel Kondo and Justin Marks had their scripts translated into Japanese and back again to help attain authenticity for the project, and FX brought in a team of Japanese artisans, what star/producer Sanada called his “dream team,” to build the sets and costumes. Everything about Shōgun felt like it was showcasing the height of what well-financed, well-designed TV could deliver. At the same time, on a story level, Shōgun was providing the kind of dynastic drama that has suffused recent Emmy favorites from Thrones to Succession to The Crown.
“It’s a type of drama genre that voters are very comfortable with perceiving as ‘good,’” Vulture’s TV critic Kathryn VanArendonk put it to me when I inquired about Shōgun’s particular appeal. “Gorgeous production values, but with a particular court intrigue kind of momentum, punctuated by violence and driven by ambition. Very tangible, exciting stakes that are a perfect tasty mix of very serious, but also distant enough that they don’t feel like a bummer.”
The cast were the next piece of the prestige puzzle, with Hiroyuki Sanada a particularly perfect choice. The 63-year-old actor had been appearing in Japanese and Hong Kong cinema since the 1960s, and beginning in the 2000s began crossing over into American films. He had a crucial supporting role in the 2003 Tom Cruise film The Last Samurai before going on to work with filmmakers from the Wachowskis to Danny Boyle and in franchise films like The Wolverine and John Wick: Chapter 4. On TV, he became a familiar face as the temple-dweller Dogen on Lost, Emily Thorne’s vengeance mentor on Revenge, and a robot attraction (in “Shōgunworld,” no less!) on Westworld. There’s a sense of injustice that an actor as well-traveled and talented as Sanada never became a “name” actor in the United States, which made Shōgun into something of a corrective. Just as Game of Thrones did with an actor like Charles Dance or Succession did with Brian Cox, Shōgun gave Sanada a spotlight role befitting of his stature, and let him play to his strengths as a soulful performer who balances his character’s internal strength and anguish.
Shōgun proved to be an opportunity for long-overdue Sanada recognition as much as it was immediate recognition for Anna Sawai, who won Outstanding Lead Actress in a Drama Series for her performance as Mariko. As with shows like Game of Thrones, Succession, The Sopranos,and The West Wing, a multitude of actors received nods, with Sanada and Sawai joined by Tadanobu Asano as the eager Yabushige and Takehiro Hira as Sanada’s enemy. Lost alum Nestor Carbonell was nominated for and won Guest Actor in a Drama for his role as a Spanish sailor. The cast was so stacked with Emmy-worthy talent that Cosmo Jarvis, who got so much attention for the comedic streak he brought to his John Blackthorne, didn’t even make the ballot.
For all of Shōgun’s individual attributes, though, the reason why the freshman entry turned into the juggernaut of juggernauts may well be that Shōgun was something simple: a classic Hollywood miniseries, to use somewhat outdated TV parlance. In many ways, it felt old-fashioned, despite its impeccable modern production value and an international spirit that stepped all of TV toward an idea of what big, impressive projects can be moving forward. From I, Claudius to the battles of Westeros, the TV industry can’t seem to resist programming that makes TV feel huge. Shōgun did just that.
But that wasn’t all that happened on TV’s biggest night of the year. Here are a few other other final takeaways from a tired awards analyst at the end of a long, long season:
The Emmys Spread the Wealth
In the weeks leading up to Emmy night, prognosticators started expecting sweeps not just for Shōgun, but The Bear and Baby Reindeer,too. In the end, Emmy voters actually divvied up the wins more than we thought. Not so much in the comedies, where the seven major awards (series, writing, directing, and four acting awards) went four for The Bear and three for Hacks. But in the drama categories, Shōgun’s four major wins were supplemented by wins for The Morning Show (Billy Crudup), The Crown (Eizabeth Debicki), and Slow Horses (Will Smith for writing the “Negotiating With Tigers” episode). In Limited Series, Baby Reindeer won four awards on Emmys night, leaving room for wins for Fargo (Lamorne Morris), True Detective: Night Country (Jodie Foster), and Steve Zaillian for directing on Ripley.
Recent years have trended toward massive sweeps, including Schitt’s Creek in 2020 and The Crown in 2021 winning every single televised award in their field. Last year, only seven shows won any major awards in the Drama/Comedy/Limited categories. Bumping that figure up to ten isn’t exactly a Mean Girls–esque breaking-up-the-tiara moment, but perhaps the trend toward spreading the wealth will continue next year.
The Daily Show Continued Its Impenetrable Emmys Racket
On the completely opposite side, the Outstanding Talk Series and Scripted Variety Series awards went to The Daily Show and Last Week Tonight With John Oliver, respectively. If you were in any way surprised by this turn of events, call a doctor. Since 2003, The Daily Show has won the award for Outstanding Variety Series or its successor, Outstanding Talk Series, 13 times. In the last 21 years, it’s only ever been beaten by The Colbert Report and Last Week Tonight — the former a direct spinoff of TDS and the latter a TDS-inspired info-comedic program hosted by a former TDS correspondent (and sometimes fill-in host). In other words, The Daily Show Television Universe has been dominating the Emmys since George W. Bush’s first term.
In that span, traditional late-night comedy (your Lettermans, your Conans, your various Jimmys) have gone 0-49 in those same categories. Sunday night was an extension of the most dominant run of any franchise that the Emmys have ever seen. Mary Tyler Moore and Lou Grant wish they were this successful. It’s both a tribute to the way that Jon Stewart’s Daily Show changed television, and an indictment of Emmy voters’ immovable taste in late-night comedy.
Pride Was Served Two Ways
Kudos to The Traitors for breaking years of RuPaul’s Drag Race dominance and winning the Best Reality Competition Emmy. Host Alan Cumming accepted the award with thanks and praise to his native Scotland, sentiments that matched his spectacular tartan ensemble. Close viewers likely also caught Cumming’s pin, which boasted the colors of the trans pride flag. This was a nice gesture considering The Traitors won for a season where trans contestant Peppermint was targeted for elimination in the second episode by eventual winner Trishelle Canatella.
A good night for pride was also a good night for Pride, the 2014 U.K. dramedy film about a group of gay activists who commit to aiding striking Welsh miners in Thatcher’s Britain. Baby Reindeer star Jessica Gunning was one of four actors from the Pride cast to be nominated for an Emmy this year, along with Andrew Scott (Ripley), Dominic West (The Crown), and Imelda Staunton (The Crown), with Gunning as the only winner. It looks like Gunning and Scott got to re-connect at the Netflix after-party — now if only Netflix would add Pride to its streaming library.
The Emmys Still Refuse to Show Clips of Today’s Television
The received wisdom heading into Sunday’s Emmys telecast was that nostalgia is what the audience wants. Last year’s Emmys (well, the ones held in January of this year) featured cast reunions for Cheers, Ally McBeal, Grey’s Anatomy, and Martin, among others, and the plan for this year, per Emmy producers, was to focus on the archetypes from TV’s past that made us all fall in love with the medium. So Scrubs’ Zach Braff, ER’s Mekhi Phifer, and The Mindy Project’s Mindy Kaling came out to present as a trio of famous TV doctors. Christine Baranski (The Good Wife/Fight), Viola Davis (How to Get Away With Murder), and Gina Torres (Suits) represented TV lawyers. TV villains and TV cops were represented (as separate groups), and there were even our favorite TV coaches, despite not including Kyle Chandler or Craig T. Nelson.
TV Moms (Meredith Baxter, Connie Britton, and Susan Kelechi Watson) and TV Dads (George Lopez, Damon Wayans, and Jesse Tyler Ferguson) were given two separate tributes, so crucial is the family unit to the foundation of television. So I am forced to ask the Emmy telecast producers: Where were TV’s great single people? The greatest shows in TV history were all shows about single people: Seinfeld! Friends! The Mary Tyler Moore Show! Cheers! M*A*S*H! Melrose Place! Would a lineup of Ted Danson, Matt LeBlanc, and Courtney Thorne-Smith really have killed them? Who on the J.D. Vance campaign got to the Emmys producers?
If I might make a small suggestion to next year’s Emmys producers that instead of random trios representing old TV shows, they might, I don’t know, show clips from present nominees? Of the major awards shows, the Emmys do by far the worst job of showcasing the shows and performances that we’re ostensibly there to honor. Even the Oscars ceremony, which often seems so embarrassed of its own products, at least features clips and montages and nominated songs. The Emmys didn’t air a single clip from Shōgun, Hacks, or Baby Reindeer to show why these were the best programs of the year. How are the TV shows of today going to become the beloved shows of tomorrow if they’re not properly celebrated now?
By submitting your email, you agree to our
Terms and Privacy Notice
and to receive email correspondence from us. This site is protected by reCAPTCHA and the Google
Privacy Policy and
Terms of Service apply.
or
Already a subscriber?
What is your email?
This email will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
Password must be at least 8 characters and contain:
Lower case letters (a-z)
Upper case letters (A-Z)
Numbers (0-9)
Special Characters (!@#$%^&*)
This password will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
You’re in!
As part of your account, you’ll receive occasional updates and offers from New York, which you can opt out of anytime.
or
Already a subscriber?
What is your email?
This email will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
Password must be at least 8 characters and contain:
Lower case letters (a-z)
Upper case letters (A-Z)
Numbers (0-9)
Special Characters (!@#$%^&*)
This password will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
You’re in!
As part of your account, you’ll receive occasional updates and offers from New York, which you can opt out of anytime.
Already a subscriber?
Already a subscriber?
`;
// integrate Sub(x) scripts and elements
if (hostname !== 'subs.nymag.com') { // do not integrate on this subdomain
document.head.appendChild(trackingScript);
document.body.insertAdjacentHTML('beforeend', subXAnimationElements);
}
There was an error processing the request. Please try again later."}).catch(e=>console.error("Error verifying email: ",e)))(r.querySelector(".content"),o.bannerCTAVerification)})):(l.remove(),s.remove()),o.dismissable||n.remove(),o.useAlertIcon||a.remove(),r.classList.add("show"),n.addEventListener("click",()=>{u(),r.classList.remove("show")})}else r.remove()}});
}, {"1":1,"6":6,"12":12,"35":35,"40":40}];
window.modules["global-nav.client"] = [function(require,module,exports){"use strict";const dom=require(4),auth=require(12),signInButton=dom.find(".user-signin"),signOutButton=dom.find(".user-signout"),globalNav=dom.find('[class^="global-nav"]'),body=dom.find("body"),dropdownItems=dom.findAll(".dropdown-wrap"),gtm=require(1),appendLandingPageParams=require(135),pageUri=require(124).getPageUri(),subscriptionPromoLinks=dom.findAll(".persist-params"),searchString=window.location.search||"";function closeDropdowns(e){let n=globalNav.querySelectorAll(".dropdown.open");dropdownItems.forEach(function(t){let o=t.querySelector(".dropdown");!n||t.contains(e.target)&&27!==e.keyCode||o.classList.remove("open")})}function gtmSendReport(e,n,t){let o={eventCategory:"ecommerce",eventAction:"componentClick",brand:e,dimension23:"global-nav",list:pageUri,pageZone:"header",variant:"nav-link"};"global-nav-link"===t&&(o.eventLabel=n.href),gtm.reportNow(o)}function updateElementTargetUrlsIfQueryStrings(e){if(searchString){const n=new URLSearchParams(searchString);let t=e.href;if(t.includes("?")){const o=t.split("?"),i=new URLSearchParams(o[1]);for(let e of n.entries())i.set(e[0],e[1]);t=`${o[0]}?${i.toString()}`,e.href=t}else e.href=`${t}?${n.toString()}`}}function init(e){const n=e.querySelectorAll(".to-landing-page");window.addEventListener("auth:init",()=>{signInButton.addEventListener("click",function(e){e.preventDefault(),auth.showEmbeddedLoginFlow("top navigation")}),signOutButton.addEventListener("click",function(e){e.preventDefault(),gtmSendReport("Sign Out",e.target,"user-info-link"),auth.logout()}),auth.isAuthenticated()&&e.classList.add("signed-in"),auth.isSubscriber()&&e.classList.add("subscribed"),e.querySelectorAll(".user-link").forEach(e=>{e.classList.add("active")}),subscriptionPromoLinks.forEach(e=>{updateElementTargetUrlsIfQueryStrings(e)}),appendLandingPageParams(n)})}dropdownItems.forEach(function(e){e.addEventListener("click",function(){e.querySelector(".dropdown").classList.toggle("open")})}),body.addEventListener("click",closeDropdowns),document.addEventListener("keydown",closeDropdowns),globalNav.addEventListener("click",function(e){let n=e.target;n.classList.contains("global-nav-track")&>mSendReport(n.text,n,"global-nav-link")}),module.exports=init;
}, {"1":1,"4":4,"12":12,"124":124,"135":135}];
window.modules["aaa-module-mounting.legacy"] = [function(require,module,exports){"use strict";const _pickBy=require(221),_each=require(406),Fingerprint2=require(408),DS=require(407),Eventify=require(246);function registerGlobals(){window.DS=DS,window.Eventify=Eventify,window.Fingerprint2=Fingerprint2,DS.value("Eventify",Eventify),DS.value("Fingerprint2",Fingerprint2),DS.value("$document",window.document),DS.value("$window",window)}function mountDollarSliceComponents(){DS.service("components",["$document","$module",function(e,n){var o=_pickBy(n.definitions,e=>e.providerStrategy===n.providers.controller),r=Object.keys(o);function t(e){return o=>{try{n.get(e,o)}catch(e){logMountError(o,e)}}}_each(r,n=>{var o=e.querySelectorAll('[data-uri*="/_components/'+n+'/"]'),r=e.querySelectorAll('[data-uri$="/_components/'+n+'"]');_each(o,t(n)),_each(r,t(n))}),this.components=r}]),DS.get("components")}function logMountError(e,n){const o=e.outerHTML.slice(0,e.outerHTML.indexOf(e.innerHTML));console.error("Error attaching controller to "+o,n)}registerGlobals(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{mountDollarSliceComponents()}):mountDollarSliceComponents();
}, {"221":221,"246":246,"406":406,"407":407,"408":408}];
window.modules["ads.legacy"] = [function(require,module,exports){"use strict";const _map=require(118),_forEach=require(107),_isString=require(268),_intersectionWith=require(409),_isEqual=require(274),_each=require(406),_debounce=require(182),_sortBy=require(205),page=require(124),visit=require(114);DS.service("adService",["Eventify","$cid","$document","$window",function(e,t,a,i){var o,n,s,r,d,c,u,l,g={},p=this,h=[],f=visit.getQueryParamsObject(["utm_campaign"]),m=document.querySelector('script[data-type="ad-a9"]'),b=[],w=!1,v=[],y=document.querySelector('script[data-name="ad-doubleverify"]');document.querySelector('script[data-name="concert-ads"]')||(i.NYM={},i.NYM.analytics={},i.NYM.analytics.adStartTime=i.performance.now(),i.googletag=i.googletag||{},i.googletag.cmd=i.googletag.cmd||[],u=i.googletag,(m||y)&&(i.googletag.cmd=i.googletag.cmd||[],i.googletag.cmd.push(function(){i.googletag.pubads().disableInitialLoad()})),m&&(l=i.setInterval(function(){void 0!==window.apstag&&void 0!==window.apstag.timeout&&(i.clearInterval(l),window.apstag.cleared=!0,l=null)},10),setTimeout(function(){l&&(i.clearInterval(l),i.googletag.pubads().refresh(),window.apstag||console.log("MESSAGE: Timeout for A9 load exceeded, aborting"))},500)),y&&(b.push(new Promise(function(e){w?e():v.push(e)})),c=i.setTimeout(T,2500)),o=function(e){var t,a,o=e.data,n=[];return o.loaded?e:(o.loaded=!0,t=null,(t=o.sizes?u.defineSlot(o.name,o.sizes,o.id).addService(u.pubads()):u.defineOutOfPageSlot(o.name,o.id).addService(u.pubads())).setTargeting("adid",o.id),f.hasOwnProperty("utm_campaign")&&t.setTargeting("utmcamp",f.utm_campaign),a=p.getAdCount(o.label),t.setTargeting("label",o.label+"_"+o.site+"-"+a),u.display(o.id),u.pubads().addEventListener("slotOnload",function(){i.NYM.analytics.firstAdLoadTime||(i.NYM.analytics.firstAdLoadTime=i.performance.now(),i.NYM.analytics.firstAdLoadLabel=e.data.label)}),n=_(o),Promise.all(b).then(function(){n?window.apstag&&window.apstag.cleared?window.apstag.fetchBids({slots:[n],timeout:window.apstag.timeout},function(){u.cmd.push(function(){window.apstag.setDisplayBids(),u.pubads().refresh([t],{changeCorrelator:!1})})}):y&&u.pubads().refresh([t],{changeCorrelator:!1}):u.pubads().refresh([t],{changeCorrelator:!1})}),e.slot=t,e)},n=function(e){var a,i,o,n=t(),s=e.getAttribute("data-name"),r=e.getAttribute("data-sizes"),d=e.getAttribute("data-label"),c=e.getAttribute("data-site");n=e.id,r&&r.length?(r=r.split(","),a=[],_map(r,function(e){e=e.split("x"),i=parseInt(e[0]),o=parseInt(e[1]),a.push([i,o])})):(e.classList.add("oop"),a=!1),this.data={id:n,name:s,sizes:a,loaded:!1,label:d,site:c},g[n]=this},r=function(e){u.cmd.push(function(){var t=o(e);g[e.data.id]=t})},s=function(e){var t=[];e.slot?(t=_(e))&&window.apstag&&window.apstag.cleared&&window.apstag.fetchBids({slots:[t],timeout:window.apstag.timeout},function(){u.cmd.push(function(){window.apstag.setDisplayBids(),u.pubads().refresh([e.slot],{changeCorrelator:!1})})}):e&&r(e)},u.cmd.push(function(){var e,t,o,n=page.getMeta("article:tag"),s=page.getMeta("author"),r=i.location.href,d=(e=a.head.querySelector(".head-gtm"),t=a.body.querySelector(".gtm"),e&&"top"===e.getAttribute("data-gtm")?"gtmtop":t&&"bottom"===t.getAttribute("data-gtm")?"gtmbottom":"");o=[],_forEach([n,s,d],function(e){_forEach(e.split(","),function(e){(e=e.trim().toLowerCase().replace(/\s/g,"-").replace(/\'|\’/g,"")).length&&o.push(e)})}),u.pubads().setTargeting("kw",o),u.pubads().setTargeting("entry_group",o),r=r.slice(r.lastIndexOf("/")+1),u.pubads().setTargeting("pn",r),u.companionAds().setRefreshUnfilledSlots(!0),u.pubads().enableAsyncRendering(),u.enableServices()}),this.load=r,this.create=function(e){return new n(e)},this.refresh=function(e){var t;_isString(e)?(t=this.getById(e),s(t)):s(e)},this.remove=function(e){var t=e.data.id;a.getElementById(t).innerHTML=""},this.getAdCount=function(e){var t,a=0,i=Object.keys(g);return _each(i,function(i){(t=g[i]).data.loaded&&t.data.label===e&&a++}),a},this.getById=function(e){return g[e]},d=_debounce(function(){var e={TopLeaderboard:1,RightColTopMPU:2,outOfPage:99,"homepageTakeover/TopLeaderboard":1},t=_sortBy(h,function(t){return e[t.data.label]||10});_forEach(t,function(e){return e.data.sizes?r(e):i.setTimeout(function(){r(e)},2e3)}),y&&window.PQ.cmd.push(()=>{try{window.PQ.loadSignals(["ids","bsc","vlp"],T)}catch(e){T(),console.error(`There has been an error loading Double Verify signals: ${e}`)}}),h=[]},10),this.addToPageLoadQueue=function(e){h.push(e),d()});function _(e){var t,a=e.sizes;return a=_intersectionWith(a,[[970,250],[970,90],[728,90],[300,600],[300,250],[320,100],[320,50]],_isEqual),e.sizes&&e.sizes.length&&(t={slotID:e.id,sizes:a,slotName:e.label}),t}function T(){i.clearTimeout(c),w=!0,_forEach(v,function(e){e()})}}]);
}, {"107":107,"114":114,"118":118,"124":124,"182":182,"205":205,"268":268,"274":274,"406":406,"409":409}];
window.modules["cid.legacy"] = [function(require,module,exports){"use strict";DS.service("$cid",function(){var r=Math.floor(100*Math.random());return function(){return"cid-"+ ++r}});
}, {}];
window.modules["client.legacy"] = [function(require,module,exports){"use strict";require("cid.legacy"),require("ads.legacy"),require("facebook.legacy"),require("aaa-module-mounting.legacy");
}, {"cid.legacy":"cid.legacy","ads.legacy":"ads.legacy","facebook.legacy":"facebook.legacy","aaa-module-mounting.legacy":"aaa-module-mounting.legacy"}];
window.modules["facebook.legacy"] = [function(require,module,exports){"use strict";DS.service("facebook",[function(){this.fb=function(i){window.FB&&window.FB[i].apply(this,Array.prototype.slice.call(arguments,1))}}]);
}, {}];
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o typeof key === 'string' && key.match(/\.legacy$/)).forEach(key => window.require(key));
}
function tryToMount(fn, el, name) {
try {
fn(el); // init the controller
} catch (e) {
const elementTag = el.outerHTML.slice(0, el.outerHTML.indexOf(el.innerHTML));
console.error(`Error initializing controller for "${name}" on "${elementTag}"`, e);
}
}
/**
* mount client.js component controllers
*/
function mountComponentModules() {
Object.keys(window.modules).filter(key => typeof key === 'string' && key.match(/\.client$/)).forEach(key => {
let controllerFn = window.require(key);
if (typeof controllerFn === 'function') {
const name = key.replace('.client', ''),
instancesSelector = `[data-uri*="_components/${name}/"]`,
defaultSelector = `[data-uri$="_components${name}"]`,
instances = document.querySelectorAll(instancesSelector),
defaults = document.querySelectorAll(defaultSelector);
for (let el of instances) {
tryToMount(controllerFn, el, name);
}
for (let el of defaults) {
tryToMount(controllerFn, el, name);
}
}
});
}
// Make sure that a `window.process.env.NODE_ENV` is available in the client for any dependencies,
// services, or components that could require it
// note: the `` value is swapped for the actual environment variable in /lib/cmd/compile/scripts.js
window.process = window.process || {};
window.process.env = window.process.env || {};
if (!window.process.env.NODE_ENV) {
window.process.env.NODE_ENV = '';
}
// note: legacy controllers that require legacy services (e.g. dollar-slice) must
// wait for DOMContentLoaded to initialize themselves, as the files themselves must be mounted first
mountLegacyServices();
mountComponentModules();
// ]]