Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose helpers as shared module and usable while writing custom code #5

Open
alcazes opened this issue Oct 10, 2019 · 7 comments
Open
Labels
accepted It's on the backlog enhancement New feature or request

Comments

@alcazes
Copy link

alcazes commented Oct 10, 2019

I am working on a private extension at the moment and I noticed that the core extension already provides specific helpers methods that I would like to reuse as sharedModules and as helpers when I wrote custom code in rule and data elements.

I am interested in the following helpers:

I am aware that variables and valueComparison are both linked to specific conditions but it would be ideal to move them to helpers.

Ideally once exposed the use will be:

  • when writing private extensions use turbine.getSharedModule('core', 'getObjectProperty'); to reuse in code to avoid writing similar code for same purpose
  • in configuration add an option to expose helpers to window._satellite.helpers.getObjectProperty to reuse in custom code section in Adobe Launch rules and data elements
@alcazes
Copy link
Author

alcazes commented Oct 10, 2019

At the moment I copied the helpers inside my private extension build, this leads to redundant code that is why I would like to use sharedModules capabilities and expose to window

@Aaronius
Copy link
Contributor

Thanks @alcazes! I understand your desire to have these as shared modules. There are some downsides to having them as shared modules at the moment that we'll need to take into consideration. If the code were exposed as a shared module, it will always be included in all Launch libraries for all Launch properties that have Core installed, regardless of whether the code is used in the library or not. This is because the system that builds the Launch library isn't smart enough to know if another extension in the library is actually using the shared module (e.g., makes a call to turbine.getSharedModule('core', 'getObjectProperty');), so it always includes the shared module code just in case. On the other hand, if the code is not exposed as a shared module, it can be trimmed based on the features of the Core extension that a particular library might be using (see https://medium.com/adobetech/build-optimization-through-minimal-inclusion-87ea637e174f for more info).

We want to eventually improve the build process in such a way that we could determine whether a shared module is actually being used by another extension in the same library and, if not, exclude the shared module code from the library builds. Until then, I think this issue will need to stay open because the cost to everyone's library size would be too great for the potential benefit received.

@thebenrob thebenrob added enhancement New feature or request logged waiting-for-launch We're trying to decide what to do labels Sep 3, 2020
@thebenrob thebenrob added accepted It's on the backlog and removed waiting-for-launch We're trying to decide what to do labels Sep 16, 2020
@thebenrob thebenrob removed the logged label Sep 24, 2020
@thebenrob
Copy link

@adobe export issue to Jira project PDCL

@github-jira-sync-bot
Copy link

✅ Jira issue PDCL-6236 is successfully created for this GitHub issue.

@alcazes
Copy link
Author

alcazes commented Mar 21, 2022

Checking in to make sure this request has not been forgotten.

Some of our platform have raised that Adobe launch seems to be one of the biggest library to load initially so at the moment every kb counts.

@mems
Copy link

mems commented Jul 19, 2024

I would like to add load-script to the list of shared module usable in custom code.
I.E. something could look like _satellite.loadScript(), like we have _satellite.cookie.set() for cookies.

@alcazes
Copy link
Author

alcazes commented Aug 13, 2024

I would like to add load-script to the list of shared module usable in custom code. I.E. something could look like _satellite.loadScript(), like we have _satellite.cookie.set() for cookies.

At present I was able to achieve this using a private extension:

image

But it would be great if it was available out of the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted It's on the backlog enhancement New feature or request
Projects
Status: Incoming
Development

No branches or pull requests

5 participants