Skip to content

Release 6.0.0-beta.0

Compare
Choose a tag to compare
@jsamr jsamr released this 08 Jun 01:14
· 326 commits to master since this release

6.0.0-beta.0 (2021-06-08)

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. If you encounter any issue with this release, please comment in the official thread.

Bug Fixes

  • 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

Features

  • GenericPressable prop to customize the component wrapping interactive views (707374a), closes #472
  • pressableHightlightColor prop to customize pressable appearance (e5dfa1e)
  • access sharedProps from custom renderers (0d2199e)
  • accessibility for images with role and label (1accaf7)
  • add react-native field in package.json for metro (10dfc82)
  • allow module augmentation for renderers prop via RenderersProps (97dabc1)
  • configure enableExperimentalRtl in renderersProps.ol|ul (96daa5e)
  • configure getFallbackListStyleTypeFromNestLevel in renderersProps.ol|ul (1377ef7)
  • configure margins removal for nested lists in renderersProps.ol|ul (316e706)
  • experimental dangerouslyDisableHoisting prop (e6c7328)
  • export defaultListStyleSpecs for customization. (2f9ed01)
  • export defaultSystemFonts and defaultFallbackFonts (0c4207c)
  • export buildTREFromConfig for testing (c13e1a7)
  • new propsFromParent in custom renderers and children renderers (3bc1b52), closes #228
  • new renderersProps.(ol|ul).enableDynamicMarkerBoxWidth prop (f87b9f6)
  • new selectDomRoot prop to select a custom root (31bbff7)
  • new setMarkersForTNode prop (63caa4d)
  • new useIMGElementStateWithCache hook for images (54dc1bc)
  • new prop customListStyleSpecs to support additional list-style-type (84ec025)
  • new source type RenderHTMLSourceDom to render a DOM object (eeec894)
  • performant multi-instance HTML rendering with RenderHTMLSource (4e4cd09)
  • reexport CustomElementModel type from TRE (c5a01f0)
  • reexport HTMLModelRecord from TRE (a9c9cf3)
  • reexport isDomNode and isDomText from TRE (cedcf7a)
  • reexport SetMarkersForTNode from TRE (eaa3928)
  • reexport TNodeDescriptor from TRE (157983c)
  • reexport TNodePrintOptions type 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*MarginIfNested for list renderers (e0fe7c6)
  • support nodeIndex and parent fields in TNode (fe2504c)
  • support accessibility for a elements (6974ce6), closes #285
  • support decimal-leading-zero list 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-greek list style type prefixes (3aac2c8)
  • support lower-latin and upper-latin list prefix styles (4d4805c)
  • ts: new generic argument for renderers propsFromParent prop (6427732)
  • add defaultViewProps prop (ce49232)
  • add target argument to onLinkPress handler (139b0c3)
  • add getListStyleTypeFromNestLevel prop to HTMLListElement (5ae3e6a)
  • add new splitBoxModelStyle utility (b1adcbc)
  • enableExperimentalMarginCollapsing prop (ae6c553)
  • export useSharedProps (f1d7b16)
  • expose internal renderers building blocks for extensibility (213fcd7), closes #424
  • fallbackFonts and systemFonts props for font selection (6888a96)
  • implement defaultTextProps prop (c297ed1)
  • implement useInternalRenderer hook to reuse internal rendering logic (8c292da)
  • implement computeEmbeddedMaxWidth prop as per [email protected] (6c9d70f)
  • implement RenderHTMLDebug wrapper component to warn users (22625b4)
  • new cachedNaturalDimensions prop to useIMGelementState hook (ed976bb)
  • new onDocumentMetadataLoaded prop (9f55907)
  • new TRenderEngineProvider and RenderHTMLFragment components (7d50e72)
  • new extendInternalRenderer utility (d7bb1da)
  • new prop onTTreeChange (5ecdcab)
  • new renderChild prop to TChildrenRenderer (db78c54)
  • new renderers API (2547cba)
  • onHTMLLoaded prop (981b49b)
  • port alterData, alterChildren and alterNode (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 useIMGElementState hook (399eb54), closes #424
  • support htmlParserOptions prop (624c57e)
  • support source prop, 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.headers in useIMGElementState hook (a49e958)
  • triggerTREInvalidationPropNames prop (89ee25c)
  • useRendererProps hook (87982c4)
  • warn user of API misusage even when debug is set to false (cb5b42b)

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 of domVisitors (ffb1f58)
  • increase transient parsing speed by 30% after upgrade to v6.2.1 (df91a21)
  • limit rerenderings via memoization (6512e18)
  • memoize TDocumentRenderer to prevent rendering from ascendents (2ec060b)
  • replace ignoreDOMNode with ignoreDomNode (9ec6403)
  • replace ignoredTags with ignoredDomTags (b60d6eb)

BREAKING CHANGES

Feeling overwhelmed by all those breaking changes? We have a migration guide for those who're coming from v5 and below.

  • ignoredTags has been replaced with ignoredDomTags for naming consistency.
  • alterNode, alterData and alterChildren have been dropped in favor of domVisitors. The latter is an object with 3 optional callbacks, onElement, onDocument and onText which you can use to intercept and tamper nodes during parsing. Take advantage of domutils library to delete, insert and manipulate those nodes.
  • ignoreNodesFunction is now ignoreDomNode for naming consistency.
  • enableExperimentalPercentWidth has been discontinued. Use renderersProps.img.enableExperimentalPercentWidth instead.
  • onLinkPress prop has been discontinued. Use renderersProps.a.onPress instead.
  • imagesInitialDimensions has been moved to renderersProps.img.initialDimensions
  • listsPrefixesRenderers prop has been discontinued. Use customListStyleSpecs instead.
  • dropped ptSize prop. 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.
  • containerStyle and customContainer props have been dropped. Use baseStyle prop instead to style the root component.
  • drop textSelectable and allowFontScaling. Use defaultTextProps.selectable and defaultTextProps.allowFontScaling instead.
  • uri and html props have been dropped. Replace uri with source={{ uri: 'http://...' }} and html with source={{ html: '<div> ...' }}. The former now allows body, headers and method fields.
  • decodeEntities prop has been dropped. Pass this option to htmlParserOptions prop instead.
  • computeImagesMaxWidth has been replaced with computeEmbeddedMaxWidth. 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.