Pedro Almodóvar Can’t Talk About His New Movie (But It Will Be About Death)
ByRachel Handler,
a features writer at Vulture and New York
The director says he is following up his gay-cowboy short with a mysterious film “about two women in a very intimate situation.”
Photo: Loic Venance/AFP via Getty Images
This article was originally published in May out of the Cannes Film Festival. We are recirculating it now, timed to Strange Way of Life’s theatrical debut.
A powerful combination of pouring rain, unchecked queer lust, rabid Pedro Almodóvar fandom, and institutional Cannes Film Festival failure made Wednesday afternoon’s premiere of Almodóvar’s latest, Strange Way of Life, a bit of a shitshow. At the much-anticipated screening of the Spanish auteur’s new western — a 31-minute short starring Ethan Hawke and Pedro Pascal as ex-lovers who meet back up in the desert for a hot night and a gun duel, 25 years after their torrid affair as young pistoleros — dozens (and “perhaps even hundreds”) of ticket-holders stood outside for an hour, getting soaked before being turned away at the door. Most of those who did manage to catch the movie (including me) loved it: It’s an appropriately melodramatic, sexy little tale of gay desire, regret, and seduction that features erotically charged glances between two of our best actors, moody standoffs with and without pistols, chic Saint Laurent looks, and a post-coital shot of Pascal’s bare tush.
On Friday morning, the festival relented and added a few more screenings of the short film just before I met Almodóvar on a rooftop in yet another rainstorm. Clad in a gray sweatshirt and jeans, Almodóvar ordered a cappuccino and chatted about how he was “dying to see” that evening’s screening of Jonathan Glazer’s Zone of Interest (and also told me he’d tried to get the rights to the novel Under the Skin years back, but they’d already been snapped up by Glazer). We talked about the Strange Way of Life screening drama, his upcoming English feature that he’s shooting in New York, whether or not Cate Blanchett is angry with him for backing out of directing A Manual for Cleaning Women, how he and Hawke and Pascal all had to “mutually adapt” to one another’s working styles, and if he purposefully cast his short with actors so absurdly attractive that the premiere looked a bit like, as he joked, a “Playgirl cover.”
I got an email this morning that you’re doing more Strange Way of Life screenings. Did you ask for that to happen? Yes, I asked for that. Cannes director Thierry Fremaux said to me that he would try, and now it’s real. I was very sorry for the people outside, and for the journalists. Because it was in the rain, and the French character is very rude.
They are famously rude at this festival. You’ve been coming here forever. Has it gotten worse? They treat me very, very nicely. But I see the way they treat the others. And they are very rude! Now, they are very angry in general in France. They are protesting, and they have a right to, and they have a lot of problems. But the French character is very angry. I studied French when I was a child, but I don’t dare to speak any French here. Not a single word. Because they look at you like that [makes an exaggeratedly mean face].
Outside of the kerfuffle, how are you feeling about the reception in general? The response was great. For a director, this first screening is really important. When you see the movie with so many people, even just to listen to how they breathe, how they’re feeling at different moments. I thought it was not so funny, but they were laughing! It’s definitely funny at times, but I felt after I talked with friends who hadn’t seen the movie yet, they only knew it was about two gay cowboys, and they didn’t expect that type of movie. The sensuality of the movie is more in the words they use, the way they look at each other, and that came across very strongly, so I was very satisfied.
People already want you to make a full-length version, and you wondered about it onstage after. Will you? They all wanted more. But I deliberatelywanted to make something very abstract. To take these two characters, put them in the middle of the movie, and show how men desiring other men react to each other. They are there to fuck, but there’s another intention. They give themselves that one night break, but the day after, they come up with their real intentions. The sheriff is extremely cold and hermetic; if he could, he’d completely deny what happened, which is a very male reaction to desire. But as for Silva, he’s the exact opposite. He really wants. He’s extremely sentimental, and he wants to drive Jake to this romantic relationship and then ask him for this favor. It’s a long story, but I wanted it to be very concentrated.
Curiously, all of them think that Ethan Hawke should remain with Pedro Pascal, and they’d live like a couple. But that was not my idea. The character of Ethan is very angry and he’s wounded, so he’s bound to Pedro temporarily. There’s a kind of peace — he’s watching the sunset, the horses — but he isn’t going to stay. Immediately after, when he is strong enough to get out of the bed, he would have a big fight with Silva, who would be seriously wounded. Jake would then go to Mexico to look for this crazy guy with a gun. It would be more adventure, and Silva, when he recovered from the fight, would come to look for both of them. But I need a lot of decorations in Mexico for all of that, so I don’t think I’ll do it. I know how it would go after that, but I won’t make it, not for the moment. I’m working on something different.
What are you working on? My brother, who is around here, has forbidden me to say anything.[Laughs.] But it will definitely be a movie in English, and it’s about two women in a very intimate situation. Very deep and intense, and dangerous. It’s an incubated story in New York, with these two women and one man. I can’t say anymore.
When will you film it, this summer? I wanted to do it in October, but last November we were in New York and the light in the fall in New York is like five hours maximum every day. This is too little time to shoot. And the two leads are busy until August. So we’re making the locations now and I think we’ll have to wait until March to do it.
You and I spoke for your upcoming book accompanying your Academy Museum exhibit, in which you divide all of your work into themes that repeat throughout your career, like “mothers” and “desire” and “noir” and “guilt and pain.” Which theme would you slot this new film into? It’s about something very important: death. And friendship, a deep feeling of friendship. Death is one of the protagonists in the film. Life and death are eternal issues in many movies, but this is the first time that I treat the situation like this.
How does your process differ when you’re writing in English? Do you write it all in Spanish and then translate it, or start in English? I write it in Spanish, and then when I finish the script completely, it’s translated into English and then, once it’s translated — because I don’t want it to sound translated — I give it to an author, a real writer, to make it more common. Sometimes it sounds too literal in translation. I’m very insecure about languages. And this is a contemporary movie, so I wanted it to sound contemporary. In Spain, the language is always changing; in ten years, if you compare how we talk now and how we talked before, there’s new colloquial language, new expressions to pay attention to. I suppose that happens in English, too.
You recently said that you left the Lucia BerlinA Manual for Cleaning Womenadaptation with Cate Blanchett because you weren’t ready to direct it in English; it was too complicated. What did you learn from making this short in English that now makes you feel ready to do this next English feature? They’re really different stories. Not in the sense of what’s happening, but in terms of production. The Blanchett movie became a big production, and I didn’t think I could do such a big project. Also, it was a period piece, and I am very obsessed with everything that’s in front of the camera. Sometimes I take little things from my home or from stores, but for a movie that’s a period piece, they have to make everything. And that gave me a lot of insecurity, because I couldn’t control it; it’s not my culture. I felt very weak in front of these things. Most of the movie would be shot in a big studio, and I’m an artisan. I do everything with my hands. And in this case, I couldn’t.
When I was making this western, I was thinking all the time about the Cate Blanchett project. And I thought that it was taking me to too many places: to Oakland, to San Francisco, to Mexico. Even though we’d make the interiors in one studio, it meant a lot of traveling. I had surgery on my back, and I go to L.A. once a year and it’s really very painful to fly. Half of my back is immobilized by metal and screws, so if I don’t find the right angle for 12 hours, I can’t sleep. It’s silly to say that that’s why I can’t make a movie, but a movie is very physical. I prepare like an athlete to be in good shape. And this new one is much smaller. It doesn’t mean it will be easier. But for me, I can manage it. Because I specialize in working with two or three characters deeply.
I am very sorry for Cate. She was very generous with her house of production, and within the sale. The script is there; they have it, and I wrote it, and I was very glad. But I had to be honest and say that I couldn’t do it. It was a pity because I was completely in love with the script and ready to work with Cate, who is great.
But you’ll work with her again? I hope so. I don’t know if she’s very angry or not. I don’t know.
You can see her here and ask! I know, she’s here. I’m tempted just to give her a call. I want to see how she is reacting. At the beginning she was devastated, but she is intelligent and she understood.
I want to talk a bit about the casting of Strange Way of Life. You first met Pedro Pascal after he did King Lear in New York, right? What was that conversation like? Yes. I was in town promoting something in New York, but before that, when he was doing Narcos, he’d worked with a lot of Spanish actors in Columbia. They’d send me videos with him, and Pedro was very nice, but nervous: “I grew up watching your movies! I hope to see you somewhere.” And that place ended up being in New York when he was working with Glenda Jackson on King Lear. We became very close. For this movie, I called him directly and said, “I’m going to send you a script and you tell me how you see it.” He immediately said, “This is one of my dreams, to work with you.” That’s something actors often tell you. I don’t always believe them.But he had told me that two years earlier, and it was true: When I sent him the script, and mentioned that the other actor was Ethan, he said, “Oh, I love him. I’d really like to work with him.” And Ethan was the same. They respect each other very much.
What kind of work did you do to help them create the chemistry that drives the film? Fortunately they had immediate chemistry. At the beginning, we had to do a week or so of mutual adaptation. Both of them are not typical Hollywood actors; they’re adventurers. But I could see that they worked differently — American actors, I don’t know quite how to explain it, but they prepare characters in a different way than I’m used to. I want to always rehearse and they’re both accustomed to that, because they both do theater, but what I see is that American actors don’t rehearse a lot. I got this feeling that they did it because I asked them to. So we needed to adapt, the three of us.
How specifically did you adapt? I explained every single line and what was behind it. Sometimes things aren’t so obvious as they are in your mind. I wrote a new script, saying exactly what was behind every single line. It was a lot of work to do. But I prefer it. I cannot be misunderstood. And I saw that it was good for them, because they were then much closer to my intentions. Ethan, when he was concentrating, he needed to be in silence. That’s impossible when you’re shooting, because there are many people working around you. I understood that — it’s almost painful to be concentrating when there are people working and talking around you in a language that you don’t understand. And Pedro understood everything. He doesn’t speak good Spanish. [Laughs.] He couldn’t make a movie in Spanish, but he understood.
When we were shooting, they grew up a lot — their performances were much bigger than in the rehearsal. In rehearsals, I tried to get the maximum, but rehearsals are always imperfect. But the difference between rehearsals and the set, they were incredible. We now have a good relationship and we trust each other, the three of us. And I think I will work with them again. I got that feeling.
You made a joke onstage at the premiere about the film’s younger cast, specifically, being “beauties.” The whole cast, even down to the sheriff’s deputy, is hyperbolically hot. Did you cast it that way purposefully? It’s true.I was, at first, surprised. There were two casting directors looking for young Spanish actors who also speak English. The lighting of a casting video is always awful. You can see the people, but not well, and when they came into my office, I said, “My God. You are so hot! All of you!” [Laughs loudly.] We all felt like the hunchback of Notre Dame. The casting directors made wonderful decisions. When you see the young actors together, all of them, it’s like a beauty contest. Some friends of mine afterwards sent me a message: “Pedro, this is like the cover of Playgirl.”
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();
// ]]