@react-native/codegen 0.78.0-nightly-20250109-cfec590f6 → 0.78.0-nightly-20250111-83699228c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,6 +46,7 @@ for (const file of schemaFiles) {
46
46
  const schema = JSON.parse(fs.readFileSync(file, 'utf8'));
47
47
  if (schema.modules) {
48
48
  for (const specName in schema.modules) {
49
+ var _module$excludedPlatf;
49
50
  const module = schema.modules[specName];
50
51
  if (modules[specName]) {
51
52
  assert.deepEqual(
@@ -54,11 +55,20 @@ for (const file of schemaFiles) {
54
55
  `App contained two specs with the same file name '${specName}'. Schemas: ${specNameToFile[specName]}, ${file}. Please rename one of the specs.`,
55
56
  );
56
57
  }
57
- if (
58
- module.excludedPlatforms &&
59
- module.excludedPlatforms.indexOf(platform) >= 0
60
- ) {
61
- continue;
58
+ const excludedPlatforms =
59
+ (_module$excludedPlatf = module.excludedPlatforms) === null ||
60
+ _module$excludedPlatf === void 0
61
+ ? void 0
62
+ : _module$excludedPlatf.map(excludedPlatform =>
63
+ excludedPlatform.toLowerCase(),
64
+ );
65
+ if (excludedPlatforms != null) {
66
+ const cxxOnlyModule =
67
+ excludedPlatforms.includes('ios') &&
68
+ excludedPlatforms.includes('android');
69
+ if (!cxxOnlyModule && excludedPlatforms.includes(platform)) {
70
+ continue;
71
+ }
62
72
  }
63
73
  modules[specName] = module;
64
74
  specNameToFile[specName] = file;
@@ -71,11 +71,18 @@ for (const file of schemaFiles) {
71
71
  );
72
72
  }
73
73
 
74
- if (
75
- module.excludedPlatforms &&
76
- module.excludedPlatforms.indexOf(platform) >= 0
77
- ) {
78
- continue;
74
+ const excludedPlatforms = module.excludedPlatforms?.map(
75
+ excludedPlatform => excludedPlatform.toLowerCase(),
76
+ );
77
+
78
+ if (excludedPlatforms != null) {
79
+ const cxxOnlyModule =
80
+ excludedPlatforms.includes('ios') &&
81
+ excludedPlatforms.includes('android');
82
+
83
+ if (!cxxOnlyModule && excludedPlatforms.includes(platform)) {
84
+ continue;
85
+ }
79
86
  }
80
87
 
81
88
  modules[specName] = module;
@@ -36,7 +36,7 @@ package ${packageName};
36
36
 
37
37
  ${imports}
38
38
 
39
- public interface ${className}<T extends ${extendClasses}> {
39
+ public interface ${className}<T extends ${extendClasses}> extends ViewManagerWithGeneratedInterface {
40
40
  ${methods}
41
41
  }
42
42
  `;
@@ -52,7 +52,7 @@ package ${packageName};
52
52
 
53
53
  ${imports}
54
54
 
55
- public interface ${className}<T extends ${extendClasses}> {
55
+ public interface ${className}<T extends ${extendClasses}> extends ViewManagerWithGeneratedInterface {
56
56
  ${methods}
57
57
  }
58
58
  `;
@@ -28,6 +28,11 @@ function toSafeJavaString(input, shouldUpperCaseFirst) {
28
28
  }
29
29
  function getImports(component, type) {
30
30
  const imports = new Set();
31
+ if (type === 'interface') {
32
+ imports.add(
33
+ 'import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;',
34
+ );
35
+ }
31
36
  component.extendsProps.forEach(extendProps => {
32
37
  switch (extendProps.type) {
33
38
  case 'ReactNativeBuiltInType':
@@ -43,6 +43,12 @@ function getImports(
43
43
  ): Set<string> {
44
44
  const imports: Set<string> = new Set();
45
45
 
46
+ if (type === 'interface') {
47
+ imports.add(
48
+ 'import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;',
49
+ );
50
+ }
51
+
46
52
  component.extendsProps.forEach(extendProps => {
47
53
  switch (extendProps.type) {
48
54
  case 'ReactNativeBuiltInType':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native/codegen",
3
- "version": "0.78.0-nightly-20250109-cfec590f6",
3
+ "version": "0.78.0-nightly-20250111-83699228c",
4
4
  "description": "Code generation tools for React Native",
5
5
  "license": "MIT",
6
6
  "repository": {