Skip to content

Commit

Permalink
Merge pull request #2493 from kesha-antonov/optimize_rendering_and_ke…
Browse files Browse the repository at this point in the history
…yboard_smoothness_05_04_2024

Optimize rendering and keyboard smoothness
  • Loading branch information
kesha-antonov authored Aug 23, 2024
2 parents ff0c0ae + da6932d commit 3220278
Show file tree
Hide file tree
Showing 79 changed files with 12,743 additions and 10,694 deletions.
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

example/*
/lib
129 changes: 129 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
module.exports = {
env: {
es2021: true,
// jest: true,
browser: true,
node: true,
// 'jest/globals': true,
},
parser: '@typescript-eslint/parser',
extends: [
'standard',
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
"plugin:@typescript-eslint/eslint-recommended",
'plugin:@typescript-eslint/recommended',
'plugin:json/recommended-legacy',
'plugin:jest/recommended',
],
overrides: [
{
env: {
node: true,
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script',
project: './tsconfig.json',
},
},
// {
// files: ['*.snap'],
// processor: 'jest/.snap',
// },
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [
'@stylistic',
'react',
'react-hooks',
],
settings: {
react: {
version: 'detect',
},
},
rules: {
'react/react-in-jsx-scope': 0,
'@stylistic/no-explicit-any': 'off',
'react/no-unknown-property': 0,
'indent': [
'error',
2,
{
SwitchCase: 1,
VariableDeclarator: 'first',
ignoredNodes: ['TemplateLiteral'],
},
],
'template-curly-spacing': 'off',
'linebreak-style': ['off', 'unix'],
'quotes': ['error', 'single'],
'jsx-quotes': ['error', 'prefer-single'],
'@stylistic/semi': ['error', 'never'],
'@stylistic/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'none', // No semicolon for multiline
requireLast: true,
},
singleline: {
delimiter: 'comma', // Use comma for single line
requireLast: false,
},
},
],
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'never',
functions: 'never',
},
],
'arrow-parens': ['error', 'as-needed'],
'no-func-assign': 'off',
'no-class-assign': 'off',
'no-useless-escape': 'off',
'curly': [2, 'multi', 'consistent'],
'react/prop-types': 'off', // TODO: TURN ON AND FIX ALL WARNINGS
'react/display-name': 'off',
'react-hooks/exhaustive-deps': [
'warn',
{
additionalHooks:
'(useAnimatedStyle|useSharedValue|useAnimatedGestureHandler|useAnimatedScrollHandler|useAnimatedProps|useDerivedValue|useAnimatedRef|useAnimatedReact|useAnimatedReaction)',
// useAnimatedReaction
// USE RULE FUNC/FUNC/DEPS
},
],
'no-unused-vars': ['error'],
'brace-style': ['error', '1tbs', { allowSingleLine: false }],
'nonblock-statement-body-position': ['error', 'below'],
'@stylistic/jsx-closing-bracket-location': ['error', 'line-aligned'],
'no-unreachable': 'error',
},
globals: {
describe: 'readonly',
test: 'readonly',
jest: 'readonly',
expect: 'readonly',
fetch: 'readonly',
navigator: 'readonly',
__DEV__: 'readonly',
XMLHttpRequest: 'readonly',
FormData: 'readonly',
React$Element: 'readonly',
requestAnimationFrame: 'readonly',
},
}
21 changes: 0 additions & 21 deletions .eslintrc.js

This file was deleted.

11 changes: 0 additions & 11 deletions .flowconfig

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Exponent-*.app
lib/
coverage/
web-build/
.eslintcache
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn lint-staged
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
.expo-shared/
.circleci/
.github/
.prettierrc
.vscode/
example-expo/
example-slack-message/
Expand Down
12 changes: 0 additions & 12 deletions .prettierrc

This file was deleted.

4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ See PR [#1211](https://github.com/FaridSafi/react-native-gifted-chat/pull/1211)
interface Reply {
title: string
value: string
messageId?: any
messageId?: number | string
}

interface QuickReplies {
Expand Down Expand Up @@ -346,7 +346,6 @@ interface QuickReplies {
- **`timeFormat`** _(String)_ - Format to use for rendering times; default is `'LT'` (see [Day.js Format](https://day.js.org/docs/en/display/format))
- **`dateFormat`** _(String)_ - Format to use for rendering dates; default is `'ll'` (see [Day.js Format](https://day.js.org/docs/en/display/format))
- **`loadEarlier`** _(Bool)_ - Enables the "load earlier messages" button, required for `infiniteScroll`
- **`isKeyboardInternallyHandled`** _(Bool)_ - Determine whether to handle keyboard awareness inside the plugin. If you have your own keyboard handling outside the plugin set this to false; default is `true`
- **`onLoadEarlier`** _(Function)_ - Callback when loading earlier messages
- **`isLoadingEarlier`** _(Bool)_ - Display an `ActivityIndicator` when loading earlier messages
- **`renderLoading`** _(Function)_ - Render a loading view when initializing
Expand Down Expand Up @@ -385,7 +384,6 @@ interface QuickReplies {
- **`renderSend`** _(Function)_ - Custom send button; you can pass children to the original `Send` component quite easily, for example, to use a custom icon ([example](https://github.com/FaridSafi/react-native-gifted-chat/pull/487))
- **`renderAccessory`** _(Function)_ - Custom second line of actions below the message composer
- **`onPressActionButton`** _(Function)_ - Callback when the Action button is pressed (if set, the default `actionSheet` will not be used)
- **`bottomOffset`** _(Integer)_ - Distance of the chat from the bottom of the screen (e.g. useful if you display a tab bar)
- **`minInputToolbarHeight`** _(Integer)_ - Minimum height of the input toolbar; default is `44`
- **`listViewProps`** _(Object)_ - Extra props to be passed to the messages [`<ListView>`](https://facebook.github.io/react-native/docs/listview.html); some props can't be overridden, see the code in `MessageContainer.render()` for details
- **`textInputProps`** _(Object)_ - Extra props to be passed to the [`<TextInput>`](https://facebook.github.io/react-native/docs/textinput.html)
Expand Down
6 changes: 6 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ web-build/

# macOS
.DS_Store

ios/.xcode.env.local
*.hprof
.cxx/

/vendor/bundle/
Loading

0 comments on commit 3220278

Please sign in to comment.