react-native-render-html

iOS/Android pure javascript react-native component that renders your HTML into 100% native views

BSD-2-CLAUSE License

Downloads
967.5K
Stars
3.4K
Committers
55

Bot releases are hidden (Show)

react-native-render-html - Release 6.4.0 Latest Release

Published by jsamr almost 2 years ago

6.4.0 (2022-12-23)

Features

  • add switchProp testID value to nativeProps testID attribute (#574) (299b852)
  • move config for 'img' and 'a' into named interface (2bd0ba1)
react-native-render-html - Release 6.3.4

Published by jsamr over 2 years ago

6.3.4 (2022-01-24)

Bug Fixes

  • link press on Android doesn't work (1a429f4), closes #546
react-native-render-html - Release 6.3.3

Published by jsamr almost 3 years ago

6.3.3 (2022-01-11)

react-native-render-html - Release 6.3.2

Published by jsamr almost 3 years ago

6.3.2 (2022-01-11)

react-native-render-html - Release 6.3.1

Published by jsamr almost 3 years ago

6.3.1 (2021-12-03)

Bug Fixes

  • bold style not applied to <b> tags (7bd5045), closes #539
  • wrong prop reference in warning message (e03b0ac), closes #541
react-native-render-html - Release 6.3.0

Published by jsamr almost 3 years ago

6.3.0 (2021-11-03)

If you encounter any issue while upgrading to v6.3.0, comment in this thread.

Bug Fixes

  • provideEmbeddedHeaders results in failing fetch for img (5488259), closes #533

Features

  • pass TNodeChildrenRenderer as a prop to custom renderers (9dd2bf1)
react-native-render-html - Release 6.2.0

Published by jsamr almost 3 years ago

6.2.0 (2021-10-23)

This release is focused on accessibility! Moreover, it empowers model-based custom rendering which can now define props passed to Text and View elements of renderers. Check out our blog post for a full dive into this release features.

Bug Fixes

  • inaccurate typing for HTMLElementModelRecord (bd5dfa6)
  • pass borderless prop to custom GenericPressable (f06af7a)
  • never assume the definition of __DEV__ in the global scope (f9bb9e9)
  • a11y: anchors should not be set with a11y role "link" when empty href (dd988fc)
  • a11y: anchors are not accessible anymore when href is empty or absent (4e1f2f4)

Features

  • new getNativePropsForTnode util method (d983d0d)
  • css: support user-select CSS property (8442b2f)
  • a11y: support aria-label and aria-role HTML attributes (2b27f00)
  • a11y: add accessibilityRole="header" to headings elements (h1...h6) (1c79bc3)
  • new reactNativeProps and getReactNativeProps in HTMLElementModel, this little change gives model-based custom rendering considerably more leverage. (4ee1646)
  • deprecate getUADerivedStyleFromAttributes in favor of getMixedUAStyles in HTMLElementModel, which allows access to the underlying TNode and again empowers model-based custom rendering.
  • a11y: whatwg-compliant accessibility for images (7fc2907)
  • a11y: custom renderers passed onPress prop now have a11y roles (11723f0)
  • a11y: support aria-role="search" and aria-role="presentation" attributes (c552fe4)
  • allow HTMLElementModel.extend to take a merge function (9b3a007)
  • support onPress from element models native props (7dc5577)
react-native-render-html - Release 6.2.0-alpha.3

Published by jsamr almost 3 years ago

6.2.0-alpha.3 (2021-10-20)

Bug Fixes

  • pass borderless prop to custom GenericPressable (f06af7a)
  • select onPress according to announced merging specifications (8a88457)

Features

  • allow HTMLElementModel.extend to take a merge function (9b3a007)
  • support onPress from element models native props (7dc5577)
react-native-render-html - Release 6.2.0-alpha.2

Published by jsamr about 3 years ago

6.2.0-alpha.2 (2021-10-13)

Bug Fixes

  • never assume the definition of __DEV__ in the global scope (f9bb9e9)
react-native-render-html - Release 6.2.0-alpha.1

Published by jsamr about 3 years ago

6.2.0-alpha.1 (2021-09-11)

Bug Fixes

  • a11y: anchors should not be set with a11y role "link" when empty href (dd988fc)
  • a11y: set accessibilityLabel for headings (h1..h6) to bypass RN limitation (bc37d88)

Features

  • new getNativePropsForTnode util method (d983d0d)
  • a11y: custom renderers passed onPress prop now have a11y roles (11723f0)
  • a11y: support aria-role="search" and aria-role="presentation" attributes (c552fe4)
react-native-render-html - Release 6.2.0-alpha.0

Published by jsamr about 3 years ago

6.2.0-alpha.0 (2021-09-05)

This release is focused on accessibility! Moreover, it empowers model-based custom rendering which can now define props passed to Text and View elements of renderers.

Bug Fixes

  • a11y: anchors are not accessible anymore when href is empty or absent (4e1f2f4)

Features

  • a11y: support aria-label and aria-role HTML attributes (2b27f00)
  • a11y: whatwg-compliant accessibility for images (7fc2907)
  • css: support user-select CSS property (8442b2f)
  • a11y: add accessibilityRole="header" to headings elements (h1...h6) (1c79bc3)
  • new reactNativeProps and getDynamicReactNativeProps in HTMLElementModel, this little change gives model-based custom rendering considerably more leverage. (4ee1646)
  • deprecate getUADerivedStyleFromAttributes in favor of getUADynamicMixedStyles in HTMLElementModel, which allows access to the underlying TNode and again empowers model-based custom rendering.
react-native-render-html - Release 6.1.0

Published by jsamr about 3 years ago

6.1.0 (2021-08-29)

Features

  • add new renderIndex and renderLength props to TDefaultRendererProps (4f032d3)
  • new enableExperimentalBRCollapsing prop to prevent extraneous spaces (e019a5a), closes #516, see official documentation
  • new enableExperimentalGhostLinesPrevention to circumvent RN bug (3645211), see official documentation
  • new provideEmbeddedHeaders prop to pass headers to img, iframes and other embedded in the future (2ea1ca6)
  • new bypassAnonymousTPhrasingNodes prop (90b8a3d), closes #514

Bug Fixes

  • prevent list markers from overflowing in a new line (f2238aa)
react-native-render-html - Release 6.1.0-alpha.1

Published by jsamr about 3 years ago

6.1.0-alpha.1 (2021-08-28)

Features

  • add new renderIndex and renderLength props to TDefaultRendererProps (4f032d3)
  • new enableExperimentalBRCollapsing prop to prevent extraneous spaces (e019a5a), closes #516
  • new enableExperimentalGhostLinesPrevention to circumvent RN bug (3645211), closes #516
  • new provideEmbeddedHeaders prop to pass headers to img, iframes (2ea1ca6)
react-native-render-html - Release 6.1.0-alpha.0

Published by jsamr about 3 years ago

6.1.0-alpha.0 (2021-08-22)

Features

  • new bypassAnonymousTPhrasingNodes prop (90b8a3d), closes #514
react-native-render-html - Release 6.0.5

Published by jsamr about 3 years ago

6.0.5 (2021-07-31)

Bug Fixes

  • test presence of "performance" global variable in useProfiler (7379c9b), closes #510
react-native-render-html - Release 6.0.4

Published by jsamr over 3 years ago

6.0.4 (2021-07-19)

Bug Fixes

  • npm v7 peer dependencies on @native-html/* (3d50b0e)
react-native-render-html - Release 6.0.3

Published by jsamr over 3 years ago

6.0.3 (2021-07-19)

Bug Fixes

  • peer-dependency failure wih npm@7 (002f555), closes #508
react-native-render-html - Release 6.0.2

Published by jsamr over 3 years ago

6.0.2 (2021-07-18)

No user-facing changes.

react-native-render-html - Release 6.0.1

Published by jsamr over 3 years ago

6.0.1 (2021-07-17)

No user-facing changes.

react-native-render-html - Release 6.0.0

Published by jsamr over 3 years ago

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

  • 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)
  • new renderersProps.(ol|ul).markerTextStyle prop (6ca54e9)
  • support renderersProps.(ol|ul).markerBoxStyle prop (c929643)
  • new dev profiler to get feedback on short updates (98fd749)
  • use aspectRatio style to infer one dimension of images sizes (e018b30)
  • export collapseTopMarginForChild utility (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 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)

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.

  • 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.
Package Rankings
Top 0.88% on Npmjs.org
Badges
Extracted from project README
npm npm npm npm
Related Projects