Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
8b106eb
Extract MisnamedModuleInterfaceParserError from Flow and Typescript i…
Oct 10, 2022
9fb6b77
Merge branch 'main' into extract-codegen-MisnamedModuleInterfaceParse…
Oct 10, 2022
2f33dea
Added unit test cases and other changes
Oct 10, 2022
2e203bc
Updated export and import of function
Oct 10, 2022
dce9e36
Merge branch 'main' into extract-codegen-MisnamedModuleInterfaceParse…
Oct 10, 2022
0bc8df2
Enabled flow in error-utils-test.js file
Oct 10, 2022
dc7f588
Merge branch 'main' into extract-codegen-MisnamedModuleInterfaceParse…
Oct 11, 2022
1a5c426
Merge branch 'facebook:main' into extract-codegen-MisnamedModuleInter…
mohitcharkha Oct 12, 2022
4e3deca
Extract contents of the case 'VoidTypeAnnotation' into a single emitV…
youedd Oct 12, 2022
d4c06a7
chore: Extract codegen case 'Stringish' into a single emitStringish f…
gabrieldonadel Oct 12, 2022
c40e87f
Cleanup Buck usages from New App Template (#34881)
cortinico Oct 12, 2022
2774725
Make react-native-codegen work on Windows within BUCK
christophpurrer Oct 12, 2022
c147ccf
Add more customization points in RCTAppDelegate (#34943)
cipolleschi Oct 12, 2022
72d985d
Suppress deprecation on reactRoot passed as deprecatedReactRoot
cortinico Oct 12, 2022
ee0b949
Move configureDevPorts inside AgpConfiguratorUtils and use finalizeDsl
cortinico Oct 12, 2022
550c570
add 0.70.3 changelog (#34958)
kelset Oct 12, 2022
14c9024
Set isPressable for onPressIn/Out (#34944)
rozele Oct 12, 2022
54b1556
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#3…
hramos Oct 12, 2022
68c996f
Add destructuredArrayIgnorePattern to eslint config (#33552)
fwcd Oct 12, 2022
9382d77
fix: Update incorrect `SwitchChangeEvent` type (#34931)
retyui Oct 12, 2022
e8a8f36
Circle CI: Test both Hermes and JSC on iOS (#34963)
hramos Oct 12, 2022
c30f425
Deploy 0.189.0 to xplat
pieterv Oct 12, 2022
d04dd95
Add offline mirrors to .gitignore
hramos Oct 12, 2022
f1fb906
Update Podfile.lock with Hermes
hramos Oct 12, 2022
dd0ce43
Remove old __offline_mirrors__ from gitignore
hramos Oct 12, 2022
11b4709
Circle CI: Fix release workflow (#34960)
hramos Oct 12, 2022
aae257f
supermodule:ios/isolation/infra.react_native
Oct 13, 2022
d992553
Remove clang-format opt-out for Libraries
NickGerleman Oct 13, 2022
bf6a5af
Extracted TypeDeclarationMap from flow and typescript to a common fil…
Oct 13, 2022
94c416c
Setup publishing for Snapshot and Stable on Maven (#34967)
cortinico Oct 13, 2022
bf74b95
Update info.plist (#34919)
erfinbadrian Oct 13, 2022
531e810
Ship VirtualizedList_EXPERIMENTAL
NickGerleman Oct 13, 2022
729569c
Use nested namespace name
sammy-SC Oct 13, 2022
cdccef4
Implement gap/row-gap/column-gap (within the C ABI)
NickGerleman Oct 13, 2022
666ede0
Implement method bindings for gap/row-gap/column-gap
NickGerleman Oct 13, 2022
1f859ad
Setup gradle-nexus to automate closing and releasing staging reposito…
cortinico Oct 13, 2022
b61aa8c
Remove enable_delayed_view_state_deletion_android feature flag
sammy-SC Oct 13, 2022
4037205
Delete feature flag remember_views_on_mount_android
sammy-SC Oct 13, 2022
e05fb66
Track state per pointer
lunaleaps Oct 13, 2022
3bcb583
Circle CI: Replace string parameters with enums where applicable (#34…
hramos Oct 13, 2022
9939f37
Add many pointers example
lunaleaps Oct 14, 2022
a788ce1
Back out "Set isPressable for onPressIn/Out"
makovkastar Oct 14, 2022
9b4592e
1/n Add new JsErrorHandler buck target to parse JS errors in C++
p-sun Oct 14, 2022
46c1f72
chore: Extract codegen ModuleInterfaceNotFoundParserError in a separa…
gabrieldonadel Oct 14, 2022
c4d50c0
Extracted MoreThanOneModuleRegistryCallsParserError exception to thro…
mohitcharkha Oct 14, 2022
017bd9c
Extracted UnusedModuleInterfaceParserError to throwIfUnusedModuleInte…
vinayharwani13 Oct 14, 2022
c82a0ff
Extracted IncorrectModuleRegistryCallArityParserError as a seperate f…
dakshbhardwaj Oct 14, 2022
4a5bc8a
Extracted IncorrectModuleRegistryCallTypeParameterParserError to thro…
Oct 14, 2022
c2968f9
Wrap the content of the case Array and case $ReadOnlyArray in Flow in…
MaeIg Oct 14, 2022
468f1c6
extracted `nullguard` function to `parsers-util.js` file (#34952)
dakshbhardwaj Oct 14, 2022
f5cf6f5
Extracted content of the case FunctionTypeAnnotation into emitFunctio…
Oct 14, 2022
918cc1b
extract emitMixedTypeAnnotation to parsers-commons (#34954)
tarunrajput Oct 14, 2022
15f974f
extracted `UntypedModuleRegistryCallParserError` to a throwing functi…
Oct 14, 2022
c519fa0
Extracted UnsupportedModulePropertyParserError into throwIfModuleType…
Oct 14, 2022
8a4f13d
supermodule:xplat/default/public.react_native.core
Oct 14, 2022
2b8e525
Add .metro-health-check to .gitignore
motiz88 Oct 14, 2022
4b8e9ab
Configure CircleCI to publish artifacts to Maven Central (#34983)
cortinico Oct 14, 2022
bb7340c
Improve typings for Platform.select on iOS
jbrown215 Oct 14, 2022
04f473e
Deploy 0.190.0 to xplat
SamChou19815 Oct 14, 2022
bf2cc69
Prevent red box when DiffClampAnimatedNode is not fully initialised
sammy-SC Oct 14, 2022
f0da316
fix: Eslint on Danger not matching project config (#34980)
gabrieldonadel Oct 14, 2022
bb0f67a
supermodule:xplat/default/public.react_native.tests
Oct 14, 2022
3d8e0bd
supermodule:xplat/default/public.react_native.playground
Oct 14, 2022
98467e1
Center text if line height isn't 0
sammy-SC Oct 14, 2022
4f8f9c8
Revert D40374535: Deploy 0.190.0 to xplat
Oct 14, 2022
301d4b0
2/n Code clarity: Use enum to clarify the values parsed by JsErrorHan…
p-sun Oct 14, 2022
35b7dd8
Improve the type of Platform.select for Android
jbrown215 Oct 14, 2022
803731e
React-jsidynamic: Move JSIDynamic out of React-jsi
hramos Oct 14, 2022
68a5917
Deploy 0.190.0 to xplat
SamChou19815 Oct 14, 2022
d5ba4bb
Defaults for jest.fn's type parameters
jbrown215 Oct 14, 2022
0c5f40c
Highlight elements on press + hove
tyao1 Oct 14, 2022
9a08ab5
Prefix web platform tests with wpt
lunaleaps Oct 14, 2022
02b42f1
Add option to only see failed tests
lunaleaps Oct 14, 2022
3e29a03
Add width, height, detail props
lunaleaps Oct 14, 2022
c419939
Fix or expose previously hidden type errors to prepare for LTI mode
SamChou19815 Oct 15, 2022
0a2c4ab
Merge branch 'main' into extract-codegen-MisnamedModuleInterfaceParse…
mohitcharkha Oct 17, 2022
a2e0039
Update packages/react-native-codegen/src/parsers/typescript/modules/i…
mohitcharkha Oct 17, 2022
43fba6a
Update packages/react-native-codegen/src/parsers/flow/modules/index.js
mohitcharkha Oct 17, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,41 @@
const {
throwIfModuleInterfaceNotFound,
throwIfMoreThanOneModuleRegistryCalls,
throwIfModuleInterfaceIsMisnamed,
throwIfUnusedModuleInterfaceParserError,
throwIfWrongNumberOfCallExpressionArgs,
throwIfIncorrectModuleRegistryCallTypeParameterParserError,
} = require('../error-utils');
const {
ModuleInterfaceNotFoundParserError,
MoreThanOneModuleRegistryCallsParserError,
MisnamedModuleInterfaceParserError,
UnusedModuleInterfaceParserError,
IncorrectModuleRegistryCallArityParserError,
IncorrectModuleRegistryCallTypeParameterParserError,
} = require('../errors');

describe('throwIfModuleInterfaceIsMisnamed', () => {
it("don't throw error if module interface name is Spec", () => {
const nativeModuleName = 'moduleName';
const specId = {name: 'Spec'};
const parserType = 'Flow';

expect(() => {
throwIfModuleInterfaceIsMisnamed(nativeModuleName, specId, parserType);
}).not.toThrow(MisnamedModuleInterfaceParserError);
});
it('throw error if module interface is misnamed', () => {
const nativeModuleName = 'moduleName';
const specId = {name: 'Name'};
const parserType = 'TypeScript';

expect(() => {
throwIfModuleInterfaceIsMisnamed(nativeModuleName, specId, parserType);
}).toThrow(MisnamedModuleInterfaceParserError);
});
});

describe('throwIfModuleInterfaceNotFound', () => {
it('throw error if there are zero module specs', () => {
const nativeModuleName = 'moduleName';
Expand Down
16 changes: 16 additions & 0 deletions packages/react-native-codegen/src/parsers/error-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import type {ParserType} from './errors';

const {
MisnamedModuleInterfaceParserError,
ModuleInterfaceNotFoundParserError,
MoreThanOneModuleRegistryCallsParserError,
UnusedModuleInterfaceParserError,
Expand All @@ -22,6 +23,20 @@ const {
UnsupportedModulePropertyParserError,
} = require('./errors.js');

function throwIfModuleInterfaceIsMisnamed(
nativeModuleName: string,
moduleSpecId: $FlowFixMe,
parserType: ParserType,
) {
if (moduleSpecId.name !== 'Spec') {
throw new MisnamedModuleInterfaceParserError(
nativeModuleName,
moduleSpecId,
parserType,
);
}
}

function throwIfModuleInterfaceNotFound(
numberOfModuleSpecs: number,
nativeModuleName: string,
Expand Down Expand Up @@ -174,6 +189,7 @@ function throwIfModuleTypeIsUnsupported(
}

module.exports = {
throwIfModuleInterfaceIsMisnamed,
throwIfModuleInterfaceNotFound,
throwIfMoreThanOneModuleRegistryCalls,
throwIfUnusedModuleInterfaceParserError,
Expand Down
1 change: 0 additions & 1 deletion packages/react-native-codegen/src/parsers/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class ParserError extends Error {
Error.captureStackTrace(this, this.constructor);
}
}

class MisnamedModuleInterfaceParserError extends ParserError {
constructor(nativeModuleName: string, id: $FlowFixMe, language: ParserType) {
super(
Expand Down
10 changes: 2 additions & 8 deletions packages/react-native-codegen/src/parsers/flow/modules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const {
typeAliasResolution,
} = require('../../parsers-primitives');
const {
MisnamedModuleInterfaceParserError,
MoreThanOneModuleInterfaceParserError,
UnnamedFunctionParamParserError,
UnsupportedArrayElementTypeAnnotationParserError,
Expand All @@ -70,6 +69,7 @@ const {

const {
throwIfModuleInterfaceNotFound,
throwIfModuleInterfaceIsMisnamed,
throwIfUnusedModuleInterfaceParserError,
throwIfWrongNumberOfCallExpressionArgs,
throwIfIncorrectModuleRegistryCallTypeParameterParserError,
Expand Down Expand Up @@ -613,13 +613,7 @@ function buildModuleSchema(

const [moduleSpec] = moduleSpecs;

if (moduleSpec.id.name !== 'Spec') {
throw new MisnamedModuleInterfaceParserError(
hasteModuleName,
moduleSpec.id,
language,
);
}
throwIfModuleInterfaceIsMisnamed(hasteModuleName, moduleSpec.id, language);

// Parse Module Names
const moduleName = tryParse((): string => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const {
typeAliasResolution,
} = require('../../parsers-primitives');
const {
MisnamedModuleInterfaceParserError,
MoreThanOneModuleInterfaceParserError,
UnnamedFunctionParamParserError,
UnsupportedArrayElementTypeAnnotationParserError,
Expand All @@ -73,6 +72,7 @@ const {
throwIfModuleTypeIsUnsupported,
throwIfUnusedModuleInterfaceParserError,
throwIfModuleInterfaceNotFound,
throwIfModuleInterfaceIsMisnamed,
throwIfWrongNumberOfCallExpressionArgs,
throwIfIncorrectModuleRegistryCallTypeParameterParserError,
} = require('../../error-utils');
Expand Down Expand Up @@ -627,13 +627,7 @@ function buildModuleSchema(

const [moduleSpec] = moduleSpecs;

if (moduleSpec.id.name !== 'Spec') {
throw new MisnamedModuleInterfaceParserError(
hasteModuleName,
moduleSpec.id,
language,
);
}
throwIfModuleInterfaceIsMisnamed(hasteModuleName, moduleSpec.id, language);

// Parse Module Names
const moduleName = tryParse((): string => {
Expand Down