-
Notifications
You must be signed in to change notification settings - Fork 3
feat: ACNA-3098 - allow action invocation of ES Modules / Typescript #87
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #87 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 7 +1
Lines 569 647 +78
Branches 125 132 +7
=========================================
+ Hits 569 647 +78 ☔ View full report in Codecov by Sentry. |
moritzraho
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, but didn't test
|
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
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: |
|
@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. |
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 latencyremove the use of the magic string for the built action code inWe can't do this, since aio-lib-runtime uses this magic string and does not expose itdist, we may have to call the lib to build the actions directly, and not useaio app build. See this.typescript, ts-loaderand have a customwebpack-config.js(see example project and the docs). Any includes/excludes should be intsconfig.json.tsconfig.jsonshould have the optionsourceMap: trueHow Has This Been Tested?
aio plugins install https://github.com/adobe/aio-cli-plugin-app-dev#story/ACNA-3098git clone https://github.com/shazron/test-debugger.git(from this repo)cd test-debuggeraio app devin the cloned repo folder ORaio plugins uninstall @adobe/aio-cli-plugin-app-devTesting 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-3098aio app devin the your app root OR VS Code debug via the Debug Tabaio plugins uninstall @adobe/aio-cli-plugin-app-devTypes of changes
Checklist: