-
Notifications
You must be signed in to change notification settings - Fork 6
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
Custom rpc templates #16
base: master
Are you sure you want to change the base?
Conversation
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.
Hey, sorry for late code review, I was too busy with other things. Let me know if you have some questions/proposals/ideas :)
@@ -71,14 +52,23 @@ class NodeModuleFederation { | |||
} | |||
|
|||
apply(compiler) { | |||
const { getRemoteUri, ...options } = this.options; | |||
const { | |||
customRpcLoadTemplate, |
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.
since you're adding new options - please document them.
} | ||
//TODO https support | ||
let request = (url.startsWith('https') ? require('https') : require('http')).get(url, function(resp) { | ||
if (resp.statusCode === 200) { |
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 template should reuse rpcLoad template to avoid duplicates
Hello, considering the issue that @ScriptedAlchemy raised, I propose to pass optional custom templates.
I also propose to isolate rpc functions and make them more straightforward with the minimum of logic (such as the arguments parsing).