feat: change the init() to be an explicit action triggered from consumer code #38
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 is currently a couple of problems with the way the library is consumed from the client code.
1. The import of the library with
import 'cerner-smart-embeddable-lib'
results in an unconditional execution ofCernerSmartEmbeddableLib.init()
, which is not always desirable.In a the context of our React application and its build setup it is difficult to achieve a conditional import of this library.
The proposal is to expose a single function (e.g.
initializeCernerSmartEmbeddableLib()
) that can be invoked from the consumer code as necessary.Introduction of such change requires the major version bump as it's not backwards compatible.
2. Another problem is that the list of ACLs is hard coded and limited to
'https://embedded.cerner.com', 'https://embedded.sandboxcerner.com', 'https://embedded.devcerner.com'
. This may not be sufficient in many cases.The proposal is to make the
init()
function receiveacls
as a parameter (maybe with a pre-defined old value).Looking forward to feedback.
Thank you!