adobe / adobe/reactor-sandbox

Transforms are preformed when saving the extension configuration and not when building the library.

Open
#86 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9
Forks
11
PR merge metrics
No merged PRs in 30d

Description

While working to add the functionality to use array based paths in remove transforms (#85), I noticed that the transforms were being applied at the wrong time inside the sandbox.

### Expected Behaviour

The sandbox should mirror the behavior of the live system. Specifically, transforms should be executed when the library is built, and not when the library is saved.

### Actual Behaviour

Transforms are only executed when saving the library. This creates problems because the UI of our extension configuration uses certain fields that are removed from the build using transforms. Editing a saved extension then does not have these properties, whereas in the live system these properties are available.

Further we would like to use the sandbox to run automated tests, so having these differences reduce our confidence in the tests. We recently published an extension that had a bug which was solved by adding the correct transforms. We'd like to be able to catch these kinds of errors in automated tests in the future.

### Reproduce Scenario (including but not limited to)

I reproduced this issue by running the AEP Web SDK extension in the sandbox with (#85) applied to the sandbox. (changing the package.json of the AEP Web SDK extension to point to a local copy of the sandbox).

#### Steps to Reproduce

When saving the extension, the "sandbox" properties are not saved in the container.js file.

#### Sample Code that illustrates the problem

https://github.com/adobe/reactor-extension-alloy/blob/9cebcefd8e09376b9eff7d01f5fae4f4e0b5e036/extension.json#L122

### Existing flow
```mermaid
flowchart TD
A[editor-container.js] --> B
B[Add buildInfo] --> C
C[Apply transforms]
D[Add extension code] --> E
E[Stringify] --> F
F[Add turbine code] --> G
G[(launch.js)]
C --> H
C --> I
H --> D
H[(container.js)]
I[(/files)]
H --> J
I --> J
J --> A
J[Untransform]
```

### Proposed flow
```mermaid
flowchart TD
A[editor-container.js] --> H
B[Add buildInfo] --> C
C[Apply transforms]
D[Add extension code] --> E
E[Stringify] --> F
F[Add turbine code] --> G
G[(launch.js)]
C --> I
C --> D
H[(container.js)] --> A
H --> B
I[(/files)]
```

Contributor guide

Open the contributing guide

Research direction

Start with editor-container.js and trace the existing save/build flow shown in the issue, including container.js, /files, and launch.js. Compare it with the proposed flow to identify when transforms are applied and reversed. Done means transforms run when the library is built while sandbox properties remain available when an extension configuration is saved and edited.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.