Gossip Girl ebbs and flows, and after last week’s tsunami of plotlines, this week’s episode ebb meant we got to see some of them through: Dan and Serena, thrown back together with the tide, seemed jaded as they talked lifelessly about their “Faulknerian” situation. Meanwhile, their parents, Lily and Rufus, were also back together, and acted like the season-one version of the teenagers, all public make-out sessions and fraught talk of their “different worlds.” Jack, having run his course, had to be disposed of: His attempted rape of Lily, filmed with gritty handheld camera and containing an oddly lingering shot of him grabbing his own crotch, was the dramatic pinnacle of the episode, and was made all the more exciting by the rumors last week, surely planted, that Lily may be killed off. Next up is a plotline that looks like it might be ripped from the headlines — a budding forbidden romance between “Rachel,” a comely young Literature teacher from Des Moines, and Lonely Lit-Boy Dan. (Ideally, this will end with Dan selling his body for the 1922 version of Ulysses.) Plus more pointless Yale mishegoss(we pretty much know they’re all ending up at the same school, anyway) and a kinder, gentler Chuck. But let’s not get ahead of ourselves! The reality tally awaits, after the jump.
Realer Than Seitan at the Angelica Kitchen
• We love how in the GossipGirl.com title card the picture entitled “Yale or Bust!” had Blair and Serena hugging one another. Nice, writers: because “New Haven or Enormous Rack!” would have just been too explicit. Plus 2. • Blair’s gay dads’ Yale outfits: Plus 2. Dorota’s Yale outfit: Plus 5. • Plus 1 for Blair’s dad giving her a bulldog in a basket. Ever since he turned gay, he loves presenting things in baskets. Plus 5 For everyone cooing over the bulldog for a moment, then Dorota taking it away and being the only person we see it with again. • Blair watched Gilmore Girls and thinks she’s better fit for Yale than “that Rory.” Actually, a sweet-tempered, slightly spastic nerd is much more fit for Yale than a perfectly manicured society queen, but of course Blair wouldn’t see it that way. Plus 1. • Dan, on what could happen if Blair turned on Serena over Yale: “Fire and brimstone and a lot of bitchy asides. Death by Dorota?” Oh Dan, you made a funny! Plus 3. Now stop combing your sideburns forward. • Plus 2 for everyone hearing Lily and Rufus have sex, but only Eric throwing a hissy fit over it. (Though we do have to question that so many people heard it. Isn’t that why rich people get duplexes in the first place? Hearing sex through walls is for poor people and bathroom attendants in the meatpacking district.) • Plus 10 for all of the awesome things Chuck did to Uncle Jack, especially: (a) “Having the freshman class at Brearley hold their annual sleepover in my hotel room was a nice touch.” (b) “You got him on Megan’s List?” (c) Planting coke in his gym bag. (d) Ambushing him with a transsexual hooker. “Two, actually, they owed me a favor.” (e) (And even though this didn’t happen: “#26. Crash Jack in Plane.”) • Dan: “Does she have Benjamin Button Syndrome?” Plus 1, for timeliness, and because this being Dan, he is probably referring to the F. Scott Fitzgerald story and not the Brad Pitt movie. • Yay, Nate and Dan are boyfriends again! This will make writing fan fictionnew plotlines so much easier. Plus 1. • Blair: “Don’t talk to them. They’re working. REFRESH.” Plus 3. (That Dan figured out how to get a text alert about getting in and Blair had to use this other, slave-powered system, is just part of why he got in and she got wait-listed.) • Despite the fact that the producers spat in our faces yet again with footage of Columbia purporting to be Yale, we are excited the show will be taking some of its characters there. Imagine the a cappella! And the dangerous environs! And the gay subplots! Plus 2. • Blair: “Witch hunts are my Valium.” Plus 1. • Also Blair: “Dan Humphrey? He’s like a cafeteria lady who won the lottery. You couldn’t pry that acceptance from his hands with the jaws of life.” Plus 1. • Blair called Dan a “Financial Aid-iot.” Wrong in so many ways, but from Blair, so right. Plus 1. • Was that voice on the phone from Yale actually Julia Child calling from beyond the grave? Because New Haven would be a bad place to be stuck for eternity if you like good French food. (No points — we just love funny old-lady voices.) • “Cancel the Nelly Yuki project now!” Plus 1. And, “Second-semester seniors get a free pass, like pregnant ladies or 14-year-old Chinese gymnasts.” Plus 1 • God, Jenny looks awful. Being an unpopular homebody fag hag is really taking its toll. Next stop, upper-ear piercing and a brief, unsatisfying lesbian fling! Plus 2. • We really liked the Angel/Devil game that Blair and the girls played. Plus 2. Though high-school girls don’t actually sit together on beds that close, the way they do on TV (and neither do high-school boys, much to Chris’s disappointment). • Some refreshing new moments: For once, Nate and Vanessa resolve a class problem with a laugh and a kiss, instead of a fight and lost hoop earrings. Plus 1. And Dan was caught on camera talking to a fellow student! Plus 1. One who was actually kind of unattractive! • Meanwhile, of course Dan would assume that Serena’s decision not to go to Yale was all about him. Plus 2. There can only be one protagonist in the novel of his life. • Serena’s boobs are oddly missing from the first half of the show: The entire time she’s considering going to Yale she is wrapped in a gray woolen like, coat and sweater. But when she decides to go to Brown, they reappear, triumphant, at the opera. We never thought we’d say this, but: Good. Know thyself, Serena. Plus 1. (We also enjoyed Blair and Lily’s dresses. Blair’s more, obvi.) • A reader pointed out that the Page Six item about Lily and Rufus’s coming out at the opera is titled, “Bass Exit To Brooklyn,” a reference to the 1964 Hubert Selby Jr. book and/or the 1989 film about a prostitute. Plus 3because that’s totally the kind of reference that Page Six’s Richard Johnsonwould make, not only because he is of both eras but because he’d seize the opportunity to slyly call the almost-raped Lily a hooker. • Of course Dan is reading a seventies-issue, used-bookstore John Updike paperback. Plus 1. • We love the idea of Blair going “Black Ops,” and the fact that Dorota knew by one look at her face that it was “war.” Plus 2. Also, Plus 2 because when Blair said, “Put that puppy down, Dorota,” she didn’t mean move him to the floor.
Total: 58
Faker Than Blair Knowing What Angelica Kitchen Is:
• When Blair’s gay dads reveal the table full of Yale-themed pastries, Blair says, “This is just what I needed to perk me up.” Minus 2, because we well know her documented allergy to pastry. • Lily would not try to be so blasé about the morning awkwardness with her, Rufus, and the kids. She’d have the servants cook up some giant breakfast with eggs benedict and then distract everyone with mimosas. Minus 2. • The opera is the “event of the season”? We must be operating under a misapprehension of how many “seasons” there are in a year. Minus 1. • “This is my first salary job,” “Rachel” confesses moments after meeting Dan. “I’ve never even been to New York before. It’s a lot different from Des Moines.” Seriously. What teacher would say that? She would be bending over backward to act “professional.” Minus 3, because no kids or teachers try that hard to be friends right away. And minus another 3 for Rachel, who was a stickler about grade inflation and the only person in the entire series to rat out anybody else. (Also, we can’t tell whether to add or subtract points for the fact that she looks three years younger than Serena.) • Oh, and, at first Rachel was so wise and tender we thought maybe she was secretly related to Eric, but then she goes and makes a bunch of Serena-worthy ditzy decisions. Consistency, please! Minus 2. • We could deal with all the plaid in this episode if they didn’t pair it with that insane lace around Blair’s wrists. We know she doesn’t have to worry about getting food on her sleeve, but how did she put on her makeup? Minus 1. • Everyone is friends again, even after the Girls on the Steps revealed Serena and Dan’s family issues. That was pretty bad: You’d think they’d at least put Penelope on probation. Minus 1. • Nelly Yuki got a 2360 on her SATs? (A) We are too old to know what that means and (B) is this because Blair sabotaged her last season? Why didn’t she just re-take them? Too busy fiddling with masking tape and broken eyeglasses? Minus 2. • Would Jack be so bad at running the company that the stock price would drop in mere days? It’s a real-estate company, not a trading floor; things move slowly. Minus 2. And even if he did screw things up, he would be too cocky to admit it so willingly and repeatedly. He strikes us as more of the George Bush type of leader. • We love that Yale is so involved, but honestly, Serena just wouldn’t have gotten in by virtue of “Page Six” alone, nor would there be any of this press-release business. Since we’ve already subtracted points for that in a previous recap, we will only deduct for the fact that Headmistress Queller and the Admissions Office were so open with two young students about how, why, and with whom things went down the way they did. Sure, fancy private schools negotiate for seats at colleges, but they don’t tell the kids about it! Minus 4. Also, Brown is better for Serena? She belongs at, like, Pepperdine. • We kind of doubt that Vanessa would have The Ring Cycle on DVD, that, combined with her nineties alt-rock fetish, makes her a little bit too well-rounded, even for a home-schooled kid. Eric being that into opera, however, we can totally buy, so even. • Why is Bart’s death permanently one month ago? Minus 2. And why does Lily, who pulls off the most clever move on the show, act so dumb about bringing Rufus to the opera and then making out with him? Minus 3. • Dan says to Serena, “FOR MONTHS you act like going to Yale is what you wanted,” but they just got back together. Like less than a month ago? After Christmas? Minus 2. • At the opera, a lawyer comes up to Lily and says, in front of other people, “I have those papers.” What lawyer would say that? Furthermore, what lawyer would have the papers faxed to the opera so as to produce them for an emergency signing? Couldn’t this have waited till tomorrow morning? Minus 7. • Oh, and we’re not sure if they ever mentioned that the opera was at the Met, but they did mention the Grand Tier restaurant. Not only was the opera house obviously not the Met, but it wasn’t big enough to have a restaurant or even three balconies, as referenced. We know it’s probably hard to get permissions to film at Lincoln Center, though (and that it was actually taped on Staten Island), so we’ll only give it a minus 4. • A word about the attempted rape. First of all, yes, it runs in the family, yadda yadda. But why was Jack in the ladies’ room in the first place, why was there no one else in there when clearly it was a highly trafficked area? Minus 4. • Okay, people just don’t use the phrase “In our world” that frequently. It’s awkward. Minus 3. • First of all, THAT IS NOT Headmistress Queller. We just saw Headmistress Queller, like two episodes ago, and she was a brunette with kindly features. What are we, rubes? Minus like 15, because one thinks it would have been easy enough to work in a line about the new headmistress who is less predisposed to bribes, etc., etc. • Why is something Blair did in her personal life something the headmistress can give her detention for? Minus 10. • Second, why isn’t it wildly inappropriate that the teacher accepted that invitation from Blair, and thus compromised her position? Minus 5.
Total: 78. Sadly, even though this episode won back much of our affection after last week’s debacle, it still ended up in the negative — mostly because smart people were acting dumb, and dumb people were acting smart. But that is the “world” of Gossip Girl, and we just don’t live in it.
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();
// ]]