openedx / frontend-platform

A framework for Open edX micro-frontend applications.
http://openedx.github.io/frontend-platform
GNU Affero General Public License v3.0
32 stars 64 forks source link

fix: fixing and exporting mergeMessages() #550

Closed pedromartello closed 1 year ago

pedromartello commented 1 year ago

Fixed and exported the internal function mergeMessages() and refactored unit-tests to cover the new behavior. Previously this method would return an object identical to the one passed in (or an object version of an array passed 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 use lodash.merge() directly.

These changes support OEP-65 and the related work in the repository frontend-app-shell which 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.

openedx-webhooks commented 1 year ago

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.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.03% :tada:

Comparison is base (26001c9) 83.05% compared to head (1a4203c) 83.08%. Report is 3 commits behind head on master.

Additional details and impacted files ```diff @@ 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 ``` | [Files Changed](https://app.codecov.io/gh/openedx/frontend-platform/pull/550?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx) | Coverage Δ | | |---|---|---| | [src/i18n/lib.js](https://app.codecov.io/gh/openedx/frontend-platform/pull/550?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx#diff-c3JjL2kxOG4vbGliLmpz) | `98.24% <100.00%> (+0.06%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

openedx-webhooks commented 1 year ago

@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.