-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support custom JS parsers without having separate bundle #317
Comments
Problem/Solution: https://swmansion.slack.com/archives/C01GTK53T8Q/p1716235671381059 |
@tomekzaw do you have the bandwidth to prioritize this? If not, wanna see about tag-teaming it with another engineer or finding a volunteer to take over? I know you posted the P/S just yesterday, there was a month+ before that without an update, which is why I'm asking. |
@mallenexpensify Actually, I have a working proof of concept that uses Reanimated worklets (Reanimated is already a dependency so that's cool) so we might be able to use that quite soon. The only problem for the time being is that ExpensiMark still uses jQuery in some places, but this is something that can be parallelized or even made external, what do you think? |
@tomekzaw , honestly, I have no clue. I'm not familiar with this. Looks like a plan was hatched in this thread and that Expensify/App#42494, linked above, is the next step. thx. |
Working on it, looks promising, will share a video recording with a demo early next week. |
@tomekzaw Is there any update here? |
Latest update here |
@tomekzaw can you write a short update here for open source users without access to SM Slack? |
Sure, will do. TL;DR in an upcoming version of Then, in a following step, instead of having a predefined list of syntax elements (like |
Hi @szt217, thanks for testing out the PR! Happy to hear that custom parsing works well for you. I've faced some issues with incorrect Realistically, I'd expect this PR to be merged next month. There are still some bugs to fix and it needs to be properly reviewed since there's a lot of files changed. |
Hello! Just curious how this is going? |
@puneetlath We're almost there. The feature is already implemented, the PR has been reviewed by @j-piasecki and we're waiting for a good time to merge it (we were still fixing some minor bugs in web implementation but now it's done). There's a plan to use live-markdown to highlight search query so we'll be aiming to land this feature quite soon. Currently, @Kicu is reviewing the PR. Will keep you posted! |
Great! |
@puneetlath I'm glad to announce that today we finally merged #439. This is a milestone in the development of the library. What does it mean for us now?
What do we need to do now?
Thanks! |
Done in #439. |
That's awesome!! Thanks for the update 😄 |
Currently, Live Markdown comes with a JS parser/formatter that wraps ExpensiMark and converts Markdown message into a list of ranges (style, location, length). This code needs to be run on the UI runtime while typing so it is executed on a separate JS runtime. Currently, this code is distributed as a separate bundle which is loaded from this file distributed along with the Live Markdown library: https://github.com/Expensify/react-native-live-markdown/blob/main/parser/react-native-live-markdown-parser.js
However, this makes things more difficult to maintain since after each change in
expensify-common
we need to bump it in@expensify/react-native-live-markdown
and then bump both these libraries inExpensify/App
repo. This also leads to inconsistencies when E/App and Live Markdown use different versions ofexpensify-common
.Finally, since the JS parser/formatter is bundled, there's no way to parametrize its behavior based on app state, however in some cases this will be necessary, e.g. to implement:
The objective of this task is to allow passing JS parser/formatter as a JS function directly to
MarkdownTextInput
component. Here's the current idea for the API:The current implementation of JS parser/formatter will be exported as the following hook:
The text was updated successfully, but these errors were encountered: