Skip to content

Commit dc488ae

Browse files
fix: remove workaround for xcode 16.2
1 parent 3b9efd3 commit dc488ae

File tree

5 files changed

+4
-77
lines changed

5 files changed

+4
-77
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export const FALLBACK_BOB_VERSION = '0.40.8';
2-
export const FALLBACK_NITRO_MODULES_VERSION = '0.25.2';
2+
export const FALLBACK_NITRO_MODULES_VERSION = '0.26.2';
33
export const SUPPORTED_REACT_NATIVE_VERSION = '0.79.2';

packages/create-react-native-library/src/exampleApp/generateExampleApp.ts

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -313,76 +313,6 @@ export default async function generateExampleApp({
313313
gradleProperties += '\nnewArchEnabled=true';
314314
}
315315

316-
// nitro modules on xcode 16.2 requires ios 16 version because of the bug https://github.com/swiftlang/swift/issues/77909
317-
// full thread in https://github.com/mrousavy/nitro/issues/422
318-
if (
319-
config.project.viewConfig === 'nitro-view' ||
320-
config.project.moduleConfig === 'nitro-modules'
321-
) {
322-
const newTargetVersion = 16.0;
323-
324-
const podfile = await fs.readFile(
325-
path.join(directory, 'ios', 'Podfile'),
326-
'utf8'
327-
);
328-
329-
const postInstallLine = 'post_install do |installer|';
330-
// set pods deployement min version
331-
const podVersionOverride = `
332-
installer.pods_project.targets.each do |target|
333-
target.build_configurations.each do |config|
334-
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '${newTargetVersion}'
335-
end
336-
end
337-
`;
338-
339-
const insertionIndex = podfile.indexOf(postInstallLine);
340-
341-
if (insertionIndex !== -1) {
342-
const endOfMarkerLineIndex = podfile.indexOf('\n', insertionIndex);
343-
344-
if (endOfMarkerLineIndex !== -1) {
345-
const updatedPodfileContent =
346-
podfile.slice(0, endOfMarkerLineIndex) +
347-
podVersionOverride +
348-
podfile.slice(endOfMarkerLineIndex);
349-
350-
await fs.writeFile(
351-
path.join(directory, 'ios', 'Podfile'),
352-
updatedPodfileContent
353-
);
354-
}
355-
}
356-
357-
// set project deployement min version
358-
const project = await fs.readFile(
359-
path.join(
360-
directory,
361-
`ios/${config.project.name}Example.xcodeproj`,
362-
'project.pbxproj'
363-
),
364-
'utf8'
365-
);
366-
367-
// match whole IPHONEOS_DEPLOYMENT_TARGET line
368-
const deployementLineRegex =
369-
/^(\s*)IPHONEOS_DEPLOYMENT_TARGET\s*=\s*[^;]+;$/gm;
370-
const replacementPattern = `$1IPHONEOS_DEPLOYMENT_TARGET = ${newTargetVersion};`;
371-
const updatedContent = project.replace(
372-
deployementLineRegex,
373-
replacementPattern
374-
);
375-
376-
await fs.writeFile(
377-
path.join(
378-
directory,
379-
`ios/${config.project.name}Example.xcodeproj`,
380-
'project.pbxproj'
381-
),
382-
updatedContent
383-
);
384-
}
385-
386316
await fs.writeFile(
387317
path.join(directory, 'android', 'gradle.properties'),
388318
gradleProperties

packages/create-react-native-library/src/template.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ function getModuleConfig(projectType: ProjectType): ModuleConfig {
156156
return 'turbo-modules';
157157
case 'fabric-view':
158158
case 'library':
159+
case 'nitro-view':
159160
return null;
160161
}
161162
}

packages/create-react-native-library/templates/common/CONTRIBUTING.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ yarn
1818
```
1919

2020
> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development.
21-
> <% if (project.moduleConfig === 'nitro-modules' || project.viewConfig === 'nitro-view') { -%>
2221
23-
<% if (project.moduleConfig === 'nitro-modules') { -%>
22+
<% if (project.moduleConfig === 'nitro-modules' || project.viewConfig === 'nitro-view') { -%>
2423
This project uses Nitro Modules. If you're not familiar with how Nitro works, make sure to check the [Nitro Modules Docs](https://nitro.margelo.com/).
2524

2625
You need to run [Nitrogen](https://nitro.margelo.com/docs/nitrogen) to generate the boilerplate code required for this project. The example app will not build without this step.
@@ -36,8 +35,6 @@ To invoke **Nitrogen**, use the following command:
3635
yarn nitrogen
3736
```
3837

39-
<% } -%>
40-
4138
<% } -%>
4239
The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make.
4340

packages/create-react-native-library/templates/native-common/android/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ def getExtOrIntegerDefault(name) {
3535
}
3636

3737
android {
38-
if (supportsNamespace()) {
3938
<% if (project.moduleConfig === 'nitro-modules' || project.viewConfig === 'nitro-view') { -%>
40-
namespace "com.margelo.nitro.<%- project.package -%>"
39+
namespace "com.margelo.nitro.<%- project.package -%>"
4140
<% } else { -%>
4241
namespace "com.<%- project.package -%>"
4342
<% } -%>

0 commit comments

Comments
 (0)