@@ -4,7 +4,7 @@ author: Jules Sam. Randolph
44author_title : Developer of React Native Render HTML v6
55author_url : https://github.com/jsamr/
66author_image_url : https://avatars.githubusercontent.com/u/3646758?v=4
7- tags : [foundry, announcement ]
7+ tags : [foundry, "release notes" ]
88description : A version focused on accessibility and enhanced model rendering.
99image : img/foundry-announcement.png
1010hide_table_of_contents : false
@@ -15,11 +15,12 @@ import APIReference from '@site/src/components/APIReference';
1515import Reference from ' @site/src/components/Reference' ;
1616
1717It has been over two months since the first final version of the Foundry
18- released has been made public. This new release focuses on two areas of
18+ release has been made public. This new version focuses on two areas of
1919improvements:
2020
21- 1 . Accessibility;
22- 2 . Richer model-based rendering.
21+ 1 . Accessibility, and more specifically integration with screen readers;
22+ 2 . Richer model-based rendering, and the feature to define React Native props from
23+ within those models.
2324
2425As you will discover through this reading, both are somehow related. Let's find out how!
2526
@@ -34,7 +35,7 @@ However, it was limited to setting user agent styles (<APIReference
3435name = " HTMLElementModel" member = " mixedUAStyles" />),
3536although those styles could be derived from the DOM node element attributes
3637(the now-deprecated <APIReference name = " HTMLElementModel" member = " getUADerivedStyleFromAttributes" />).
37- The below example is a reminder of how those element models can be defined, for instance to
38+ The below example is a reminder on how those element models can be defined, for instance to
3839register a new ` <blue-circle> ` tag which renders to a 50 by 50 blue circle!
3940
4041``` js title="An Example of Model-Based Rendering"
@@ -70,10 +71,13 @@ related to specificity for a refresher.
7071Version 6.2 ships with a bunch of new fields for HTML element models which
7172should make model-based rendering more popular. Let's take a tour!
7273
73- ### ` getMixedUAStyles ` Tickles CSS Selectors!
74+ ### ` getMixedUAStyles `
7475
75- This field deprecates <APIReference name = " HTMLElementModel" member = " getUADerivedStyleFromAttributes" />; it's basically the same
76- but its signature has changed: it receives the target ` tnode ` and DOM ` element ` , which lets us implement CSS-selector-like behaviors:
76+ This field deprecates <APIReference name = " HTMLElementModel"
77+ member = " getUADerivedStyleFromAttributes" />; it serves the same purpose but its
78+ signature has changed. It now receives the target ` tnode ` and DOM ` element ` ,
79+ which lets us implement more fine-grained logic such as CSS-selector-like
80+ behaviors:
7781
7882``` js title="Conditionnaly remove margins of 'ol' direct descendents of 'p' elements."
7983import RenderHTML, {
@@ -114,9 +118,10 @@ to query the DOM and create your conditional styling rules.
114118
115119### ` reactNativeProps `
116120
117- This field will set props to the native component during the rendering phase.
118- It is an object with three optional properties (for reference, the shape of
119- this object is a <APIReference name = " ReactNativePropsDefinitions" />):
121+ This field holds props that will be passed to the native component during the
122+ rendering phase. It is an object with three optional properties (for reference,
123+ the shape of this object is a <APIReference name = " ReactNativePropsDefinitions"
124+ />):
120125
1211261 . ` text ` , to pass native props to the ` Text ` component when the renderer is textual;
1221272 . ` view ` , to pass native props to the ` View ` component when the renderer is block;
@@ -241,13 +246,6 @@ Nevertheless, those interactive element models are already shipped with the appr
241246The new Transient Render Engine will from now on
242247translate both attributes to their React Native counterparts.
243248
244- :::info Midly relevant
245- The mapping rules from the ` role ` HTML attribute to React Native props has
246- been greatly influenced by those of
247- [ ` react-native-web ` ] ( https://github.com/necolas/react-native-web/blob/66d01734ce3ffcfea61e05aa1b45015658b3f2af/packages/react-native-web/src/modules/AccessibilityUtil/propsToAriaRole.js ) ,
248- the other way round!
249- :::
250-
251249### Accessible ` <a> ` Tags
252250
253251` <a> ` tags now receive an ` accessibilityRole="link" ` prop when their ` href `
@@ -333,18 +331,16 @@ any other value to `selectable={true}`.
333331
334332## Bonus: Version 6.1 Features
335333
336-
337- ### ` renderIndex ` and ` renderLength ` Props to Custom Component Renderers
338-
339- Those props passed to custom component renderers give you positional
340- information regarding this element in the render tree. ` renderIndex ` will often
341- coincide with ` tnode.index ` but there are subtle differences.
334+ I didn't publish a release notes post for this version; I'm catching up
335+ here! From now on, I will try to write up a post for each minor and major
336+ release.
342337
343338### ` enableExperimentalBRCollapsing ` Prop
344339
345340This ** recommended prop** allows consumers to circumvent a bug in the Foundry
346341release where line breaks (` <br> ` ) would be printed erroneously, such
347- as at the end of a paragraph. It will be enabled by default in the next major
342+ as at the end of a paragraph. Its default it yet ` false ` to avoid introducing
343+ breaking changes but it will be enabled by default in the next major
348344release.
349345
350346:::tip learn more
@@ -353,28 +349,31 @@ Read the complete explanation for this prop [in the textual content guide](/docs
353349
354350### ` enableExperimentalGhostLinesPrevention ` Prop
355351
356- This ** recommended prop** allows to circumvent [ a React Native bug] ( https://github.com/facebook/react-native/issues/32062 ) where empty
357- ` Text ` elements would be printed as ghost lines of fixed height (around 20 dpi).
352+ This ** recommended prop** allows to circumvent [ a React Native
353+ bug] ( https://github.com/facebook/react-native/issues/32062 ) where empty ` Text `
354+ elements would be printed as ghost lines of fixed height (around 20 dpi). Its
355+ default it yet ` false ` to avoid introducing breaking changes but it will be
356+ enabled by default in the next major release.
358357
359358:::tip learn more
360359Read the complete explanation for this prop [ in the textual content guide] ( /docs/content/textual#empty-tags ) .
361360:::
362361
363362### ` provideEmbeddedHeaders ` Prop
364363
365- This is a function prop which allows consumer to generate HTTP headers for
366- remote resources. It currently works with ` <img> ` and ` <iframe> ` tags (from the
367- ` @native-html/iframe-plugin ` lib ).
364+ A function prop which allows to generate HTTP headers for
365+ remote resources. It currently works with ` <img> ` and ` <iframe> ` tags (since version 2.6 of the
366+ [ ` @native-html/iframe-plugin ` ] ( https://github.com/native-html/plugins/tree/master/packages/iframe-plugin#readme ) library ).
368367
369368:::tip learn more
370369See for example how it can be used with images [ in the image content guide] ( /docs/content/images#providing-headers ) .
371370:::
372371
373372### ` bypassAnonymousTPhrasingNodes ` Prop
374373
375- This prop makes the React rendering layer omit grouping (anonymous) ` TPhrasing `
376- nodes which have only one child. It is best learn by example. For instance, the
377- following HTML snippet:
374+ This prop, ` true ` by default, makes the React rendering layer bypass grouping
375+ (anonymous) ` TPhrasing ` nodes which have only one child. It is best understood by
376+ example. For instance, the following HTML snippet:
378377
379378``` html
380379<p >A sentence.</p >
@@ -410,7 +409,7 @@ the render tree will be simplified to:
410409```
411410
412411This behavior is preferred for many reasons. The most simple one is that it
413- simplifies the render tree. The less React element there is , the best it is
414- performance-wise. Moreover, there are a lot of React Native bugs implying
412+ simplifies the render tree. The less React elements there are , the best it is
413+ performance-wise. Moreover, there are a lot of React Native bugs related to
415414nested ` Text ` nodes, so this simplification limits the number of occurrences
416415of those bugs.
0 commit comments