Skip to content

Commit 3200f62

Browse files
authored
Deprecate NativeModuleSample/cppwinrt and NativeModuleSample/csharp (#1033)
## Description This PR deprecates the NativeModuleSample/cppwinrt and NativeModuleSample/csharp samples, moving them to `samples-old/`, removing them from CI, and updating the links in our docs. This PR also cleans up some ancialliary files used by the website (like `.spelling` and some versioned sidebars) ### Why Starting with 0.79 we no longer support creating new projects with the old library templates that these samples represent. See microsoft/react-native-windows@bfe285b ## Screenshots N/A ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/react-native-windows-samples/pull/1033)
1 parent cc3aed3 commit 3200f62

File tree

104 files changed

+2221
-2036
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+2221
-2036
lines changed

.github/workflows/ci-upgrade.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
strategy:
4141
fail-fast: false
4242
matrix:
43-
sampleName: ['NativeModuleSample\cpp-lib', 'NativeModuleSample\cppwinrt', 'NativeModuleSample\csharp']
43+
sampleName: ['NativeModuleSample\cpp-lib']
4444
configuration: ['Debug', 'Release']
4545
platform: ['x86', 'x64', 'ARM64']
4646
reactNativeWindowsVersion: [latest, preview, canary]

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
strategy:
3838
fail-fast: false
3939
matrix:
40-
sampleName: ['NativeModuleSample\cpp-lib', 'NativeModuleSample\cppwinrt', 'NativeModuleSample\csharp']
40+
sampleName: ['NativeModuleSample\cpp-lib']
4141
configuration: ['Debug', 'Release']
4242
platform: ['x86', 'x64', 'ARM64']
4343
uses: ./.github/workflows/template-buildsample.yml

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
strategy:
6767
fail-fast: true
6868
matrix:
69-
sampleName: ['NativeModuleSample\cpp-lib', 'NativeModuleSample\cppwinrt', 'NativeModuleSample\csharp']
69+
sampleName: ['NativeModuleSample\cpp-lib']
7070
configuration: ['Debug', 'Release']
7171
platform: ['x86']
7272
uses: ./.github/workflows/template-buildsample.yml

.spelling

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ nvs
6868
packages.config
6969
PDBs
7070
PluralSight
71-
PowerShell
7271
Popup
72+
PowerShell
7373
pre-built
7474
pre-filtered
7575
pre-installed
@@ -80,18 +80,18 @@ Quickstart
8080
react-native
8181
react-native-macos
8282
react-native-windows
83+
RefreshControl
8384
repo
8485
repos
85-
RefreshControl
8686
RNW-on-WinUI
8787
roadmap
8888
run-windows
8989
runtime
9090
runtimes
9191
schemas
92+
ScrollView
9293
shiftKey
9394
Sourcetree
94-
ScrollView
9595
struct
9696
symlink
9797
symlinks

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The content here features React Native sample apps, components, and templates fo
2323
|:-------|:------------|
2424
| [Calculator](./samples/Calculator) | A sample RNW app implementing a simple calculator with both C++ and C# implementations. |
2525
| [ContinuousIntegration](./samples/ContinuousIntegration) | Sample CI pipeline configurations for RNW projects. |
26-
| [NativeModuleSample](./samples/NativeModuleSample) | A sample RNW native module with both C++ and C# implementations. |
26+
| [NativeModuleSample](./samples/NativeModuleSample) | A sample RNW Native Module and Native Component. |
2727
| [ReactNativeWinRT](https://github.com/microsoft/react-native-winrt/tree/main/samples/RNWinRTTestApp) | A sample RNW app that uses [React Native WinRT](aka.ms/reactnativewinrt) to consume native WinRT APIs. |
2828

2929
</div>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Native Module Sample - React Native for Windows
2+
3+
These samples showcase building Native Modules for React Native for Windows. It includes implementations in [C#](./csharp/) and [C++/WinRT](./cppwinrt/).
4+
5+
Both implementations target React Native Windows 0.78.
6+
7+
>**Note: Don't build your own projects directly out of these samples. When you publish a native module (as source), you'll want to create a new project with the correct metadata. This will also make sure that you're using unique identifiers in your project files (\*.csproj/\*.vcxproj) to avoid conflicts with other native modules.**
8+
9+
### Setup
10+
First, make sure you've met the [React Native Windows System Requirements](https://microsoft.github.io/react-native-windows/docs/rnw-dependencies).
11+
12+
Then, within either the `cppwinrt` or `csharp` folder, install the module's dependencies. If you have `yarn` installed:
13+
14+
```cmd
15+
yarn install
16+
```
17+
18+
Otherwise, you can just use npm:
19+
20+
```cmd
21+
npm install
22+
```
23+
24+
### Run
25+
Once you have all of the dependencies installed, you can build either module with following command (again, run within either the `cppwinrt` or `csharp` folder):
26+
27+
```cmd
28+
npx @react-native-community/cli@latest run-windows --no-deploy --no-launch --no-packager --no-autolink --proj "NativeModuleSample\NativeModuleSample.vsproj"
29+
30+
```
31+
32+
### Upgrade
33+
To upgrade either sample to the latest version of RNW, see their individual readme file.
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
1-
# OSX
2-
#
3-
.DS_Store
4-
5-
# Xcode
6-
#
7-
build/
8-
*.pbxuser
9-
!default.pbxuser
10-
*.mode1v3
11-
!default.mode1v3
12-
*.mode2v3
13-
!default.mode2v3
14-
*.perspectivev3
15-
!default.perspectivev3
16-
xcuserdata
17-
*.xccheckout
18-
*.moved-aside
19-
DerivedData
20-
*.hmap
21-
*.ipa
22-
*.xcuserstate
23-
24-
# Android/IntelliJ
25-
#
26-
build/
27-
.idea
28-
.gradle
29-
local.properties
30-
*.iml
31-
32-
# node.js
33-
#
34-
node_modules/
35-
npm-debug.log
36-
yarn-error.log
37-
38-
# BUCK
39-
buck-out/
40-
\.buckd/
41-
*.keystore
42-
!debug.keystore
43-
44-
# fastlane
45-
#
46-
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47-
# screenshots whenever they are needed.
48-
# For more information about the recommended setup visit:
49-
# https://docs.fastlane.tools/best-practices/source-control/
50-
51-
*/fastlane/report.xml
52-
*/fastlane/Preview.html
53-
*/fastlane/screenshots
54-
55-
# Bundle artifact
56-
*.jsbundle
57-
58-
# CocoaPods
59-
/ios/Pods/
60-
61-
**/*.binlog
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
24+
# Android/IntelliJ
25+
#
26+
build/
27+
.idea
28+
.gradle
29+
local.properties
30+
*.iml
31+
32+
# node.js
33+
#
34+
node_modules/
35+
npm-debug.log
36+
yarn-error.log
37+
38+
# BUCK
39+
buck-out/
40+
\.buckd/
41+
*.keystore
42+
!debug.keystore
43+
44+
# fastlane
45+
#
46+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47+
# screenshots whenever they are needed.
48+
# For more information about the recommended setup visit:
49+
# https://docs.fastlane.tools/best-practices/source-control/
50+
51+
*/fastlane/report.xml
52+
*/fastlane/Preview.html
53+
*/fastlane/screenshots
54+
55+
# Bundle artifact
56+
*.jsbundle
57+
58+
# CocoaPods
59+
/ios/Pods/
60+
61+
**/*.binlog

0 commit comments

Comments
 (0)