react-native-live-markdown icon indicating copy to clipboard operation
react-native-live-markdown copied to clipboard

Remove patching class ExpensiMark with an object

Open tomekzaw opened this issue 1 year ago • 0 comments

Currently, we need to patch expensify-common/lib/ExpensiMark.js to convert class ExpensiMark into a single object because Hermes does not support ES Classes (https://github.com/facebook/hermes/issues/685#issuecomment-1784172071).

In particular, we had to make the following changes:

  1. Remove class keyword:
-export default class ExpensiMark {
+export const ExpensiMark = {
  1. Rename constructor to initializer:
-    constructor() {
+    initializer() {
  1. Add commas after method definitions:
-    }
+    },

It would be better to use a Babel plugin to automatically convert class ExpensiMark into something that Hermes can deal with.

tomekzaw avatar Dec 20 '23 15:12 tomekzaw