Skip to content

Commit 0d70e3a

Browse files
committed
feat: react-native-markdown-renderer v4.0.0
2 parents 260fad0 + 8c169bd commit 0d70e3a

156 files changed

Lines changed: 4895 additions & 20433 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
module.exports = {
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
parserOptions: {
5+
ecmaVersion: 2020,
6+
sourceType: 'module',
7+
ecmaFeatures: { jsx: true },
8+
},
9+
extends: [
10+
'eslint:recommended',
11+
'plugin:@typescript-eslint/recommended',
12+
'plugin:react/recommended',
13+
'plugin:react-hooks/recommended',
14+
'prettier',
15+
],
16+
plugins: ['@typescript-eslint', 'react', 'react-hooks'],
17+
settings: {
18+
react: { version: 'detect' },
19+
},
20+
rules: {
21+
'react/react-in-jsx-scope': 'off',
22+
'@typescript-eslint/no-explicit-any': 'warn',
23+
'react/prop-types': 'off',
24+
},
25+
overrides: [
26+
{
27+
files: ['**/__tests__/**'],
28+
rules: {
29+
'@typescript-eslint/no-explicit-any': 'off',
30+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
31+
},
32+
},
33+
],
34+
ignorePatterns: ['lib/', 'example/', 'node_modules/'],
35+
};

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/node_modules
22
/.idea
33
package-lock.json
4-
/.DS_Store
4+
/.DS_Store
5+
/lib/
6+
*.tsbuildinfo

.npmignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Changelog
2+
3+
## 4.0.0
4+
5+
### Breaking Changes
6+
7+
- **Minimum React 18.0.0** (was 16.2.0)
8+
- **Minimum React Native 0.73.0** (was 0.50.4)
9+
- **`react-native-fit-image` removed** - The default `image` render rule now uses React Native's built-in `<Image>` component. Users who need auto-sizing image behavior should provide a custom `image` render rule.
10+
- **`prop-types` removed** - Runtime prop validation is no longer performed. Use TypeScript for type checking.
11+
- **Class component replaced with function component** - `<Markdown>` is now a function component using hooks. Code relying on class instance methods or refs will break.
12+
- **`markdown-it` upgraded from ^8 to ^14** - Custom markdown-it plugins should verify compatibility.
13+
- **Package entry points changed** - `main` now points to `lib/commonjs/index.js`, `module` to `lib/module/index.js`, `types` to `lib/typescript/index.d.ts`.
14+
15+
### New Features
16+
17+
- Full TypeScript source with auto-generated type declarations
18+
- Exported types: `ASTNode`, `RenderFunction`, `RenderRules`, `MarkdownStyles`, `MarkdownProps`
19+
- ESM module output via react-native-builder-bob
20+
- Proper memoization using `useMemo` hooks for better rendering performance
21+
22+
### Improvements
23+
24+
- All source converted from JavaScript to TypeScript
25+
- Deprecated `componentWillMount` and `componentWillReceiveProps` replaced with hooks
26+
- Broken `PropTypes` import from `react` removed in AstRenderer
27+
- Unused `React` and `View` imports removed from parser
28+
- ESLint + Prettier configured
29+
- Jest test suite with 99 tests across 17 suites
30+
- Integration snapshot tests for comprehensive markdown rendering
31+
32+
### Removed
33+
34+
- `react-native-fit-image` dependency
35+
- `prop-types` dependency
36+
- `chokidar` and `fs-extra` dev dependencies
37+
- `bin/` build scripts (replaced by react-native-builder-bob)
38+
- `export.json` debug artifact
39+
- Hand-written `index.d.ts` (replaced by auto-generated types)
40+
- `.npmignore` (replaced by `files` field in package.json)

0 commit comments

Comments
 (0)