It kind of kills me to be ending my recapping run just as we finally get to meet Kalinda’s husband and Sexy Boots of Justice has not one, but two, major ass-kicking moments. But the time has come to step aside to make room for other voices (and, frankly, voices more capable of making deadlines than I). Nothing I’ve written for this site made me feel more engaged and more a part of a community than getting to spew out my thoughts on what I still think is the best drama going on network TV. Thank you for reading and for building such an insightful forum over the past two seasons. You’re in good hands with your new recapper, Carolyn Murnick, who’s been coming over to my desk at work and commenting on The Good Wife to me directly since day one. I’m excited to become one of Carolyn’s avid readers, and to fall in love with, and get mad at, the show all over again, in the comments section.
Kalinda’s Forever, Jada
Hello! New recapper, Carolyn, here. It’s pretty thrilling — and nerve-wracking — to get to do my own take on one of my favorite TV shows (and to follow up Jada’s awesome insights). The first episode of a new season is always tricky because of the work that has to be done reminding returning viewers (or informing new viewers) of where we left off and setting the stage for where we’re headed. Luckily, the Kings seem to have learned a lesson, or a number of lessons, from their uneven, meandering season three, and have come into season four with a Plan. Capital P intended.
Here’s where we seem to be headed: (1) Down a rabbit hole of discovery about Kalinda’s sexy-dangerous relationship with her (ex?) husband; (2) into bankruptcy and lay-offs at Lockhart Gardner (horrifying thought … will Cary, the last one in, get fired YET AGAIN?); (3) toward what looks like it will be a very ugly governor’s campaign, with Alicia getting dragged back into the public eye and Peter’s Al Capone intimidation tendencies reemerging; and (4) … it’s a bird! It’s a plane! It’s SuperZach! The meek son grows up, stops taking shit from the Man, and rocks our world.
But let’s start with where we left off. At the end of season three’s somewhat underwhelming finale, Kalinda had gotten a gun, trashed her apartment, and sat down to wait for the husband she’d been running from for the past five years; Alicia had narrowly avoided melodramatic backsliding by losing her bid — to a scheming Jackie — to re-buy the house she once shared with Peter; Will’s suspension was still very much in effect; Cary had returned to the fold; Peter had testified on public record that he and Alicia are separated (in order to help L&G win a lawsuit); and L&G lost their biggest client, the Mark Zuckerbergian wunderkind founder of the search engine Chum Hum, Patrick Edelstein, just as a balloon payment they’d been floating on their office came due. As Will put it then, “Oops.”
The last image of last season was Kalinda sitting in an armchair with a gun as someone knocked on the door. Cut to the season-four opener — a blank screen and that ominous knock again and we’re smashed right back into Kalinda’s blue, empty apartment as if no time has passed. Who’s there? We’ve waited five months to see, and, drum roll … it’s this guy!? With all due respect to veteran crime drama character actor P.J. Brown, our sights were set a bit higher/hotter for Kalinda’s counterpart. Raise your hand if you were extremely disappointed not to see Idris Elba. But after a few moments of stilted dialogue, we gather that this pasty ratnamed Bill is not Kalinda’s husband, but simply one of his vile henchmen (whew!), the same one who called Alicia at home about that uncashed check. Vile Henchman Bill’s been sent (armed) to bring word that, “He misses you. It’s not just the money.” Hmmm … Well, given that every lover we’ve seen from Kalinda’s past is still pining after her (see Lana Delaney, season two’s Sophia Russo, and K9 lady later this episode), this isn’t entirely implausible, but it’s not enough to convince us (or Kalinda) that there aren’t other motives at play. Pasty Bill is dispatched with a few pistol-whips and a Sexy Boot kick to the head (though with a tad too much howling and name-calling for our tastes), and we’re left to wait a bit longer for the big reveal.
Our first shot of Alicia is the total opposite of the Kalinda intro: instead of shadowy and hypervigilant, we get Ms. Florrick sun-dappled and groggy, and very much not in the driver’s seat — in more ways than one.
She’s on her way back from a family trip (minus Peter) for Zach to see colleges, and Zach’s driving Uncle Owen’s hot wood-paneled station wagon that he just bought. But wait, there’s a routine traffic stop with all the ominous foreshadowing of a horror-movie setup. It’s filmed in such a way that for a minute I thought that we were going to find out that Officer Robb was one of those guys who buys police uniforms at costume shops in order to stop people on the road and then kill them and eat their toes. Turns out he was legit and suspected Zach of drug trafficking, either because he’s a teenager or because only a stoner could drive that car, while blasting that crazy song with the chicken sounds. (Commenters, anyone know it? Our Shazam did not pick it up.) Owen already got Jackie drunk and wearing a tribal headdress, so the chances that he’d have a sizable stash of pot hidden in his car that he just sold to his nephew is pretty high. He didn’t. Officer Robb was just a jerk trying to make money for Podunk Madison County.
The ensuing escalation, search of the car, and defiant sass from Zach and Grace ends with Zach in handcuffs, and forms the basis for this episode’s case of the week. We see our first sign of the new, improved SuperZach when he not only uses his phone to record Officer Robb in the act of profiling him, but then e-mails the recording to himself just as Officer Robb confiscates the phone, even after he’s been informed that he’d committed a felony by making that recording.The whole mess will later loop in obstruction of justice, Peter’s gubernatorial race, and lots of David and Goliath back-and-forth between Cook and Madison counties. But as much as I enjoyed seeing Alicia’s protective mother and legal assertiveness sides rolled into one here, I wasn’t nearly as engaged with this story line as I wanted to be, perhaps because Zach’s fate ended up hinging on something as mundane-sounding as a “forfeiture corridor.” (We hadn’t heard of this term before this episode, but still.)
“Circumstances are beyond my control,” Alicia coolly tells Eli from the side of the highway, as explanation for why she can’t make it back in time for Peter’s interview with reporter Peggy Byrne, played by a slithery Kristin Chenoweth. And if that line’s not an echo of her character’s entire arc on this show, we don’t know what is.
But at least it all served as the lead-up to one of my favorite moments from the episode, when a flustered and vulnerable Alicia slides onto a courtroom bench next to Cary. He’s there in support of Will and Diane, who are testifying in a hearing to avoid bankruptcy for Lockhart Gardner, which is a whopping $60 million in debt. Zach’s facing four to fifteen years for eavesdropping, Alicia explains, on the verge of tears. Cary’s masculine and reassuring stance here strikes the perfect balance, and mostly just makes us thrilled to see these two back on the same team. More, please!
Back at the L-G offices, everyone had forgotten about the meeting with a shady-looking new client, first glimpsed in profile with a fitted leather jacket and a jumpy right leg. He runs a tow truck business, he says, and wants the chance to bid on a government contract. The snag is that he has a criminal record and needs to partner up with someone who doesn’t; all he needs the firm to do is vet his potential business partners. Cary and Alicia do the intake, and while they gather things are not quite Lamont Bishop–level dangerous, this mysterious Brit is definitely not on the up-and-up.
And then there’s a battle of the jewel-tone blazers interlude when Alicia (still in her emerald green) does her makeup interview solo with Peggy (still in gold) back at the office. Peggy is grilling her about the state of her relationship with Peter, and it’s pretty much a steely standoff until Peggy wants the scoop on what’s happening in the bedroom. “My life is mine,” Alicia answers, badass-edly, and then things devolve into a circuitous exchange about whether spurned political wives who stay with their husbands after a scandal are sending women back to the fifties. You know this one.
Meanwhile, back in the (yawny) case of the week, it only took Zach a few clicks of the mouse — remember Chum Hum? — scored to the peppy Britpop number “The News” by Carbon/Silicon for him to find a loophole in the charges, but the stakes are raised anyway during the preliminary hearing wherein Alicia gets the message that, surprise, it’s really Peter these guys are after.
On to favoritemoment No. 2: Kalinda catches sight of Mr. Mysterioso Brit at the L-G office, and we can see in her queasy eyes that he’s our (her) man. In the confines of the elevator (thank you, Kings, for another ride to remember), Kalinda cold cocks him across the jaw without a word, and we get into some Bond-style hand-to-hand combat. Whoa! There’s a knee to the groin and a flip around, which looks like it could have snapped Kalinda’s arm, and in a matter of moments, we’re of course up to the pause, the panting, the heavy breathing, which, were this any other show, would instantly cut to those same sounds coming from the bedroom. But, this being The Good Wife, we’re given a cold shower in the form of Diane/trustee action and some Florrick household scenes before we get Kalinda in her black corset.
(Sidebar: We would have loved to see a little of the snap/crackle chemistry that Baranski and Nathan Lane had together in The Birdcage, but Lane’s trustee Clarke Hayden is about as humorless as they come here).
And finally, about three quarters of the way through the episode, we get some answers to the questions about Kalinda’s backstory that had been stretched across the past three seasons. Nick and Kalinda are in her empty blue bedroom enjoying a little post-coital S&M play (like these two would ever do anything as obvious as sharing a cigarette), and we learn that Mr. Shady wants to take Kalinda back home. He forgives her, but she wants him gone. There are still a bunch of holes — what’s this money about? and what does she need to be forgiven for? — and we’re definitely not sure we trust this bloke, but are we the only ones who think maybe these two crazy kids have what it takes to make it? They both have a taste for fitted leather outerwear and rough sex, and he asked her to dinner while she was pointing a gun at him! How many dudes can pull that off? IMDb has him down for at least two more episodes, so here’s hoping.
Other notes: David Lee’s postponing retirement since the firm’s too broke to return his initial investment (yay!), the kids are all right after Zach gets his charges dropped thanks to another Carbon/Silicon montage and a homemade video à la Breakfast in Collinsville on YouTube, er, VidLook, but the firm is still way underwater and has to cut 30 percent of the staff.
Our last favorite moment was the episode’s final scene: the toast between Will and Diane to mark the end of Will’s suspension from the bar. Regardless of what happens around these two, we still love the chemistry and respect between this unofficial couple, so much so that we’re glad Alicia didn’t interrupt things with her sad bottle of Veuve.
Loose Threads:
Where is Callie?
Excellent line by Peter: “I’m the State’s Attorney of a county that actually matters, jackass!”
Did anyone else feel a twinge at that hastily cut off moment between Grace and Alicia back at the Florrick apartment as she was getting ready to go to Peter’s? Grace is taking a poster off her wall when her mom enters. “It’s easier, and my room is kind of empty at Dad’s,” she says, while Alicia nods only a bit forlornly. As Alicia turns to leave the room, we see Grace tacking it back up, a tiny gesture that speaks volumes about the awkwardness of shuffling between two parents.
Will doing his best Don Draper while having an after-hours, scotch-sipping powwow with Diane at the office when they realize the trustee had been playing them both against each other. Looking amazing while flipping the script— now that’s something we can drink to.
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()}});
}, {"3":3,"6":6,"17":17,"35":35,"40":40}];
window.modules["global-nav.client"] = [function(require,module,exports){"use strict";const dom=require(4),auth=require(17),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(3),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 i=t.querySelector(".dropdown");!n||t.contains(e.target)&&27!==e.keyCode||i.classList.remove("open")})}function gtmSendReport(e,n,t){let i={eventCategory:"ecommerce",eventAction:"componentClick",brand:e,dimension23:"global-nav",list:pageUri,pageZone:"header",variant:"nav-link"};"global-nav-link"===t&&(i.eventLabel=n.href),gtm.reportNow(i)}function updateElementTargetUrlsIfQueryStrings(e){if(searchString){const n=new URLSearchParams(searchString);let t=e.href;if(t.includes("?")){const i=t.split("?"),o=new URLSearchParams(i[1]);for(let e of n.entries())o.set(e[0],e[1]);t=`${i[0]}?${o.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()||auth.isMobileAppRequest())&&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;
}, {"3":3,"4":4,"17":17,"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();
// ]]