Skip to content
Merged

0.22 #2895

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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 0 additions & 9 deletions .codesandbox/ci.json

This file was deleted.

154 changes: 154 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
module.exports = {
settings: {
react: {
version: '19.0',
flowVersion: '0.336.0'
}
},
// hermes parser to support Flow syntax
parser: 'hermes-eslint',
parserOptions: {
sourceType: 'module'
},
extends: ['prettier'],
plugins: ['react', 'react-hooks'],
env: {
browser: true,
es2021: true,
jest: true,
node: true
},
ignorePatterns: [
'coverage',
'dist',
'flow-typed',
'node_modules',
'packages/**/vendor/*',
'packages/**/.next'
],
// Flow built-in types
globals: {
ClientRect: 'readonly',
Readonly: 'readonly',
ReadonlyArray: 'readonly'
},
rules: {
camelcase: 'off',
'constructor-super': 'error',
'default-case': ['error', { commentPattern: '^no default$' }],
eqeqeq: ['error', 'allow-null'],
'handle-callback-err': ['error', '^(err|error)$'],
'new-cap': ['error', { newIsCap: true, capIsNew: false }],
'no-alert': 'warn',
'no-array-constructor': 'error',
'no-caller': 'error',
'no-case-declarations': 'error',
'no-class-assign': 'error',
'no-cond-assign': 'error',
'no-const-assign': 'error',
'no-control-regex': 'error',
'no-debugger': 'error',
'no-delete-var': 'error',
'no-dupe-args': 'error',
'no-dupe-class-members': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-empty-character-class': 'error',
'no-empty-pattern': 'error',
'no-eval': 'error',
'no-ex-assign': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-boolean-cast': 'error',
'no-fallthrough': 'error',
'no-floating-decimal': 'error',
'no-func-assign': 'error',
'no-implied-eval': 'error',
'no-inner-declarations': ['error', 'functions'],
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'error',
'no-iterator': 'error',
'no-label-var': 'error',
'no-labels': ['error', { allowLoop: false, allowSwitch: false }],
'no-lone-blocks': 'error',
'no-loop-func': 'error',
'no-multi-str': 'error',
'no-native-reassign': 'error',
'no-negated-in-lhs': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-object': 'error',
'no-new-require': 'error',
'no-new-symbol': 'error',
'no-new-wrappers': 'error',
'no-obj-calls': 'error',
'no-octal': 'error',
'no-octal-escape': 'error',
'no-path-concat': 'error',
'no-proto': 'error',
'no-redeclare': 'error',
'no-regex-spaces': 'error',
'no-return-assign': ['error', 'except-parens'],
'no-script-url': 'error',
'no-self-assign': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-shadow-restricted-names': 'error',
'no-sparse-arrays': 'error',
'no-this-before-super': 'error',
'no-throw-literal': 'error',
'no-undef': 'error',
'no-undef-init': 'error',
'no-unexpected-multiline': 'error',
'no-unmodified-loop-condition': 'error',
'no-unneeded-ternary': ['error', { defaultAssignment: false }],
'no-unreachable': 'error',
'no-unsafe-finally': 'error',
'no-unused-vars': ['error', { vars: 'all', args: 'none' }],
'no-useless-call': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'no-useless-constructor': 'error',
'no-useless-escape': 'error',
'no-var': 'error',
'no-with': 'error',
'prefer-const': 'error',
'prefer-rest-params': 'error',
quotes: [
'error',
'single',
{ avoidEscape: true, allowTemplateLiterals: true }
],
radix: 'error',
'use-isnan': 'error',
'valid-typeof': 'error',
yoda: ['error', 'never'],

// react
'react/display-name': 'off',
'react/jsx-no-bind': 'off',
'react/jsx-no-duplicate-props': 'error',
'react/jsx-no-undef': 'error',
'react/jsx-pascal-case': 'error',
'react/jsx-sort-props': 'error',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/no-did-mount-set-state': 'off',
'react/no-did-update-set-state': 'error',
'react/no-direct-mutation-state': 'error',
'react/no-multi-comp': 'off',
'react/no-string-refs': 'error',
'react/no-unknown-property': 'error',
'react/prefer-es6-class': 'error',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react/self-closing-comp': 'error',
'react/sort-comp': 'off',
'react/sort-prop-types': 'error',
'react/wrap-multilines': 'off',

// react-hooks
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn'
}
};
19 changes: 19 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[version]
0.336.0

[ignore]
**/__tests__/**
packages/*/dist/**
packages/benchmarks/**
packages/react-native-web-docs/**
packages/react-native-web-examples/**

[include]

[declarations]
.*/node_modules/.*

[libs]

[options]
munge_underscores=true
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ body:
- type: markdown
attributes:
value: |
Thank you for reporting an issue! Create a test case for your issue by forking this template https://codesandbox.io/s/6lx6ql1w5r
Thank you for reporting an issue! Create a minimal repository that reproduces the issue and link it below.
- type: checkboxes
attributes:
label: Is there an existing issue for this?
Expand Down Expand Up @@ -38,8 +38,8 @@ body:
- type: input
attributes:
label: Test case
description: Please provide a link to a reduced test case that reproduces the issue.
placeholder: 'https://codesandbox.io/s/6lx6ql1w5r'
description: Please provide a link to a repository with a reduced test case that reproduces the issue.
placeholder: 'https://github.com/your-username/your-repro-repo'
validations:
required: true
- type: textarea
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ jobs:
with:
build-script: 'compile'
omit-unchanged: 'true'
exclude: './packages/react-native-web/dist/cjs/{index.js,**/*.js}'
pattern: './packages/react-native-web/dist/{index.js,**/*.js}'
repo-token: '${{ secrets.GITHUB_TOKEN }}'
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lint-staged
1 change: 0 additions & 1 deletion .watchmanconfig

This file was deleted.

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ This is the development monorepo for "React Native for Web" and related projects
- `.github`
- Contains workflows used by GitHub Actions.
- Contains issue templates.
- `configs`
- Contains configuration files used by the monorepo tooling (compiling, linting, testing, etc.)
- `packages`
- [react-native-web](https://github.com/necolas/react-native-web/blob/master/packages/react-native-web)
- Contains the individual packages managed in the monorepo.
Expand Down
35 changes: 35 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
export default function (api) {
return {
plugins: [
['babel-plugin-syntax-hermes-parser', { parseLangTypes: 'flow' }],
'@babel/plugin-transform-flow-strip-types',

...(api.env('test')
? // Jest resolves paths without extensions. The extensions depend on other
// files on disk, which Jest's transform cache does not track.
[]
: // Output is published as "type": "module", which requires fully specified
// import paths (e.g. './View/index.js', 'fbjs/lib/invariant.js')
// Only list packages without an "exports" field in `includePackages`
[
[
'babel-plugin-fully-specified',
{ includePackages: ['fbjs/', 'styleq/'] }
]
])
],
presets: [
['@babel/preset-react', { useSpread: true }],
[
'@babel/preset-env',
{
loose: true,
modules: false,
targets: {
browsers: ['chrome 96', 'firefox 94', 'safari 15.1', 'ios_saf 15.1']
}
}
]
]
};
}
6 changes: 0 additions & 6 deletions configs/.eslintignore

This file was deleted.

Loading
Loading