Thank our Lord and Savior Beelzebub that this is the show’s fifth episode because that means the Eileen Davidson Accord has lifted and we can finally talk about Leah. I have been waiting for weeks to tell you all that I love Leah. Right away I thought that I liked her but, week after week, she has shown herself to be nothing but an excellent addition to the cast. I haven’t been this bullish on a Real Housewife upon her arrival since we first met Erika Jayne and she sat alone in a fancy restaurant and ate dessert after lunch (a meal I like to call lessert).
Leah’s chemistry with the women seems to be perfect and she’s been a hit almost all around. She’s not afraid to stand up for herself but also to be vulnerable and really talk about her issues around sobriety and struggles with her family. Also, she’s funny, brash, and unyielding, something that reminds me of Bethenny Frankel, but without the overreaching unlikability of the reality-show great that Leah is replacing. It doesn’t hurt that she’s pretty and dresses well, and it also doesn’t hurt that she’s a good foil for Tinsley, who was without an ally or another woman close to her age on the show for several years.
Now, I know that Leah has some problematic statements and behavior in her past. At this point I am choosing to ignore that, mostly because, well, this is the Housewives we’re dealing with. I know that most of them across the franchise (probably including my favorite floozy) likely voted for Trump. Also, if we were kicking off Housewives for problematic behavior, we wouldn’t have a cast left. We can’t compare something Leah said offscreen before she was even cast with Luann showing up in actual blackface to an event she knew was going to be on camera.
Leah is at her best when dealing with Sonja Tremont Morgan of the Mercedes Benz Fashion Week Morgans after her disaster of a fashion show. This whole episode takes place during Fashion Week (two weeks after the NYFW episode of Real Housewives of Beverly Hills), and I find it hilarious that these women are still talking about Fashion Week like we’re still living in Sex and the City–era Manhattan. For years, top designers have been fleeing NYFW, with many calling to cancel the spectaclealtogether. That Ramona says she’ll be ostracized if she doesn’t go to fashion shows is laughable. For Sonja to say that the buyers are coming to her presentation is also comical, since all of the real buying happens at appointments after Fashion Week.
With established designers like Tom Ford and Jeremy Scott as well as up-and-comers like Joseph Altuzarra leaving New York to show in other cities, what we’re left with is a patchwork of designers no one cares about. When Tinsley is going to walk in the Harem Scarem fashion show, or whateverthehell this guy’s name is, everyone treats it like a big deal and a return to form. Harem Scarem was on a later season of Project Runway and didn’t even win. This is sort of like being the opening act for the latest Crystal Bowersox tour. Only Dorinda asks what all of us at home are thinking: “Who is this designer?” He puts Tinz in a crown, a purple opalescent dress that looks like a clamshell is trying to eat her boobs for breakfast, and a pair of sparkly purple running shoes. She looks less like a model and more like someone playing Glenda the Good Witch at Limelight circa 1997.
This is contrasted with Tinsley walking in other fashion shows in 2006, which was for Heatherette, then a cutting-edge brand at the height of cool. The other people to walk in the show were Paris Hilton and Amanda Lepore, who makes an appearance at the Harem Scarem show as well. At least Tinz maintains some consistency in her company. (Amanda Lepore is forever spirit. She is an icon, she is a legend, and she is the moment. Come on now.)
After that show, Ramona takes everyone to Pamella Roland, a fashion designer known mostly for dressing rich midwestern women, which actually makes her a perfect fit for the UES crowd we usually get on RHONY. However, sitting in her front row is not like a ticket to the Chanel couture show. Ramona makes it out to be some kind of hot ticket and chastises Sonja for ignoring the show to send emails. At lunch after the show, Ramona tells Leah that it was rude to skip and that it is a “coveted invitation.” Come on. It’s not like there was some huge embarrassing gap in the front row because Leah skipped out. A lovely woman or gay in all black and a headset would have just selected someone from the second row to sit in Leah’s seat and the show would have continued apace. No one missed that she wasn’t there.
That lunch is a complete mess, though. Sonja is trying to deal with her fashion show and having a freak-out because things aren’t getting done. She retires to the next table where she is staring over her readers and dictating her texts into her phone, a feature on most Apple devices that seems to only be utilized by middle-aged women. Tinsley is yelling about whether her hair should be curly or straight, Dorinda is yelling about Tinz being boring, Ramona is trying to stuff as many oysters into her face as Poseidon will allow, and Leah is talking about how her mother isn’t speaking with her because she’s started drinking again.
This is a sentiment also echoed by her ex, Rob, who is like a grown-up version of the hottest skater dude in Union Square. Leah is trying to sell her decision to drink again as a bit of harmless fun and that she has it entirely under control. Um, I’m sorry, but I think Ramona’s backyard would like to have a moment of your time, Ms. McSweeney. Those in her life are worried about her and they haven’t even seen the same footage that we have. If that is how Leah behaves every time she gets wasted, then sobriety might be the right lifestyle choice for her. But she is a smart, capable woman who should be allowed to make her own decisions. I support her drinking, but I also think skepticism from those closest to her is probably very healthy.
Finally, it is time for the SONJA by Sonja Morgan fashion show and, well, it is the exact beautiful disaster I was hoping for. It’s like a pair of knickers cleaned in a bidet. It’s like a funeral for a dog where the dog’s ashes blow back into the crowd. It’s like a toilet clogged with 17 discarded BlackBerries. It is, in one word, SONJA.
As soon as Sonja arrives at the venue, which is the second floor of some restaurant somewhere in Manhattan and not an actual event space, and certainly not one of the more trafficked venues during Fashion Week, she sees the step-and-repeat and says, “There is the old step-and-repeat that we roll up and store in the basement.” Oh, how I love it so. It’s like you can smell the mildew and Wesson oil just wafting off of it.
It is immediately clear that Sonja has absolutely no idea what she is doing. This is not because Sonja is stupid. Sonja Morgan is not stupid. This is because Sonja Morgan is cheap. When she kept insisting that she wanted all of the models from one agency I thought, “But, Sonja, that’s not how it’s done. Just get the best models.” Then she tells Ramona that she has to handle everything because, “I’m the only one who can get things for free.” She says she wants the “14-year-old” models who will walk in her show for exposure, not the experienced models she has to pay. Ah, now all the Legos are clicking into place.
The same seems to hold true with just about everyone who is producing this event. She could have been like Kyle by Shahida Too and just paid a production company to set up a show in a venue, hire everyone, assign the seats, fix the lighting, hire the models, etc. Instead Sonja has what appears to be a bunch of random friends who are “brand directors” and “creative directors.” She even meets with a “location scout.” This is not needed for an actual fashion show, because there are only about ten different locations anyone in their right mind would use. Sonja, as we know, is not in her right mind. She is in a gilded LSD hallucination of her own making and it sort of looks like a kaleidoscope humping a Lisa Frank Trapper Keeper.
At the venue, Sonja is in flats, a plaid blazer, and a full face of makeup running around trying to sort out the layout, seat assignments, and where to put a photographer who just RSVP’d. It is clear that the people she has working at the event have probably never done this before and that is because they are probably doing it for credit in a class at FIT, not because she actually paid any of them. She is hastily redoing the flowers, which look like an arrangement you buy a relative you don’t really like in the gift shop at a rural hospital. Then we learn that most of the flowers are orchids that Sonja purchased (probably in bulk) at Home Depot.
When the show finally gets up and running, there is no announcement that the show is going to start, the models just start taking the runway. They arrive at the end of the catwalk, where the photographers should be taking their pictures, but there is no lighting. We can’t even see the clothes. I love the savagery of the producers, knowing this will be the case, but doing absolutely nothing to stop it. Let Sonja succeed or fail by her own merits. Sonja, of course, thinks it is a great success because Century 21 came to the show. Century 21 is like a high-end Marshalls. This is where you sell your wares when you can’t sell them anywhere else. Century 21 is not the goal, it is the last resort.
But you can’t stay mad at Sonja. You can’t even feel bad for her because she is just such a delightful shambles. Leah learns this when she gets her shipment of SONJA by Sonja Morgan that she is supposed to wear to the fashion show. Tinsley got a cute white lace dress that fits about as well as a Baptist minister at the Adult Video Awards. Dorinda got a “Liza Minnelli” dress that she wears, instead, as a blazer. Ramona got a dress that didn’t fit so she wore a floral number that she would have told the Countess does not fit in the Hamptons. Leah got a pair of oversize cashmere pajamas in a ripped paper bag with a magenta Kyle Richards felt fedora and a pair of sunglasses that an intern picked up on St. Mark’s Place.
Leah thinks that this is a passive-aggressive swipe by Sonja, who is still mad about something Leah said to her in the Hamptons. This is completely wrong. First of all, what Leah said didn’t even register to Sonja. It was like a BB being fired at a tank. Secondly, Sonja isn’t attentive enough to pull off an insult like that. Sonja is not malicious, she’s just — how can I put this delicately — daft.
Being a natural at the reality-television dark arts, Leah brings the offending outfit in a plastic bodega bag to return to Sonja. When Sonja sees her, she instigates a fight by saying, “What happened to the cashmere two-piece I sent you?” Leah pulls it out and Sonja says, “Where is the bag it came in? It was in a nice bag. And where are the sunglasses?” See, Sonja wasn’t being mean or stupid, she just really thought this is something that Leah would have liked. When Leah explains that it would have looked horrible on her and wouldn’t fit, Sonja goes backstage, has an intern help her out of the black dress that will barely zip up in the back and into Leah’s outfit.
Sonja emerges into the fashion show, bursting through a kitchen door like a male stripper dressed as a cop who is about to “arrest” every woman at a bachelorette party. She struts around showing off the outfit, which everyone agrees is horrible, but she is having so much fun dancing and showing it off to everyone that they all start laughing. As Leah says, you can’t even stay mad at Sonja because she is just so lovingly vacant.
Meanwhile, on the Upper East Side, at the top of her residential tower, a woman hovers about her kitchen wondering just where the cheese grater goes in her drawer of kitchen appliances. It is day 974 of the lockdown and she can’t remember the last time she cooked all her own meals, did all her own laundry, washed all her own dishes. The time it takes to do everything, not that she minds it, but the time. She has nothing but time. She has nothing. She has …
She thinks about February, when things started to get bad and they canceled all the Fashion Week events. Suddenly holes opened up in her schedule, wide chasms of time that she now had to fill. When was the last time something like that had happened? Never, the redhead thought. Never had she missed a Fashion Week in all of those years since being a buyer for Macy’s, back when she had a reason to be there other than being seen. Now, who knows when it will come back. Who knows if it will ever come back. Absent anything else to do, Jill Zarin stalks to the kitchen and pulls out a Diet Coke. She washes it under hot water, just to be safe, and pops the top, gas rushing out into the atmosphere, into the uncertain air. Be safe, little ones, she thinks, as she stares at the top of the can, searching for an invisible enemy, before taking a tentative sip.
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(3),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(136),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,"3":3,"12":12,"124":124,"136":136}];
window.modules["aaa-module-mounting.legacy"] = [function(require,module,exports){"use strict";const _pickBy=require(221),_each=require(408),Fingerprint2=require(407),DS=require(406),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(408),_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,"408":408,"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","aaa-module-mounting.legacy":"aaa-module-mounting.legacy","ads.legacy":"ads.legacy","facebook.legacy":"facebook.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();
// ]]