-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Developing extensions #1588
Comments
Each of these ^_^ https://github.com/OHIF/Viewers/tree/master/extensions We have some improvements coming soon that make extensions even more powerful, but the gist remains the same. If you have specific questions or encounter specific issues, please don't hesitate to reach out. Good questions that help illustrate problem areas can help inform docs. |
Hi Danny, |
If you happen to have a sample recipe of how things flow, that would be very helpful too |
As a specific example, each extension seems to have a .webpack folder attached to it. |
Because the OHIF Viewer is a monorepo, we take advantage of that so that all of our packages can share the same tooling, bundling, transpiling, etc. But I'm getting ahead of myself. Extensions can be very simple. Here is an example of one that is added in-line: This sandbox uses the "Script Tag" version of OHIF. You can see where we've inlined a custom extension under the application configuration's "extensions" key. It adds a command and a button. If you visit a study, you can click the registered button and watch the command execute. Extensions can be added via configuration, similar to the example above, or bundled with the application by:
This allows you to leverage treeshaking, codesplitting, and a number of other performance/optimization features. (It also makes for a better development experience) If you want to author your extension in a different repository, you just need to make sure that it:
It's a weird set of skills. I'm guessing many contributors aren't used to authoring a package, or extending a monorepo. |
Okay Danny, Thanks a lot. Really appreciate it! |
When I'm able to have a successful implementation of the extension I'm planning to make, I'd like to make some changes in the documentation and create a pull request |
@KhyatiMehta3, please feel free to! We're always looking for improvements to our docs and guides! I'm also very appreciative of extension feedback. |
@KhyatiMehta3, can you create a new issue for this new question? |
What is the complete procedure to create extensions for OHIF Dicom viewer?
I've read this Extensions document but would like to know how exactly are the extensions built.
Description
There's a good amount of detail on how the extensions are consumed, but I need to know if there are any recipes to develop them too. If not, can anyone help me by providing a link to a sample extension that's developed from scratch.
Any detail would be very helpful.
Thanks!
The text was updated successfully, but these errors were encountered: