Skip to content

Replace html-to-react with html-react-parser#3995

Merged
emlynmac merged 4 commits intomainfrom
emlyn/html-react-parser
Jan 10, 2024
Merged

Replace html-to-react with html-react-parser#3995
emlynmac merged 4 commits intomainfrom
emlyn/html-react-parser

Conversation

@emlynmac
Copy link
Copy Markdown
Member

@emlynmac emlynmac commented Jan 10, 2024

What

Replace non-typescript html-to-react with a the html-react-parser.

Why

html-to-react has typings that are too loose and the html-react-parser seems to be the more widely used solution with more github stars.
https://npmtrends.com/html-react-parser-vs-html-to-react.
The html-react-parser has a clearer API and seems to reduce our bundle size considerably.

How Tested

CI and storybook

Process & policy checklist

  • I have updated the project documentation to reflect my changes if necessary.
  • I have read the CONTRIBUTING documentation.

Is this a breaking change?

  • This change causes current functionality to break.

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 10, 2024

Chat bundle size is decreased✅.

  • Current size: 1437631
  • Base size: 1532384
  • Diff size: -94753

@github-actions
Copy link
Copy Markdown
Contributor

Calling bundle size is not changed.

  • Current size: 5621579
  • Base size: 5621579
  • Diff size: 0

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 10, 2024

CallWithChat bundle size is decreased✅.

  • Current size: 6341759
  • Base size: 6436527
  • Diff size: -94768

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@azure/communication-react jest test coverage for beta.

Lines Statements Functions Branches
Base 44155 / 71074
62.12%
44155 / 71074
62.12%
914 / 1995
45.81%
2582 / 4209
61.34%
Current 44140 / 71035
62.13%
44140 / 71035
62.13%
908 / 1989
45.65%
2586 / 4203
61.52%
Diff -15 / -39
0.01%
-15 / -39
0.01%
-6 / -6
-0.16%
4 / -6
0.18%

);
}
}
// Pass through the original node
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The casting is needed as the underlying library wraps this in a function to hide the casting to any.

https://github.com/remarkablemark/html-react-parser/blob/master/src/dom-to-react.ts#L36C35-L36C35

@github-actions
Copy link
Copy Markdown
Contributor

@azure/communication-react jest test coverage for stable.

Lines Statements Functions Branches
Base 21959 / 34647
63.37%
21959 / 34647
63.37%
595 / 1039
57.26%
1728 / 2732
63.25%
Current 22008 / 34628
63.55%
22008 / 34628
63.55%
592 / 1036
57.14%
1721 / 2734
62.94%
Diff 49 / -19
0.18%
49 / -19
0.18%
-3 / -3
-0.12%
-7 / 2
-0.31%

Copy link
Copy Markdown
Member

@JamesBurnside JamesBurnside left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow that bundle size reduction! On that alone let's get this checked in 😄
Would be good to get this into selfhost as soon as possible to get extra coverage if this behaves any different to the previous package

@emlynmac emlynmac merged commit 3383b3c into main Jan 10, 2024
@emlynmac emlynmac deleted the emlyn/html-react-parser branch January 10, 2024 18:19
palatter added a commit that referenced this pull request Jan 18, 2024
* [Calling sounds] Stabilize Calling sounds feature (#3969)

* stabilize sounds

* Change files

* Duplicate change files for beta release

* build beta API

* fix breaking change

* build API files

* update stable API

---------

Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com>

* Fix `noInvalidAny` chat composites (#3987)

* [DTMF Dialler] Enable DTMF mode and dialing out mode in dialpad (#3970)

* remove code forcing end of number to be edit with key

* Change files

* Duplicate change files for beta release

* add editing mode for dialing and dtmf default

* disable input on click if there is no editing

* remove ref

* build API

* fix test for new API

* [InlineImage][Test] Resolve resource not found error for inline image placeholder UITest  (#3979)

* Resolve resource not found error for inline image placeholder UITest

* Update UI Testing doc

Signed-off-by: Patrick Latter <73612854+palatter@users.noreply.github.com>

* Resolve issue with inline image placeholder test

* Change files

* Duplicate change files for beta release

---------

Signed-off-by: Patrick Latter <73612854+palatter@users.noreply.github.com>

* Fix up typing on chat components (#3988)

* Replace html-to-react with html-react-parser (#3995)

* Enable noImplicitAny in chat-stateful-client (#3998)

* Enable noImplicitAny in the chat sample (#4000)

* Update component examples for noImplicitAny (#4001)

* Make Calling Sample textfield validate the Teams user id format (#3967)

* Prevent dialpad unecessarily triggering onChange event (#3963)

* [DTMF Dialer] Update Dialpad styles per designs (#3999)

* Update Dialpad styles per designs

* Change files

* Duplicate change files for beta release

* fix alignment

* Update packages/react-composites CallWithChatComposite browser test snapshots

* Update packages/react-composites CallComposite browser test snapshots

* sizing

* Update packages/react-composites CallWithChatComposite browser test snapshots

* Update packages/react-composites CallComposite browser test snapshots

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* [Calling] Send reaction button component (#3997)

* Add Spotlight feature to stateful call client (#3993)

* Add Spotlight feature to stateful call client

* Change files

* Duplicate change files for beta release

* update api

* mark spot light feature as in progress

* added code docs

* Add spotlight feature selectors and handlers (#4004)

* Add Spotlight feature to stateful call client

* Change files

* Duplicate change files for beta release

* update api

* mark spot light feature as in progress

* update api

* Add Spotlight selectors and handlers

* Change files

* Duplicate change files for beta release

* remove ununsed import

* remove duplicate handlers already in common calling handlers

* memoize spotlightedParticipantIds

* remove 'on' prefix from spotlight adapter functions

* fix conditional compilation

* added code docs

* small edit

* Change hidesurvey to disablesurvey based on ARB  (#4006)

* hide survey

* Change files

* Duplicate change files for beta release

---------

Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com>

* [Calling Deps] Update to new Calling beta (#4008)

* update to new Calling beta

* Change files

* Duplicate change files for beta release

* cc new type

* fix hermetic

* fix test mock

* Update packages/react-composites ChatComposite browser test snapshots

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Add callback when survey is dismissed for selfhost  (#4009)

* add callback for survey dismissed to selfhost

* Change files

* Duplicate change files for beta release

* build files

* [Calling] Send reaction component calling-component-binding and composite changes (#4003)

* Add license field for package.json files (#4018)

* [Chat] Remove inline image from stable (#4010)

* Revert "[Chat] Remove file card group message from stable API (#3940)"

This reverts commit 74a97ba.

* Revert "[Chat] Rename ImageGallery related Chat Theme (#3936)"

This reverts commit 98b9f7d.

* Revert Inline Image GA changes

* Fix lint issues

* Change files

* Duplicate change files for beta release

* Separate file sharing with inline image

* Remove test CC

* Update FileDownloadCards.test.tsx

* Update ChatScreen.tsx

* Merge strings back into main (#4025)

* TDBuild - updating localized resource files.

* Improve CI workflow (#4016)

* Lock Files

* Change files

* Duplicate change files for beta release

* Update lock files

* Skip compare jest coverage and compare bundle size CI steps for PRs to release (#4026)

* Skip jest test coverage and compare bundle stats steps when base branch is a release branch

* Change files

* Duplicate change files for beta release

* [OCE] Remove beta banner for features that are stable (#4031)

* remove sounds beta banner

* Change files

* Duplicate change files for beta release

* [Calling] Applying capability for Reaction feature (#4013)

* Fix calling sample joining room with room id query arg (#4032)

* Fix calling sample to be able to join room with roomId query arg

* Change files

* Duplicate change files for beta release

* Update packages/react-composites ChatComposite browser test snapshots

* Update packages/react-composites ChatComposite browser test snapshots

---------

Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com>
Signed-off-by: Patrick Latter <73612854+palatter@users.noreply.github.com>
Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com>
Co-authored-by: Emlyn Bolton <3941071+emlynmac@users.noreply.github.com>
Co-authored-by: James Burnside <2684369+JamesBurnside@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mohtasim <99507832+Mohtasim@users.noreply.github.com>
Co-authored-by: mgamis-msft <79475487+mgamis-msft@users.noreply.github.com>
Co-authored-by: carocao-msft <96077406+carocao-msft@users.noreply.github.com>
Co-authored-by: vhuseinova-msft <98852890+vhuseinova-msft@users.noreply.github.com>
Co-authored-by: Leah Xia <107075081+Leah-Xia-Microsoft@users.noreply.github.com>
Co-authored-by: edwardlee-msft <edwardlee@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants