-
Notifications
You must be signed in to change notification settings - Fork 286
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
fix(api-server): runtime plugin imports #346
Labels
Milestone
Comments
petermetz
added a commit
to petermetz/cacti
that referenced
this issue
Nov 7, 2020
- Upgrades webpack to the version[1] of it that supports the webpackIgnore magic comment for require calls not just for import calls. - Adds a dedicated test package for the API server which is necessary because that's how we can verify that not just the Typescript compilation output (./dist/lib/.../*.js) files but also the webpack bundles are good when it comes to runtime plugin importing. Why? Because only when importing from another package will the bundle be used so the local test cases inside the cmd-api-server package directory could not verify this particular edge case. [1]: This version is not yet officially released becaue the PR for it has been stuck without review since August 2020 so for now the workaround for that is to specify the webpack version as the direct commit reference on the fork that has the required enhancements for this issue to be resolved. Fixes hyperledger-cacti#346 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz
added a commit
to petermetz/cacti
that referenced
this issue
Nov 12, 2020
- Upgrades webpack to the version[1] of it that supports the webpackIgnore magic comment for require calls not just for import calls. - Adds a dedicated test package for the API server which is necessary because that's how we can verify that not just the Typescript compilation output (./dist/lib/.../*.js) files but also the webpack bundles are good when it comes to runtime plugin importing. Why? Because only when importing from another package will the bundle be used so the local test cases inside the cmd-api-server package directory could not verify this particular edge case. [1]: This version is not yet officially released becaue the PR for it has been stuck without review since August 2020 so for now the workaround for that is to specify the webpack version as the direct commit reference on the fork that has the required enhancements for this issue to be resolved. Fixes hyperledger-cacti#346 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz
added a commit
to petermetz/cacti
that referenced
this issue
Dec 1, 2020
- Upgrades webpack to the version[1] of it that supports the webpackIgnore magic comment for require calls not just for import calls. - Adds a dedicated test package for the API server which is necessary because that's how we can verify that not just the Typescript compilation output (./dist/lib/.../*.js) files but also the webpack bundles are good when it comes to runtime plugin importing. Why? Because only when importing from another package will the bundle be used so the local test cases inside the cmd-api-server package directory could not verify this particular edge case. [1]: This version is not yet officially released becaue the PR for it has been stuck without review since August 2020 so for now the workaround for that is to specify the webpack version as the direct commit reference on the fork that has the required enhancements for this issue to be resolved. Fixes hyperledger-cacti#346 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Currently the only way to use plugins in the API server is by injecting them via code that one has to actually write instead of just providing a declarative config file stating which plugins should be imported.
This fix is not possible until webpack/webpack#11316 gets merged and released.
In theory the changes to apply the fix are already part of the
v0.2.0
release, but this issue has to stay open until we confirm the effectiveness of the fix via automated tests as well. (which also means that to close this, said tests have to be added also).To Reproduce
config.json
file as the config file path and thenExpected behavior
Plugin imports at runtime work just as well as injection from code.
Logs/Stack traces
N/A
Screenshots
N/A
Cloud provider or hardware configuration:
Local development machine (or anywhere else)
Operating system name, version, build:
Hyperledger Cactus release version or commit (git rev-parse --short HEAD):
$ git rev-parse --short HEAD
1cf5176
Hyperledger Cactus Plugins/Connectors Used
Literally any plugin will cause the mentioned crash.
Additional context
Been having a hard time convincing the webpack maintainers to accept the proposal so if you have a second, please head over there and support it with a thumbs up reaction or similar => webpack/webpack#11316
cc: @sfuji822 @jonathan-m-hamilton @takeutak
The text was updated successfully, but these errors were encountered: