Skip to content

Conversation

@5ZYSZ3K
Copy link
Collaborator

@5ZYSZ3K 5ZYSZ3K commented Oct 5, 2025

Description

This PR is meant to move the contents of react-native-render-html to this library with no other changes

Ultimately I decided to move packages/render-html and apps directories to the repo

  • packages/render-html contains the core logic of react-native-render-html
  • apps contains testing applications that may be helpful

I plan to create pull requests based off of this one to actually get it to work

References

Repository merge with history guide: https://gfscott.com/blog/merge-git-repos-and-keep-commit-history/
react-native-render-html repo: https://github.com/meliorence/react-native-render-html

jsamr and others added 30 commits June 13, 2021 16:14
RenderHTMLProps interface does not have a `baseStyles` prop it should be `baseFontStyle` instead
BREAKING CHANGE: The `triggerTREInvalidationPropNames` has been
discontinued. The idea for this prop originated in the premise that
many beginners would disregard the issue of passing literal props triggering
many re-renders. But I realized it mostly frustrated expectations of
newcomers that this library honors React components contract. So I have
finally decided to discard the prop, and instead add a lightweight
profiler (in dev mode only, of course), which warns the consumer of
re-renders happening in a short period of time. You are now responsible
for the invalidation of the TRenderEngine, so make sure you memoize the
props if the controlling components is expected to re-render often.
Useful to add padding to the right of markers (list element prefixes).
Useful to compute the collapsed top margin for each member of a `TNode`
list.
Useful for rendering individual nodes in isolation, e.g. in the
`renderItem` prop of a `FlatList`.
Avoid re-renders of children of interative / dynamic custom renderers.
Keys don't need to be handled deeper in the tree, only when returning
arrays of React nodes. This was a legacy of v5, where custom renderers
were functions. Now that any custom renderer is wrapped in a
`TNodeRenderer` which has its own key, there is no need to use this key
in custom renderers.
@5ZYSZ3K 5ZYSZ3K self-assigned this Oct 5, 2025
@5ZYSZ3K
Copy link
Collaborator Author

5ZYSZ3K commented Oct 5, 2025

@jsamr we had a conversation with @mironiasty about the migration
We ultimately decided that we will use and frequently copy solutions from #9, but we will eventualy drop it. It's too big to actually review, and also we wanted to keep the history from the previous repo

Let me know what do you think about that

@jsamr

This comment was marked as resolved.

Copy link
Collaborator

@mironiasty mironiasty left a comment

Choose a reason for hiding this comment

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

I hope that all files are migrated correctly 🤞

@jsamr jsamr self-requested a review October 7, 2025 11:39
Copy link
Contributor

Choose a reason for hiding this comment

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

(This comment is not specific for this file, but I'd like to leverage the thread feature of such file comments).

I have an ask: could you create a rnrh-migration branch and use it as the base for the migration work? The reason is I'd like that we merge to main only when all CI/CD is working properly again. CI/CD is an integral, critical part, and will require some iterations to work properly. There is a lot of tooling involved in these repos.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that's what I intent to do: I don't want to merge to main something that in principle doesn't work
There will be more PRs targeting meant to be merged into this one

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good then!
Really appreciate the work, BTW. Preserving the Git history is something I did not realize was possible, and definitely is a big win.

@juandjara
Copy link

Hello team!
If it is of any use to you, I created an updated fork applying the library code to an updated generic react native library template, with all tests and checks passing and some small extra features I wanted to add

https://github.com/juandjara/react-native-html-engine/

@5ZYSZ3K
Copy link
Collaborator Author

5ZYSZ3K commented Oct 15, 2025

Hello team! If it is of any use to you, I created an updated fork applying the library code to an updated generic react native library template, with all tests and checks passing and some small extra features I wanted to add

https://github.com/juandjara/react-native-html-engine/

Hello,
Thanks for your contribution!
Right now, there is ongoing work regarding this package and migrating react-native-render-html, so we can't say for certain what will be useful, but we'll definitely take a look at that

@5ZYSZ3K 5ZYSZ3K force-pushed the chore/migrate-render-html-with-history branch from fda2c82 to b0cc2d5 Compare October 17, 2025 06:21
@codecov
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.30%. Comparing base (170da76) to head (b0cc2d5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #13   +/-   ##
=======================================
  Coverage   99.30%   99.30%           
=======================================
  Files          57       57           
  Lines        1148     1148           
  Branches      313      313           
=======================================
  Hits         1140     1140           
  Misses          8        8           
Flag Coverage Δ
css-processor 100.00% <ø> (ø)
transient-render-engine 98.94% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@5ZYSZ3K
Copy link
Collaborator Author

5ZYSZ3K commented Oct 17, 2025

Closing in favour of #14

@5ZYSZ3K 5ZYSZ3K closed this Oct 17, 2025
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.