Closed shazron closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
65d1190
) to head (45dcad4
). Report is 1 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Do the actions all have to be built on change, previously they were only ever loaded on demand? Has this been tested with multiple actions referencing the same code? ie.
actions:
myaction18open:
function: actions/myaction/index.js
web: 'yes'
runtime: nodejs:18
inputs:
LOG_LEVEL: silly
annotations:
require-adobe-auth: true
final: true
myaction20secure:
function: actions/myaction/index.js
web: 'yes'
runtime: nodejs:20
inputs:
LOG_LEVEL: verbose
annotations:
require-adobe-auth: false
final: true
Do the actions all have to be built on change, previously they were only ever loaded on demand?
If you want the user to potentially wait a few seconds (ok maybe 1 second typically) before they get a response when calling a URL, for webpack to do its thing, we can make it "on-demand". We will not do it everytime of course, but we will need to set a "dirty" flag for that action to signify that a change was done - if "dirty" we need to webpack first before serving to the user.
This new behavior is exactly what we do for aio app run
(minus the deploy
of course - since building in this case is "deploying")
Has this been tested with multiple actions referencing the same code?
I just tested it, it works fine. This is because it will use the module.require cache, like it did previously.
This pr can be tested directly by running:
aio plugins install https://github.com/adobe/aio-cli-plugin-app-dev.git\#story/ACNA-3098
@purplecabbage do we need to do anything more for this?
In my simple project with 30 actions, this introduces a full minute wait before we accept user input. Essentially all users are forced into a build step even if their code can simply be run.
There are all kinds of ways that this could be better, for example
This breaks hot-reloading of actions, the delete require.cache[temp] is not functioning. When we require('/dist/dx-excshell-1/actions/manyactions/sleeper-temp/') what actually gets added to the cache is ...manyactions/sleeper-temp/index.js so when we try to delete it, we need the same fully qualified path/key
closes #69 closes #42
Enables ESM and TypeScript support for action code, via webpack.
Pre-requisite PRs
Related PRs
TODO
aio app run
). See this. This may introduce latencydist
, we may have to call the lib to build the actions directly, and not useaio app build
. See this.~ We can't do this, since aio-lib-runtime uses this magic string and does not expose ittypescript, ts-loader
and have a customwebpack-config.js
(see example project and the docs). Any includes/excludes should be intsconfig.json
.tsconfig.json
should have the optionsourceMap: true
How Has This Been Tested?
aio plugins install https://github.com/adobe/aio-cli-plugin-app-dev#story/ACNA-3098
git clone https://github.com/shazron/test-debugger.git
(from this repo)cd test-debugger
aio app dev
in the cloned repo folder ORaio plugins uninstall @adobe/aio-cli-plugin-app-dev
Testing in your App
.vscode/launch.json
, see: https://developer.adobe.com/app-builder/docs/guides/development/#debugging-with-vs-codeaio plugins install https://github.com/adobe/aio-cli-plugin-app-dev#story/ACNA-3098
aio app dev
in the your app root OR VS Code debug via the Debug Tabaio plugins uninstall @adobe/aio-cli-plugin-app-dev
Types of changes
Checklist: