Skip to content

Commit 1feaf63

Browse files
committed
docs: 6.2 release notes refinements
1 parent f4574a9 commit 1feaf63

File tree

2 files changed

+28
-19
lines changed

2 files changed

+28
-19
lines changed

apps/website/blog/2021-09-27-6-2-updates.mdx

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: Jules Sam. Randolph
44
author_title: Developer of React Native Render HTML v6
55
author_url: https://github.com/jsamr/
66
author_image_url: https://avatars.githubusercontent.com/u/3646758?v=4
7-
tags: [foundry, "release notes"]
7+
tags: [foundry, 'release notes']
88
description: A version focused on accessibility and enhanced model rendering.
99
image: img/foundry-announcement.png
1010
hide_table_of_contents: false
@@ -18,12 +18,17 @@ It has been over two months since the first final version of the Foundry
1818
release has been made public. This new version focuses on two areas of
1919
improvements:
2020

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.
21+
1. [Accessibility](https://en.wikipedia.org/wiki/Computer_accessibility), and more specifically integration with _VoiceOver_ and _TalkBack_ screen readers;
22+
2. Richer [model-based
23+
rendering](/docs/guides/custom-renderers#model-based-custom-rendering), and the
24+
feature to define React Native props from those models.
2425

2526
As you will discover through this reading, both are somehow related. Let's find out how!
2627

28+
:::info bonus
29+
This post also covers a due overview of features introduced in the previous 6.1 minor release.
30+
:::
31+
2732
<!--truncate-->
2833

2934
## You Might not Need a Custom Component Renderer
@@ -69,7 +74,7 @@ related to specificity for a refresher.
6974
:::
7075

7176
Version 6.2 ships with a bunch of new fields for HTML element models which
72-
should make model-based rendering more popular. Let's take a tour!
77+
should increase model-based rendering adoption. Let's take a tour!
7378

7479
### `getMixedUAStyles`
7580

@@ -123,9 +128,9 @@ rendering phase. It is an object with three optional properties (for reference,
123128
the shape of this object is a <APIReference name="ReactNativePropsDefinitions"
124129
/>):
125130

126-
1. `text`, to pass native props to the `Text` component when the renderer is textual;
127-
2. `view`, to pass native props to the `View` component when the renderer is block;
128-
3. `native`, to pass props to either `View` or `Text` components, irrespective of the renderer type.
131+
1. `text`, to pass native props to `Text`-backed renderers;
132+
2. `view`, to pass native props to `View`-backed renderers;
133+
3. `native`, to pass props to either `View` or `Text`-backed renderers.
129134

130135
In the next snippet, we are defining a custom tag, `<nav-widget>`, and setting
131136
accessibility props to any underlying native component for the render phase. We
@@ -249,7 +254,9 @@ translate both attributes to their React Native counterparts.
249254
### Accessible `<a>` Tags
250255

251256
`<a>` tags now receive an `accessibilityRole="link"` prop when their `href`
252-
attribute is non-empty. Let's see now how we could set [an accessibility hint](https://reactnative.dev/docs/accessibility#accessibilityhint) by
257+
attribute is non-empty. To link that part with model enhancements seen in
258+
the previous section, let's see now how we could set [an accessibility
259+
hint](https://reactnative.dev/docs/accessibility#accessibilityhint) by
253260
extending the HTML model:
254261

255262
```ts
@@ -258,9 +265,11 @@ import RenderHTML, { defaultHTMLElementModels } from 'react-native-render-html';
258265
// The eponym prop to pass to RenderHTML
259266
const customHTMLElementModels = {
260267
a: defaultHTMLElementModels.a.extend((aModel) => ({
261-
nativeProps: {
262-
...aModel.nativeProps,
263-
accessibilityHint: 'Open in your system web browser.'
268+
reactNativeProps: {
269+
native: {
270+
...aModel.reactNativeProps,
271+
accessibilityHint: 'Open in your system web browser.'
272+
}
264273
}
265274
}))
266275
};
@@ -294,9 +303,8 @@ for an upstream fix.
294303

295304
`<img>` tags have been accessible since the Foundry beta. But the accessibility
296305
props were set after the loading was complete. We have found that changing
297-
accessibility annotations depending on loading state can degrade aural
298-
experience. We have thus replaced this behavior by moving those props to the
299-
image container, to make it independent of the internal state.
306+
accessibility annotations on the fly can degrade aural
307+
experiences and have provided a fix.
300308

301309
:::info
302310
`accessibilityRole="image"` will be set for `<img>` only when either `alt` or
@@ -307,7 +315,8 @@ image container, to make it independent of the internal state.
307315

308316
React Native has a “header” accessibility role which screen reader users depend
309317
on widely to identify quickly the content hierarchy of a screen. Until this
310-
release, `react-native-render-html` did not pass this role to heading tags.
318+
release, `react-native-render-html` did not pass the appropriate role to
319+
heading tags.
311320

312321
## Other Enhancements
313322

doc-tools/doc-pages/src/pages/PageConceptTRE.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,7 @@ export default function PageConceptTRE() {
410410
</DListTitle>
411411
<DListItem>
412412
The position of this element relative to its parent,{' '}
413-
<Bold>before hoisting</Bold> and{' '}
414-
<Bold>after whitespace collapsing</Bold>.
413+
<Bold>after hoisting and collapsing</Bold>.
415414
</DListItem>
416415
<DListTitle>
417416
<RefTRE name="TNodeShape" member="children" />
@@ -471,7 +470,8 @@ export default function PageConceptTRE() {
471470
Markers can also be derived from attributes. This is the case with{' '}
472471
<RefHtmlAttr name="dir" /> and <RefHtmlAttr name="lang" /> attributes.
473472
Finally, you can customize the markers extraction logic with{' '}
474-
<RefRenderHtmlProp name="setMarkersForTNode" /> prop.
473+
<RefRenderHtmlProp name="setMarkersForTNode" /> prop and the eponym
474+
HTML model field.
475475
</Paragraph>
476476
</Chapter>
477477
</Page>

0 commit comments

Comments
 (0)