-
Notifications
You must be signed in to change notification settings - Fork 41
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
feat: custom transform for bundling and running suites #687
feat: custom transform for bundling and running suites #687
Conversation
d94c0e1
to
615882f
Compare
615882f
to
1e9b1a9
Compare
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.
This all looks great, but there's complex implementation details here that could really use comments. The why and how are well fleshed out in the issue description, can you copy that content into the codebase as comments as well?
return; | ||
} | ||
|
||
// Ignore entry points as these refer to the journey files |
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.
love the simplification here
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
Summary
There are lot of changes on this PR and needs to be done at the same time so we can get all issues addressed at with sourcemap generation and retrieving them with proper stack trace, Will cover one by one to make it easier for the reviewers
Running test suites
ts-node
for transpilation of the journey files which could be written in.ts, .js or .mjs
files and prior to running the tests, the transformation of these files happens on the fly and resolved internally to the trasnspiled version. This was a good solution for the time being, but turned out to be problematic given the sourcemap locations were wrong most of the times asts-node
automatically installs thesource-map-support
module and we will not have granular access to the generated source files.esbuild
to achieve similar behaviour, which means we get the same benefits like automatic transpilation of the TS files, configs, etc. with also granular control of the sourcemap that got generated for those files. This becomes super handy as we can reuse those sourcemaps and maps to those files after bundling using esbuild.Bundling
Synthetics
plugin that resolved all the journey and imported modules without any transpilation and bundled only the externalnode_modules
. This was done for main two reasonsThis method turned our to be really complex and we would need to handle some weird edge cases which is on another PR here - #673
Esbuild
to bundle the full journey in a singlebundled file
and use sourcemaps that are inlined to map it to the source when errors are thrown. One thing to note here is we setsourceContents: false
as we dont need the full source content right now as we are not replicating the file structure on the Kibana side, plus removing it also reduces the size by 90%. The rest is just base64 content mappings.Making sourcemaps work
source-map-support
should be installed only once, otherwise mapping back to the original source position would become problematic.journey, step, monitor
functions as we use them to identify all the duplicate monitors and report them as errors.Bug fixes
Failed journey as discussed on the issue #652