-
Notifications
You must be signed in to change notification settings - Fork 2k
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
chore(pre-req): clean up pre-request script sdk objects - INS-3379 #7172
Conversation
7d37e86
to
eb347c1
Compare
a0347de
to
1feaba5
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.
For exposing node specific modules:
- We need to document those alongside the node version that we support. This has the potential to block us from upgrading electron and node because of breaking changes to pre-request scripts
For exposing installed modules from npm:
- Similar to node but with greater risk of breaking changes. We should add these one by one once we figure out the API documentation story and how to communicate breaking changes. e.g. what happens when a version of a package we expose has a vulnerability or some reason to be updated but it contains breaking changes?
Let's remove the external npm modules from this PR (lodash, moment etc) and merge the changes. |
1409721
to
04928b5
Compare
The external modules have been removed and I will set up another PR for external modules and then lets focus on it. |
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.
Giving a thumbs up for now to ship this feature, but I would say we should explore a path that uses packages installed in the user's operating system instead of shipping these modules in the Insomnia's executable package.
The reason is we cannot support all new modules with different versions that users request. We should probably allow them to select node runtime version and load the packages that are installed, so the Insomnia client is literally a shell that runs these javascript "files" instead. However, I understand this is quite difficult challenge to be tackled
I am also still learning the context of pre-request feature implementation, so please consider this approval as a half. |
}); | ||
}, | ||
}, | ||
// { |
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.
are these commented out for a reason?
packages/insomnia-smoke-test/tests/smoke/pre-request-script-features.test.ts
Show resolved
Hide resolved
The new PR has been create at: #7198 |
Please review this PR (#7171) firstly as current one is based on it
Changes:
eval()
console.log
outputs more friendlyfs
as it is for internal usageHow to test
Run this script and check if it runs well: