Let me know if you have a better idea for a name...
This was created for preparing files in marketing_assets for some of the other transforms we have such as global-assign-to-default-export, etc...
It takes in your appGlobalIdentifiers (such as ShopifyMarketing) and lifts the code from inside the IIFE to the module root. It looks at the return statement inside the IIFE and assigns that + members of the returned object to the global identifier.
If the naming of the return identifier is inconsistent, it uses the property identifier found on the global object rather than the return identifier used inside the IIFE.
Let me know if you have a better idea for a name...
This was created for preparing files in
marketing_assets
for some of the other transforms we have such asglobal-assign-to-default-export
, etc...It takes in your
appGlobalIdentifiers
(such asShopifyMarketing
) and lifts the code from inside the IIFE to the module root. It looks at thereturn
statement inside the IIFE and assigns that + members of the returned object to the global identifier.If the naming of the return identifier is inconsistent, it uses the property identifier found on the global object rather than the return identifier used inside the IIFE.
Every module in
marketing_assets
and other marketing properties are written using this pattern: https://github.com/Shopify/marketing_assets/blob/master/app/assets/javascripts/marketing_assets/modules/accordion.js