fix: fixing and exporting mergeMessages()#550
Conversation
|
Thanks for the pull request, @pedromartello! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
d5c06a5 to
f448e18
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #550 +/- ##
==========================================
+ Coverage 83.05% 83.08% +0.03%
==========================================
Files 40 40
Lines 1062 1064 +2
Branches 195 194 -1
==========================================
+ Hits 882 884 +2
Misses 168 168
Partials 12 12
☔ View full report in Codecov by Sentry. |
arbrandes
left a comment
There was a problem hiding this comment.
Nice! It looks like that utility function now actually has a utility, now. :)
Tested, and has no ill effects in existing MFEs. (Not that any of them actually used this function, AFAICT.)
|
@pedromartello 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
Fixed and exported the internal function
mergeMessages()and refactored unit-tests to cover the new behavior. Previously this method would return anobjectidentical to the one passed in (or anobjectversion of anarraypassed in) and ignore/clobber any messages previously supplied. The new version fixes this function to actually merge new messages with existing ones.The method was never exported outside the package and the only internal use was in the
configure()method which is refactored in this PR to uselodash.merge()directly.These changes support OEP-65 and the related work in the repository
frontend-app-shellwhich uses the Piral framework to federate MFEs.With existing MFE's which are deployed and run independently, there is never a need to merge messages into frontend-platform after initialization is completed. However, with federated MFEs, they need the ability to append new messages to those already loaded. This change supports this requirement.