Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: { jsx: true },
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'prettier',
],
plugins: ['@typescript-eslint', 'react', 'react-hooks'],
settings: {
react: { version: 'detect' },
},
rules: {
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'react/prop-types': 'off',
},
overrides: [
{
files: ['**/__tests__/**'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
},
},
],
ignorePatterns: ['lib/', 'example/', 'node_modules/'],
};
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/node_modules
/.idea
package-lock.json
/.DS_Store
/.DS_Store
/lib/
*.tsbuildinfo
3 changes: 0 additions & 3 deletions .npmignore

This file was deleted.

40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Changelog

## 4.0.0-alpha.0

### Breaking Changes

- **Minimum React 18.0.0** (was 16.2.0)
- **Minimum React Native 0.73.0** (was 0.50.4)
- **`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.
- **`prop-types` removed** - Runtime prop validation is no longer performed. Use TypeScript for type checking.
- **Class component replaced with function component** - `<Markdown>` is now a function component using hooks. Code relying on class instance methods or refs will break.
- **`markdown-it` upgraded from ^8 to ^14** - Custom markdown-it plugins should verify compatibility.
- **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`.

### New Features

- Full TypeScript source with auto-generated type declarations
- Exported types: `ASTNode`, `RenderFunction`, `RenderRules`, `MarkdownStyles`, `MarkdownProps`
- ESM module output via react-native-builder-bob
- Proper memoization using `useMemo` hooks for better rendering performance

### Improvements

- All source converted from JavaScript to TypeScript
- Deprecated `componentWillMount` and `componentWillReceiveProps` replaced with hooks
- Broken `PropTypes` import from `react` removed in AstRenderer
- Unused `React` and `View` imports removed from parser
- ESLint + Prettier configured
- Jest test suite with 99 tests across 17 suites
- Integration snapshot tests for comprehensive markdown rendering

### Removed

- `react-native-fit-image` dependency
- `prop-types` dependency
- `chokidar` and `fs-extra` dev dependencies
- `bin/` build scripts (replaced by react-native-builder-bob)
- `export.json` debug artifact
- Hand-written `index.d.ts` (replaced by auto-generated types)
- `.npmignore` (replaced by `files` field in package.json)
Loading