Releases: patrickkabwe/react-native-nitro-text
Releases · patrickkabwe/react-native-nitro-text
v1.1.0
v1.1.0-next.1
1.1.0-next.1 (2025-10-08)
🎉 HTML Support
This release adds support for HTML rendering on both Android and iOS platforms. Please note that the API for this feature is still being finalized, but it provides a solid foundation to get started.
Example Usage:
import { NitroText as Text } from 'react-native-nitro-text';
const App = () => {
const someStringFromServer = `<p>Hello <strong>world</strong>!</p>
<h1>Welcome</h1>
<a href="https://example.com">Visit our site</a>`;
return (
<Text
renderer="html"
renderStyles={{
a: {
color: 'blue',
textDecorationLine: 'underline'
},
h1: {
fontSize: 24,
fontWeight: 'bold'
},
p: {
fontSize: 16
}
}}
>
{someStringFromServer}
</Text>
);
};✨ Features
📚 Documentation
- add CONTRIBUTING.md and issue templates for better community engagement (#48) (a213abe)
- update README.md for improved clarity and formatting (#59) (dbe93aa)
🛠️ Other changes
v1.0.3
v1.0.2
v1.0.1
v1.0.0
1.0.0 (2025-09-21)
✨ Features
- ios: add allowFontScaling, letterSpacing, DynamicTypeRamp; align Fabric measurement with native (transform, metrics); coalesce Swift updates; fix textTransform updates and dynamic type mapping (42129d6)
- ios: add ellipsizeMode support\n\n- Adds new prop ellipsizeMode: 'head' | 'middle' | 'tail' | 'clip'\n- Wires prop through Nitro generated layers (manual patches)\n- Implements mapping in NitroTextImpl using NSLineBreakMode, including multi-line\n- Mirrors truncation in paragraph style for attributed text\n- Updates JS types and config (98b65cf)
- iOS: add lineBreakStrategyIOS support (render + measure) (c13d89d)
- IOS: add text decoration support in NitroText (986c873)
- ios: enhance ellipsizeMode support (983a7d5)
- ios: honor ellipsizeMode for single-line; coerce multi-line to tail/clip\n\n- Add effectiveLineBreakMode helper and apply everywhere\n- Reapply lineBreakMode on numberOfLines/ellipsizeMode changes\n- Fix missing setNeedsLayout in setNumberOfLines (d5f3fb1)
- ios: introduce Fabric NitroText with native iOS view, fragments, selection, and measurement (9067d25)
- iOS: support maxFontSizeMultiplier, adjustsFontSizeToFit, minimumFontScale (wiring + measure); cap scaling in renderer (775e48d)
- text: add allowFontScaling support; honor RN default fontSizeMultiplier=1.0; update NitroTextShadowNode measurement and iOS font scaling (8980cd5)
- text: add fontFamily and selectionColor props; support generic iOS UI font families; pressed highlighting with suppressHighlighting; update ShadowNode measurement (9f56183)
- text: add letterSpacing support matching RN Text (TS props, config, bridge); apply NSKern in iOS; include in Fabric measurement; merge top-level + fragments (d489f64)
🐛 Bug Fixes
- ios: align Fabric text measurement with rendering when font scaling enabled by setting dynamicTypeRamp=Body and applying baseline offset for custom lineHeight; reduces extra bottom spacing (dd6669c)
- ios: apply ellipsizeMode-derived lineBreakMode and request layout\n\n- Ensure setNumberOfLines and setEllipsizeMode call setNeedsLayout\n- Paragraph style and textContainer use effectiveLineBreakMode derived from current ellipsizeMode + numberOfLines\n- Aligns behavior with RN for multi-line clip/tail (fe367ad)
- iOS: match RN Text scaling precisely (5d58b48)
- ios: multi-line clip should wrap to N lines (use WordWrapping)\n\n- For numberOfLines > 1 and ellipsizeMode=clip, use .byWordWrapping\n- Prevents single-line clipping and matches RN Text behavior (bdb4a93)
💨 Performance Improvements
- ios: cache UIFonts and request layout on truncation changes\n\n- Add small font cache keyed by size/weight/italic to avoid repeated font recreation\n- Call setNeedsLayout on numberOfLines/ellipsizeMode changes to ensure efficient relayout\n- Keep helpers accessible from extensions (5580bfb)
🔄 Code Refactors
- Extract helpers to simplify setFragments\n\n- Split into makeAttributes/makeFont/makeParagraphStyle/resolveColor/transform\n- Preserve behavior (weights, italics, colors, alignment, truncation)\n- Improves readability and maintainability (7ca2faa)
- iOS: clean up whitespace and improve code formatting in NitroText and NitroTextImpl classes (13a5926)
- ios: extract attribute builders to NitroTextImpl+Attributes.swift\n\n- Move makeAttributes/makeParagraphStyle/resolveColor/transform into an extension file\n- Relax access controls so extensions can read state (alignment, transform, container)\n- Keep NitroTextImpl.swift focused on core logic (4f24327)
- ios: extract fragment/default merging into NitroTextImpl+Fragment.swift\n\n- Move FragmentTopDefaults, apply(...) and fontWeight mapping to an extension file\n- Keep NitroTextImpl.swift focused on layout/render logic (f0d637c)
- ios: move all font logic to NitroTextImpl+Font.swift\n\n- Extract makeFont(for:defaultPointSize:) into +Font extension\n- Update callers to pass default point size\n- Keeps NitroTextImpl.swift focused on non-font responsibilities (5373ed3)
- ios: move FontKey struct inside NitroTextImpl extension (8a40eb1)
- ios: move fontWeightFromString to NitroTextImpl+Font.swift\n\n- Keep +Fragment focused on fragment/default merging\n- Group font mapping in a dedicated +Font extension (e24e09d)
- ios: move fragment/defaults merge into NitroTextImpl\n\n- Add FragmentTopDefaults and apply(fragments:text:top:) in NitroTextImpl\n- Delegate merging from HybridNitroText to NitroTextImpl\n- Keeps Hybrid class thin and centralizes render logic (d7791c4)
- ios: remove commented-out code and improve formatting in HybridNitroText and NitroTextImpl (43c5416)
- iOS: remove custom lineHeight handling from NitroText attributes (b1e93ce)
- ios: rename fontWeightFromString -> uiFontWeight(for:) to reflect behavior (478d264)
- text: streamline property updates in HybridNitroText to use markNeedsApply for deferred processing (fcd8acf)
- utils: simplify style handling in getFragmentConfig (72772bd)
📚 Documentation
- README: keep the docs simple (94936ae)
- README: replace Parity Roadmap with concrete checklist and add Text vs NitroText table (66f4070)
- README: Update features and props documentation to reflect recent changes. (384abe3)
- update package description and README for NitroText component (a605715)