ByNate Jones,
a Vulture senior writer covering movies and pop culture
An indefinable musical by a French auteur is headed for millions of streaming subscribers. Most of them will be entirely unprepared.
Photo: AGE 114 - WHY NOT PRODUCTIONS - PATHÉ FILMS - FRANCE 2 CINÉMA
This Gold Rush column originally on November 9. We are recirculating it now that Emilia Pérez is streaming on Netflix.
For months, I have had a certain date circled in my calendar: November 13. “E-Day.” The day Emilia Pérezhits Netflix. On Wednesday, I’ll be sitting here like the Michael Jackson popcorn GIF as Jacques Audiard’s musical, a film that until now existed only in the cloistered world of prestige cinema, is instantly thrust in front of millions of streaming subscribers. Most of them will be entirely unprepared for what they’re about to watch — how will they react?
So far, Vulture has written three major stories about Emilia Pérez. The first called it “an unbelievably audacious film that feels like if Pedro Almodóvar remade Mrs. Doubtfire.” The second called it “a cross between Mrs. Doubtfire and Sicario reimagined as a musical.” The third did not mention Mrs. Doubtfire but did call it a “genre-melding noir musical.” Suffice it to say, normal language is insufficient to encapsulate the Emilia Pérez experience. Briefly, it’s the story of a Mexican lawyer (Zoe Saldaña) hired to facilitate a cartel leader’s (Karla Sofia Gascón) secret transition, who then, years later, assists her in reconnecting with her old family, while the two of them form a nonprofit aiding families of those who’ve been “disappeared” in the drug conflict. There’s also a romantic subplot between Selena Gomez, who plays the cartel leader’s wife, and Édgar Ramírez, as a guy who wears tank tops. And, again, it’s a musical!
Emilia Pérez was rapturously received at Cannes, where four of its female cast members shared the Best Actress prize. It then came second in TIFF People’s Choice voting — beatingAnora! — thus proving the musical’s appeal was not limited to French people and jet-lagged journalists. It’s Netflix’s biggest awards priority this season, and pundits expect it to be a major player. By current odds, it’s the early front-runner in Supporting Actress, for Saldaña, and International Film, where it’s the French submission. If nominated in Best Actress, Gascón will make history as the first out trans actor nominated for an Oscar.
But before that, Emilia Pérez will have to run the gauntlet of actual moviegoers, many of whom are freshly traumatized by Donald Trump’s reelection and could respond in ways we can’t even imagine. My colleague Jason P. Frank, who watched the film in a more normal setting, called it a classic “festival movie,” the kind of big, wild swing that shakes up viewers accustomed to seeing three or four films a day, but doesn’t always translate to everyday experience. (Other examples of this kind of movie include Titane andThe Substance, so maybe the word we’re looking for is just “French.”)
As you’ve probably gathered, the film’s plot is a minefield of hot-button issues, told with the sensitivity you can expect from French septuagenarians. To name just one example: After an opening act filled with lurid cartel violence, Emilia Pérez gives us a comic number about gender-reassignment surgery. This sequence went over well at my tastemaker screening, where Jeremy O. Harris laughed uproariously through the whole bit, but it will undoubtedly hit different when clipped and posted out of context for thousands of people who have never heard of this movie before.
This is a recipe for chaos. There’s a world where the Netflix audience is as moved by the film as festivalgoers were, or one where viewers embrace the camp the same way they did with May December last year. There’s a world where the festival fairy dust wears off, the film underperforms with awards voters, and Emilia Pérez becomes a byword for Netflix’s misplaced largesse. And then there’s perhaps the most likely scenario, in which the film wins as many trophies as pundits predict it will, but in the process becomes this season’s official Oscar villain.
The first stirrings of a backlash are already here. Last month the CBC published a blog post declaring Emilia Pérez “a messy, insensitive, often baffling movie” and quoting a critic who dubbed it a “deeply evil monstrosity.” Those arguments have been repeated by a small but growing number of onlinedetractors. They’re calling it the worst thing a Frenchman has done in Mexico since Napoleon III!
There will be much to discuss about the film’s handling of trans issues. (I enjoyed Harron Walker unpacking the film’s assumption that, despite the title character’s crimes, the audience will “celebrate her solely for the fact of her transition.”) I’ll briefly note the haters are correct that the movie doesn’t have much to say about the lived experience of trans people. Emilia Pérez is not really about the trans experience, in part because Emilia Pérez is not “about” anything other than Emilia Pérez. This is a movie that exists in its own strange world. I can’t wait to see what happens when others come visit.
Oscar Futures: The Election Is Over. Now What?
Every week between now and January 17, when the nominations for the Academy Awards are announced, Vulture will consult its crystal ball to determine the changing fortunes in this year’s Oscars race. In our “Oscar Futures” column, we’ll let you in on insider gossip, parse brand-new developments, and track industry buzz to figure out who’s up, who’s down, and who’s currently leading the race for a coveted Oscar nomination.
Best Picture
Up
Wicked, Gladiator II, et al.
Apologies in advance: You signed up to read an Oscars column, not more election stuff. Unfortunately, for this exact reason, the studios decided to steer clear of the second weekend of November, which means there’s nothing else to talk about. Eight years ago, Hollywood positioned itself as a bastion of anti-Trump resistance, but I get the sense the vibes may be different this time around. Exactly how so, I’m not sure. There’s always a possibility that, in these troubled times, escapist blockbusters like Wicked, Gladiator II, and Dune: Part Two will find favor with a demoralized and weary audience.
Up
The Brutalist, Nickel Boys, Sing Sing, etc.
However, if Hollywood’s liberals once again want to send a message with their Oscar pick, which titles are best-positioned to benefit? The Brutalist offers a dark view of American society that could resonate under a Trump restoration, while Nickel Boys spotlights the victims of institutional violence. Then there’s Sing Sing, which offers an unvarnished look at the lives of incarcerated men alongside a comforting story of redemption — a spoonful of sugar that makes the messaging go down.
Current Predix
Anora, The Brutalist, Conclave, Dune: Part Two, Emilia Pérez, Nickel Boys, A Real Pain, September 5, Sing Sing, Wicked
Best Director
Up
Robert Eggers, Nosferatu
Egger’s Dracula revamp screened for the first time this week, and while we must take Twitter’s first reactions with the usual grain of (garlic) salt, the overall vibe is that this thing bloody works. The director’s impeccably crafted period pieces have collectively received only a single Oscar nomination — Best Cinematography for The Lighthouse — but if Nosferatu lights up the Christmas box office, we may be looking at a potent player in the below-the-line categories. Some pundits are even more optimistic, so I’m choosing to be positive.
Up
Coralie Fargeat, The Substance
We’ve seen in the past that the odds of a female filmmaker cracking Best Director are much higher when there’s one clear standout to rally around. In the event the election results spur voters to mark another ballot for a woman, the most likely candidate is Fargeat, who seems to have pulled away from the pack now that her body-horror comedy is one of the fall’s most talked-about films.
Current Predix
Jacques Audiard, Emilia Pérez; Sean Baker, Anora; Edward Berger, Conclave; Brady Corbet, The Brutalist; Denis Villeneuve, Dune: Part Two
Best Actor
Up
Cillian Murphy, Small Things Like These
One of the few films to brave a November 8 release date is this adaptation of the Claire Keegan novel. It’s a passion project for Murphy, who both produced the film and stars as a man unraveling after uncovering the horrors of the Magdalen Laundries. Alyssa Wilkinson calls his performance “unsurprisingly searing and nuanced … his panic showing up like lava pooling below a thin surface, ready to burst through at any moment.” The film might be a tough watch in present circumstances, but if voters can get past that, there’s plenty of room here for them to hand Murphy a victory-lap nomination.
Down
Sebastian Stan, The Apprentice
“You know when I’ll see that movie?” an Academy member said of the Trump biopic a few weeks back. “When he’s in jail.” Sorry to bum you out, but that’s not gonna happen anymore.
Current Predix
Adrien Brody, The Brutalist; Daniel Craig, Queer; Colman Domingo, Sing Sing; Jesse Eisenberg, A Real Pain; Ralph Fiennes, Conclave
Best Actress
Up
Saoirse Ronan, The Outrun
Ronan’s viral Graham Norton clip — in which she clapped back at some nice fellows who were being tone-deaf about women’s safety concerns — continued to make the rounds this week, and she keeps getting asked about it on the promo trail. It feels like both The Outrun and Blitz are losing momentum, so this kind of earned media is invaluable: However they may feel about Ronan’s films, voters get a fresh reminder of what a smart, likable presence she is.
Even
Cynthia Erivo, Wicked
Another week, another micro-controversy for the Wicked star, who used the platform of a New York Times interview to … shade the two unnamed actresses she auditioned alongside. I don’t think any of this will have much impact on her Oscar fortunes, but it is pretty funny that, whatever media training Team Wicked put their star through, none of it worked.
Current Predix
Karla Sofía Gascón, Emilia Pérez; Marianne Jean-Baptiste, Hard Truths; Angelina Jolie, Maria; Nicole Kidman, Babygirl; Mikey Madison, Anora
Best Supporting Actor
Up
Denzel Washington, Gladiator II
You gotta hand it to Denzel — he savors every syllable he gets in this movie. (At one point, my notes just became a list of words he made a meal of, from “dinari” to “politics.”) After finally catching Gladiator II this week, I have a hunch it may be a “tons of nominations, no wins” deal, but as long as Denzel’s in the race, the sequel will have a shot at this trophy.
Up
Stanley Tucci, Conclave
I’m not sure how Tuesday’s result will affect Conclave, an election drama that takes place in a fantasy world where scandals have consequences. But I confess there’s no character I’ve identified with more this week than Tucci’s exhausted cardinal, who puts a stop to his allies’ infighting with a frustrated “Enough! It’s too late for that now.”
Current Predix
Kieran Culkin, A Real Pain; Clarence Maclin, Sing Sing; Guy Pearce, The Brutalist; Stanley Tucci, Conclave; Denzel Washington, Gladiator II
Best Supporting Actress
Up
Emily Watson, Small Things Like These
Watson won the Best Supporting Performance award at the Berlin Film Festival for her turn as a villainous nun, which she plays “with the quiet yet despotic menace of a mafia don,” says Brianna Zigler. And as luck will have it, the British actress will soon be seen as a different kind of villainous nun, playing a reverend mother of the Bene Gesserit in the HBO spinoff Dune: Prophecy. You may have forgotten that Watson is a two-time nominee. Does the struggling Lionsgate have enough in the tank to power her Oscar comeback?
Up
Lily-Rose Depp, Nosferatu
Surprise, surprise — many of the early Nosferatu reactions are spotlighting Depp, who’s got the Winona Ryder/Isabelle Adjani/Greta Schröder role of the vampire’s muse. Variety’s Clayton Davis calls her “haunting,” while others say it’s her career-best work. Which I suppose is just another way of saying it’s better than The Idol, but still: Is this the start of the Lily-Rose Depp redemption tour?
Current Predix
Danielle Deadwyler, The Piano Lesson; Felicity Jones, The Brutalist; Saoirse Ronan, Blitz; Isabella Rossellini, Conclave; Zoe Saldaña, Emilia Pérez
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();
// ]]