-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat: environment variables (to support fhircast) #5988
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
Draft
awatson1978
wants to merge
12
commits into
OHIF:master
Choose a base branch
from
awatson1978:fhircast-mvd
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,887
−2,060
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a5802bd
feat(app): env-injected extensions/modes, FHIR dev proxy, and SMART c…
awatson1978 76a0896
Merge branch 'fhircast-mvd' of github.com:awatson1978/Viewers into fh…
awatson1978 4f74836
fix: regenerate pnpm-lock.yaml to match bumped @ohif/* package versions
awatson1978 f95c582
Merge branch 'master' into fhircast-mvd
awatson1978 1eaa0c5
Merge branch 'fhircast-mvd' of github.com:awatson1978/Viewers into fh…
awatson1978 383b451
fix: regenerate pnpm-lock.yaml after master sync (workspace:* specifi…
awatson1978 89a37a2
docs(writePluginImportsFile): add JSDoc to parseExtraPlugins
awatson1978 951fc17
refactor: move SMART_CLIENT_ID and FHIR proxy out of core into the FH…
awatson1978 27b4246
feat(plugins): auto-detect a companion mode bundled in an injected ex…
awatson1978 e18439b
feat(plugins): APP_PLUGIN_CONFIG layered plugin-config override
awatson1978 ea8be31
fix(deps): add jszip + dcmjs-ecg to lockfile for ohif-fhir-viewer ext…
awatson1978 c9327d2
fix(deps): link @ohif/fhir-viewer OHIF peers to workspace source
awatson1978 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "comment": "Example APP_PLUGIN_CONFIG override. Select it with `APP_PLUGIN_CONFIG=./pluginConfig.example.json`. It `include`s the static default pluginConfig.json and layers over it: plain arrays append (de-duped by packageName, an override entry replacing a same-named base entry), while immutability-helper commands replace instead — e.g. `\"modes\": { \"$set\": [ { \"packageName\": \"@ohif/mode-basic\" } ] }` would ship ONLY the basic mode. EXTRA_EXTENSIONS / EXTRA_MODES still append on top of whatever this file produces. See platform/app/.webpack/writePluginImportsFile.js.", | ||
| "include": "./pluginConfig.json", | ||
| "extensions": [ | ||
| { | ||
| "packageName": "@ohif/extension-test", | ||
| "version": "3.0.0" | ||
| } | ||
| ], | ||
| "modes": [ | ||
| { | ||
| "packageName": "@ohif/mode-test", | ||
| "version": "3.0.0" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
My preference would be to have another pluginConfig.json file that gets pointed at with a separate ENV value, and can include the default pluginConfig. That way it can be tracked in the specific build without hitting the main set.
Then, as a customization, allow the modes and extensions for each mode list to be customizeable. The default versus optional is a bit tricky since it affects build time, but it could be setup so that a second declaration over-ride or merges with the first one using the customization $set notation.
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.
I'd also suggest a way to include an https:// referenced plugin that gets dynamically loaded - see the customization PR.
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.
Yeah, I think I'm following. Let me tinker with it a bit, and see what I can come up with.
(I'm chuffed that I've been able to reduce the ~100 file changes to one essential change.)
Uh oh!
There was an error while loading. Please reload this page.
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.
So, just added a
APP_PLUGIN_CONFIGenvironment variable.Example customPlugin.json:
{ "include": "./pluginConfig.json", "extensions": [ { "packageName": "@acme/extension-remote", "importPath": "https://cdn.example.com/acme-remote.umd.js", "globalName": "AcmeRemote" } ] }Still testing/confirming everything works.