Release 6.0.0
6.0.0 (2021-07-17)
The Foundry release is finally stable, and is now-on the recommended version. Check out the announcement blog post in our brand new website. We also have a migration guide for those who're coming from v5 and below.
This changelog highlights changes from v5. There are no changes since version 6.0.0-beta.8
Features
GenericPressableprop to customize the component wrapping interactive views (707374a), closes #472pressableHightlightColorprop to customize pressable appearance (e5dfa1e)- access
sharedPropsfrom custom renderers (0d2199e) - accessibility for images with role and label (1accaf7)
- add
react-nativefield in package.json for metro (10dfc82) - allow module augmentation for renderers prop via
RenderersProps(97dabc1) - configure
enableExperimentalRtlinrenderersProps.ol|ul(96daa5e) - configure
getFallbackListStyleTypeFromNestLevelinrenderersProps.ol|ul(1377ef7) - configure margins removal for nested lists in
renderersProps.ol|ul(316e706) - experimental
dangerouslyDisableHoistingprop (e6c7328) - export
defaultListStyleSpecsfor customization. (2f9ed01) - export
defaultSystemFontsanddefaultFallbackFonts(0c4207c) - export
buildTREFromConfigfor testing (c13e1a7) - new
propsFromParentin custom renderers and children renderers (3bc1b52), closes #228 - new
renderersProps.(ol|ul).enableDynamicMarkerBoxWidthprop (f87b9f6) - new
selectDomRootprop to select a custom root (31bbff7) - new
setMarkersForTNodeprop (63caa4d) - new
useIMGElementStateWithCachehook for images (54dc1bc) - new prop
customListStyleSpecsto support additionallist-style-type(84ec025) - new source type
RenderHTMLSourceDomto render a DOM object (eeec894) - performant multi-instance HTML rendering with
RenderHTMLSource(4e4cd09) - reexport
CustomElementModeltype from TRE (c5a01f0) - reexport
HTMLModelRecordfrom TRE (a9c9cf3) - reexport
isDomNodeand isDomText from TRE (cedcf7a) - reexport
SetMarkersForTNodefrom TRE (eaa3928) - reexport
TNodeDescriptorfrom TRE (157983c) - reexport
TNodePrintOptionstype from TRE (6f3265c) - support
"object-fit"CSS property for images (24f72b0) - support
"start"attribute in ol and ul elements (b9d3154), closes #336 - support
"upper-latin"and"lower-lattin"list-style-type CSS props (a0da60d) - support
enableRemove*MarginIfNestedfor list renderers (e0fe7c6) - support
nodeIndexandparentfields inTNode(fe2504c) - support accessibility for
aelements (6974ce6), closes #285 - support
decimal-leading-zerolist style type prefix (526e226) - support default system fonts for Windows, Macos and web (4474dff)
- support
disclosure-*list style type prefixes (218982d) - support experimental RTL mode for ol and ul elements (ca139c1)
- support
lower-greeklist style type prefixes (3aac2c8) - support
lower-latinand upper-latin list prefix styles (4d4805c) - ts: new generic argument for renderers
propsFromParentprop (6427732) - add
defaultViewPropsprop (ce49232) - add
targetargument toonLinkPresshandler (139b0c3) - add
getListStyleTypeFromNestLevelprop toHTMLListElement(5ae3e6a) - add new
splitBoxModelStyleutility (b1adcbc) enableExperimentalMarginCollapsingprop (ae6c553)- export
useSharedProps(f1d7b16) - expose internal renderers building blocks for extensibility (213fcd7), closes #424
fallbackFontsandsystemFontsprops for font selection (6888a96)- implement
defaultTextPropsprop (c297ed1) - implement
useInternalRendererhook to reuse internal rendering logic (8c292da) - implement
computeEmbeddedMaxWidthprop as per [email protected] (6c9d70f) - implement
RenderHTMLDebugwrapper component to warn users (22625b4) - new
cachedNaturalDimensionsprop touseIMGelementStatehook (ed976bb) - new
onDocumentMetadataLoadedprop (9f55907) - new
TRenderEngineProviderandRenderHTMLFragmentcomponents (7d50e72) - new
extendInternalRendererutility (d7bb1da) - new prop
onTTreeChange(5ecdcab) - new
renderChildprop toTChildrenRenderer(db78c54) - new renderers API (2547cba)
onHTMLLoadedprop (981b49b)- port
alterData,alterChildrenandalterNode(18dc001) - reeport useful types from css-processor (9b5e301)
- reeport useful variables and types from transient-render-engine (0c0a9c6)
- reuse 'img' renderer internal logic w/t
useIMGElementStatehook (399eb54), closes #424 - support
htmlParserOptionsprop (624c57e) - support
sourceprop, identical to react-native-webview (3a16487) - support a minimal table renderer (7f64d48)
- support for loading HTML from URI (6c07b8d)
- support relative URLs and document metadata (f2cbcfc)
- support
source.headersinuseIMGElementStatehook (a49e958) triggerTREInvalidationPropNamesprop (89ee25c)useRendererPropshook (87982c4)- warn user of API misusage even when
debugis set to false (cb5b42b) - new
renderersProps.(ol|ul).markerTextStyleprop (6ca54e9) - support
renderersProps.(ol|ul).markerBoxStyleprop (c929643) - new dev profiler to get feedback on short updates (98fd749)
- use aspectRatio style to infer one dimension of images sizes (e018b30)
- export
collapseTopMarginForChildutility (199be12)
Performance Improvements
- avoid calls to getImageDimensions API when provided in attrs (4f3d51d)
- bypass anonymous TPhrasing nodes with one child or less (dad450d)
- drop
alter*props in favor ofdomVisitors(ffb1f58) - increase transient parsing speed by 30% after upgrade to v6.2.1 (df91a21)
- limit rerenderings via memoization (6512e18)
- memoize
TDocumentRendererto prevent rendering from ascendents (2ec060b) - replace
ignoreDOMNodewithignoreDomNode(9ec6403) - replace
ignoredTagswithignoredDomTags(b60d6eb)
Bug Fixes
- loading image component doesn't display alt and borders anymore (1351ee5)
- discard unsupported CSS inline methods (calc, var) (a2e7578)
- images honor styles and physical size in "alt" (error) mode (059e5d6)
- in
<img>tags, style dimensions should prevail over attributes (de3b473) - list style prefixes now inherit from font*(weight,style,family) (191c45c)
- don't peer-depend on prop-types, instead depend directly (27e843e)
And all these unlisted in commits: #94, #118, #144, #150, #151, #156, #165, #227, #228, #243, #263, #286, #312, #336, #344, #360, #369, #371 #414, #418, #419, #420, #424, #429, #432, #470, #481, #482, #484
BREAKING CHANGES
Those are breaking changes from v5. Consumers of the beta will not encounter breaking changes.
ignoredTagshas been replaced withignoredDomTagsfor naming consistency.alterNode,alterDataandalterChildrenhave been dropped in favor ofdomVisitors. The latter is an object with 3 optional callbacks,onElement,onDocumentandonTextwhich you can use to intercept and tamper nodes during parsing. Take advantage of domutils library to delete, insert and manipulate those nodes.ignoreNodesFunctionis nowignoreDomNodefor naming consistency.enableExperimentalPercentWidthhas been discontinued. UserenderersProps.img.enableExperimentalPercentWidthinstead.onLinkPressprop has been discontinued. UserenderersProps.a.onPressinstead.imagesInitialDimensionshas been moved torenderersProps.img.initialDimensionslistsPrefixesRenderersprop has been discontinued. UsecustomListStyleSpecsinstead.- dropped
ptSizeprop. Point is supposed to be an absolute (pixel independent) size and unfit for display devices. It will be translated by the CSS processor to an absolute unit. containerStyleandcustomContainerprops have been dropped. UsebaseStyleprop instead to style the root component.- drop
textSelectableandallowFontScaling. UsedefaultTextProps.selectableanddefaultTextProps.allowFontScalinginstead. uriandhtmlprops have been dropped. Replaceuriwithsource={{ uri: 'http://...' }}andhtmlwithsource={{ html: '<div> ...' }}. The former now allowsbody,headersandmethodfields.decodeEntitiesprop has been dropped. Pass this option tohtmlParserOptionsprop instead.computeImagesMaxWidthhas been replaced withcomputeEmbeddedMaxWidth. The two props are very similar, but the latest takes an extra argument, "tagName", which is the tag for which a width constrain should be enforced. It is planned to work with the @native-html/iframe-plugin extension.