From hurt feelings and debt to legal battles and harassment, risks come with committing by combining DNA.
ByEmi Nietfeld,
writer and co-host of ‘This Alien I Grew,’ a parenting podcastShe has written for the New York ‘Times,’ ‘The Atlantic,’ the Washington ‘Post,’ and more. Nietfeld publishes a monthly Substack, ‘Post-Mortem’; her memoir, ‘Acceptance,’ was named a best book of 2022 by NPR.
Photo-Illustration: The Cut; Photos: Getty
Photo-Illustration: The Cut; Photos: Getty
When she was 29, Jennifer and her boyfriend of two years weren’t ready to get married. So he proposed an alternative: freezing embryos together to cement their bond. They would split the $20,000 cost. “It was a symbol of how committed he was to me,” Jennifer thought. She said “yes.”
For Jennifer, the trouble started shortly before her first shot of high-dose ovary-stimulating hormones when her boyfriend confessed he had cheated on her on multiple occasions. Now five months deep into planning, Jennifer felt trapped and manipulated, especially since he’d brought up the idea of merging genes while hiding his infidelity.
She wasn’t sure she wanted to break up, but “if I had said ‘no’ to embryos at that point, it was a symbol that our relationship was dead.” Jennifer went ahead with the procedure and used half of her retrieved eggs to create and freeze 20 embryos. Two years later, when Jennifer pushed for a proposal, her boyfriend dumped her: “He decided he didn’t want me to be the mother of his children.” Jennifer was devastated. “I’m going through the seven stages of grief,” she told me eight months later. “Not about him but about my embryos.” Her ex offered that he’d be open to letting her use their embryos in the future, a suggestion Jennifer found offensive. For now, they’re frozen with Jennifer’s eggs; eventually she and her ex plan to have them destroyed.
In hindsight, Jennifer felt that her ex’s proposition “was just a way to extend the timeline or appease me, whether it was done maliciously or not.” She said she has multiple friends in similar positions: “This whole trend of embryo freezing as an extension and a stand-in for commitment fucking needs to stop.”
But for many couples, fertility preservation is now a standard part of building a future. Today, with more people meeting later in life or delaying child-rearing, embryo freezing has become a popular option as both an “insurance policy” and a symbol of commitment. (Vanderpump Rules stars Ariana Madix and Tom Sandoval spent several episodes pursuing it before their breakup made international headlines.) But it also puts women’s bodies, choices, and freedom at inordinate risk — particularly as a recent Alabama Supreme Court ruling has classified embryos as “children” with other states poised to follow suit.
For some, the consequences can transcend heartbreak and wasted cash — even when embryos don’t make it to the finish line. When Mallory turned 40, she and her boyfriend of one year started getting serious. Mallory, who asked to be identified by a pseudonym, had previously frozen her eggs and was eager to fertilize them with her partner’s sperm before they got older. “Instead of the horse and the cart and the baby carriage,” she told me, “we went straight to the baby carriage.”
Mallory works in sales at a fertility start-up, so she thought she understood what could go wrong and how to protect herself. She said she hired a lawyer to write up a document stating that if her partner died or they parted ways, she’d have ownership of their embryos, which her boyfriend signed. Typically, clinics have patients check a box declaring what to do with embryos in case of separation or death, but that doesn’t necessarily prevent custody disputes, such as the one between actress Sofia Vergara and her ex-husband, who wanted to bring their two frozen “girls” to life against Vergara’s will. A year after Mallory’s boyfriend gave his sperm sample, with no embryos created, they broke up. Little did she know that, even though they never ultimately combined DNA, she’d wind up embroiled in a 16-month-long legal battle that would cost her over $100,000.
Shortly after the split, Mallory’s ex began stalking her: “He was constantly calling, texting, showing up wherever I was.” After she received an order of protection against him, he contacted the fertility clinic. Mallory said his lawyer demanded that because the embryo process had started, he should get control of her previously frozen eggs. “It didn’t make sense, because they’re my eggs,” she said. Court-ordered to stay away from Mallory, “the legal issues with the DNA were his only hold.”
Mallory hired an attorney, who went back and forth with her ex’s for 16 months before ending in mediation and a six-figure bill. She showed me two moving boxes filled with court documents. “You need to think about all of the choices,” Mallory said, “and what those choices mean if things go south.”
Dr. G. Donald Royster IV, a partner at the Southern California Center for Reproductive Medicine whose office displays a vanity plate reading BABY MKR, said he has seen an uptick in couples freezing embryos for future use. He estimates that the majority of couples he treats are unmarried, though he doesn’t ask and rarely knows: “Clinically, it’s irrelevant.”
But why do couples create embryos instead of freezing eggs and sperm separately?
“If you have a partner, freezing embryos is infinitely better,” Royster said. During consultations with potential patients deciding their course of treatment, he cites a 2023 paper in Fertility and Sterility suggesting that fresh eggs led to twice as many embryos as the same number of thawed eggs: “When you thaw a frozen embryo in our clinic, it survives 99.5 percent of the time, whereas a frozen egg can have a 50 percent to a 90 percent [chance of] survival.” This also means that, to get the same number of embryos through frozen eggs, a woman needs to go through twice as many painful, inconvenient egg-retrieval cycles, doubling the toll on her body at twice the cost. Creating embryos is particularly attractive, Royster said, because a growing number of insurance plans are covering IVF — but many of those plans do not cover egg freezing. “If a woman is coming in and egg freezing isn’t covered but she has a partner, she can preserve fertility but bill it as infertility coverage,” potentially saving her $18,000 to $30,000 a cycle.
Royster’s advice? “If you’re married and together, freeze embryos. That’s going to give you the best chance at success 100 percent of the time.”
But discussions of commitment don’t come up in the fertility clinic. Of the 11 women I spoke to, only two told me their doctors brought up the possibility of breakups; none mentioned what might happen to the embryos if their relationship ended. According to Jennifer, “This is not something we talked about at all.” Laura Grubb, a Canadian who froze embryos after treatment for thyroid cancer, told me, “There was absolutely no counseling provided to me beforehand.” Another woman said, “We literally never had that conversation.”
Suggesting how things could go wrong deters potential clients. The fertility services boom is a multibillion-dollar, for-profit endeavor, increasingly owned by hedge funds and venture capitalists. (Royster’s clinic is part of a conglomerate backed by Morgan Stanley’s private-equity arm.) Often, clinics feel like it with women complaining that they were ushered through “baby factories” and “assembly lines” that prioritize the bottom line over their interests.
Even the benefit of creating embryos may be overstated. When Royster tells patients that fresh eggs work twice as well as thawed ones, he’s citing a study that includes eggs frozen as early as 2005, using primitive methods. Recent improvements in vitrification techniques have led other doctors to conclude that outcomes from fresh and recently frozen eggs are not significantly different.
At Royster’s clinic and most others, the question about what to do if a couple separates is contained in a single form, buried among medical consents, explanations of risk, and surgical protocols. He told me separations happen but that they don’t cause issues for his practice. Clients’ embryos are in long-term storage, managed by a third party. Royster only hears from heartbroken patients when they’re coming back to preserve new tissues.
A year into dating, 34-year-old Kitty and her boyfriend started discussing life plans: “marriage, kids, moving in together, egg freezing.”
Kitty initially planned to freeze eggs. Her clinic suggested that, since she had a partner, they create embryos. Her boyfriend agreed to provide sperm. “It really gave me the confidence that he was in this for the long haul,” Kitty said. “It showed what I thought was a dedicated commitment to our future together.”
Kitty footed the $11,000 bill. Then she was stunned by the painful, grueling process: “You’re pumping your body with so many hormones and chemicals over and over and over, and for me, I just felt like I was going insane.” The side effects weren’t only physical. They spilled into “how I felt about myself, my decision-making, my depression and anxiety, my motivation, concentration — everything.” Men are almost as likely to cause infertility, but all her boyfriend had to do was masturbate into a cup.
Eight months after creating embryos, on their two-year anniversary, Kitty’s boyfriend dumped her “completely out of the blue.” The clusters of cells that once represented her boyfriend’s dedication now seemed like an emblem of his betrayal. Kitty and her ex haven’t discussed what to do. They live in Louisiana, which currently bans the destruction of frozen embryos, so they had their embryos shipped for storage in Texas. She plans to simply stop paying the $1,200 annual storage fee, hoping that eventually the abandoned tissues will be donated to science, freeing her from the burden of dealing with them. But what if the law in Texas changes, as it has in Alabama?
Michele Goodwin, a professor of reproductive law at Georgetown University, described the Alabama ruling as “a potential living nightmare” that could lead not only to wrongful-death cases for destroying or damaging embryos but also to forced implantation. “The next step in this kind of logic is that embryos must have a place where they implant and fertilize” as part of their “right to life.”
As to whether other states may follow suit, Goodwin warned, “This won’t be the last of it.” Royster has seen an uptick in patients flying in from southern states for treatment.
But even in the most liberal environments, women who freeze embryos with a partner may encounter unexpected issues. Carly, a 43-year-old attorney in Long Beach, California, was single when she selected several sperm donors and created frozen embryos. Shortly after, she started dating a man seriously. Together, they created and froze two rounds of embryos using his sperm, none of which was viable. After they broke up, Carly decided to become a single mother by choice. She contacted her clinic to implant one of the embryos she had made with donor sperm. The clinic said “no”; she needed her ex’s permission.
Carly remembered them telling her, “We need you to get a notarized statement that he gives up his rights to the embryos.” She was incredulous: “You’re going to make me get an affidavit from him for something that I paid for?”
The clinic’s attorney eventually allowed her to use the embryos she’d previously frozen: “But it could’ve easily gone either way.”
“I’m a lawyer, so this is scary. So much of this can be decided by a single judge,” Carly said. If an ex wants to take revenge, she warned, “it doesn’t matter if it’s in a contract — they can dispute it later.”
Jennifer was also shocked by her clinic’s restrictions, which required her ex’s consent to destroy their existing frozen embryos before she could move her eggs across state lines or create new embryos. “What if this was a totally different couple who were not copacetic?” she wondered. “That could literally keep a woman hostage.”
Although Jennifer’s experience was isolating, she soon learned she’s far from alone. During her first Hinge date post-split, Jennifer found herself unloading her story. To her surprise, her date had also recently made embryos with an ex and felt gutted when the relationship died.
For a while, Jennifer swore she’d never again combine her DNA with a man’s in a petri dish — at least not until she was ready for kids. She planned to freeze her eggs one more time “as a symbolic end to this nightmare.”
Yet a year after her breakup, Jennifer has selected a diamond and is finalizing her engagement ring, preparing to marry her new boyfriend. But first they are freezing embryos.
By submitting your email, you agree to our
Terms and Privacy Notice
and to receive email correspondence from us. This site is protected by reCAPTCHA and the Google
Privacy Policy and
Terms of Service apply.
or
Already a subscriber?
What is your email?
This email will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
Password must be at least 8 characters and contain:
Lower case letters (a-z)
Upper case letters (A-Z)
Numbers (0-9)
Special Characters (!@#$%^&*)
This password will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
You’re in!
As part of your account, you’ll receive occasional updates and offers from New York, which you can opt out of anytime.
or
Already a subscriber?
What is your email?
This email will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
Password must be at least 8 characters and contain:
Lower case letters (a-z)
Upper case letters (A-Z)
Numbers (0-9)
Special Characters (!@#$%^&*)
This password will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
You’re in!
As part of your account, you’ll receive occasional updates and offers from New York, which you can opt out of anytime.
Already a subscriber?
Already a subscriber?
`;
// integrate Sub(x) scripts and elements
if (hostname !== 'subs.nymag.com') { // do not integrate on this subdomain
document.head.appendChild(trackingScript);
document.body.insertAdjacentHTML('beforeend', subXAnimationElements);
}
There was an error processing the request. Please try again later."}).catch(e=>console.error("Error verifying email: ",e)))(r.querySelector(".content"),o.bannerCTAVerification)})):(l.remove(),s.remove()),o.dismissable||n.remove(),o.useAlertIcon||a.remove(),r.classList.add("show"),n.addEventListener("click",()=>{u(),r.classList.remove("show")})}else r.remove()}});
}, {"3":3,"6":6,"17":17,"35":35,"40":40}];
window.modules["global-nav.client"] = [function(require,module,exports){"use strict";const dom=require(4),auth=require(17),signInButton=dom.find(".user-signin"),signOutButton=dom.find(".user-signout"),globalNav=dom.find('[class^="global-nav"]'),body=dom.find("body"),dropdownItems=dom.findAll(".dropdown-wrap"),gtm=require(3),appendLandingPageParams=require(135),pageUri=require(124).getPageUri(),subscriptionPromoLinks=dom.findAll(".persist-params"),searchString=window.location.search||"";function closeDropdowns(e){let n=globalNav.querySelectorAll(".dropdown.open");dropdownItems.forEach(function(t){let i=t.querySelector(".dropdown");!n||t.contains(e.target)&&27!==e.keyCode||i.classList.remove("open")})}function gtmSendReport(e,n,t){let i={eventCategory:"ecommerce",eventAction:"componentClick",brand:e,dimension23:"global-nav",list:pageUri,pageZone:"header",variant:"nav-link"};"global-nav-link"===t&&(i.eventLabel=n.href),gtm.reportNow(i)}function updateElementTargetUrlsIfQueryStrings(e){if(searchString){const n=new URLSearchParams(searchString);let t=e.href;if(t.includes("?")){const i=t.split("?"),o=new URLSearchParams(i[1]);for(let e of n.entries())o.set(e[0],e[1]);t=`${i[0]}?${o.toString()}`,e.href=t}else e.href=`${t}?${n.toString()}`}}function init(e){const n=e.querySelectorAll(".to-landing-page");window.addEventListener("auth:init",()=>{signInButton.addEventListener("click",function(e){e.preventDefault(),auth.showEmbeddedLoginFlow("top navigation")}),signOutButton.addEventListener("click",function(e){e.preventDefault(),gtmSendReport("Sign Out",e.target,"user-info-link"),auth.logout()}),auth.isAuthenticated()&&e.classList.add("signed-in"),(auth.isSubscriber()||auth.isMobileAppRequest())&&e.classList.add("subscribed"),e.querySelectorAll(".user-link").forEach(e=>{e.classList.add("active")}),subscriptionPromoLinks.forEach(e=>{updateElementTargetUrlsIfQueryStrings(e)}),appendLandingPageParams(n)})}dropdownItems.forEach(function(e){e.addEventListener("click",function(){e.querySelector(".dropdown").classList.toggle("open")})}),body.addEventListener("click",closeDropdowns),document.addEventListener("keydown",closeDropdowns),globalNav.addEventListener("click",function(e){let n=e.target;n.classList.contains("global-nav-track")&>mSendReport(n.text,n,"global-nav-link")}),module.exports=init;
}, {"3":3,"4":4,"17":17,"124":124,"135":135}];
window.modules["aaa-module-mounting.legacy"] = [function(require,module,exports){"use strict";const _pickBy=require(221),_each=require(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(106),_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()})}}]);
}, {"106":106,"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","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();
// ]]