Skip to content

Commit

Permalink
Deprecate CalculatorNuGet sample (#952)
Browse files Browse the repository at this point in the history
## Description

Move the CalculatorNuget sample to the samples-old folder and remove it
from CI.

### Why
With 0.75 we're essentially steering folks away from using the
experimental nuget by switching to the new `init-windows` CLI command.
We don't need this sample anymore.

## Screenshots
N/A

###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/react-native-windows-samples/pull/952)
  • Loading branch information
jonthysell authored Jul 31, 2024
1 parent 6d2dc5a commit 69ba966
Show file tree
Hide file tree
Showing 97 changed files with 211 additions and 266 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/ci-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,6 @@ jobs:
runInitWindows: true
extraInitWindowsArgs: --language ${{ endsWith(matrix.sampleName, 'cppwinrt') && 'cpp' || 'cs' }}

call-upgradesample-calculator-nuget:
name: Upgrade Calculator NuGet
needs: setupcheck
strategy:
fail-fast: false
matrix:
sampleName: ['CalculatorNuGet']
configuration: ['Debug', 'Release']
platform: ['x86', 'x64', 'ARM64']
reactNativeWindowsVersion: [latest, preview, canary]
uses: ./.github/workflows/template-upgradesample.yml
with:
sampleName: ${{ matrix.sampleName }}
reactNativeWindowsVersion: ${{ matrix.reactNativeWindowsVersion }}
configuration: ${{ matrix.configuration }}
platform: ${{ matrix.platform }}
runInitWindows: true
extraInitWindowsArgs: --experimentalNuGetDependency true

call-upgradesample-native-module-sample:
name: Upgrade Native Module Sample
needs: setupcheck
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,6 @@ jobs:
configuration: ${{ matrix.configuration }}
platform: ${{ matrix.platform }}

call-buildsample-calculator-nuget:
name: Build Calculator NuGet
needs: setupcheck
strategy:
fail-fast: false
matrix:
sampleName: ['CalculatorNuGet']
configuration: ['Debug', 'Release']
platform: ['x86', 'x64', 'ARM64']
uses: ./.github/workflows/template-buildsample.yml
with:
sampleName: ${{ matrix.sampleName }}
configuration: ${{ matrix.configuration }}
platform: ${{ matrix.platform }}

call-buildsample-native-module-sample:
name: Build Native Module Sample
needs: setupcheck
Expand Down
22 changes: 1 addition & 21 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
# These outputs must be set otherwise the dependent jobs won't have access to them
app-service-demo: ${{ steps.filter.outputs.app-service-demo }}
calculator: ${{ steps.filter.outputs.calculator }}
calculator-nuget: ${{ steps.filter.outputs.calculator-nuget }}
native-module-sample: ${{ steps.filter.outputs.native-module-sample }}
website: ${{ steps.filter.outputs.website }}
workflows: ${{ steps.filter.outputs.workflows }}
Expand All @@ -36,9 +35,6 @@ jobs:
calculator:
- '.github/workflows/template-buildsample.yml'
- 'samples/Calculator/**'
calculator-nuget:
- '.github/workflows/template-buildsample.yml'
- 'samples/CalculatorNuGet/**'
native-module-sample:
- '.github/workflows/template-buildsample.yml'
- 'samples/NativeModuleSample/**'
Expand Down Expand Up @@ -83,22 +79,6 @@ jobs:
platform: ${{ matrix.platform }}
skipBuild: ${{ needs.setupcheck.outputs.workflows != 'true' && needs.setupcheck.outputs.calculator != 'true' }} # Skip if files haven't changed

call-buildsample-calculator-nuget:
name: Build Calculator NuGet
needs: setupcheck
strategy:
fail-fast: true
matrix:
sampleName: ['CalculatorNuGet']
configuration: ['Debug', 'Release']
platform: ['x86']
uses: ./.github/workflows/template-buildsample.yml
with:
sampleName: ${{ matrix.sampleName }}
configuration: ${{ matrix.configuration }}
platform: ${{ matrix.platform }}
skipBuild: ${{ needs.setupcheck.outputs.workflows != 'true' && needs.setupcheck.outputs.calculator-nuget != 'true' }} # Skip if files haven't changed

call-buildsample-native-module-sample:
name: Build Native Module Sample
needs: setupcheck
Expand Down Expand Up @@ -127,6 +107,6 @@ jobs:
prcheck:
name: Successful PR Check
runs-on: ubuntu-latest
needs: [setupcheck, call-buildsample-app-service-demo, call-buildsample-calculator, call-buildsample-calculator-nuget, call-buildsample-native-module-sample, call-buildwebsite]
needs: [setupcheck, call-buildsample-app-service-demo, call-buildsample-calculator, call-buildsample-native-module-sample, call-buildwebsite]
steps:
- uses: actions/checkout@v3
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ The content here features React Native sample apps, components, and templates fo
|:-------|:------------|
| [AppServiceDemo](./samples/AppServiceDemo) | A sample RNW app which interacts with the Win32 ecosystem using App Services. |
| [Calculator](./samples/Calculator) | A sample RNW app implementing a simple calculator with both C++ and C# implementations. |
| [CalculatorNuGet](./samples/CalculatorNuGet) | The Calculator sample, but consuming RNW through the NuGet packages. |
| [ContinuousIntegration](./samples/ContinuousIntegration) | Sample CI pipeline configurations for RNW projects. |
| [NativeModuleSample](./samples/NativeModuleSample) | A sample RNW native module with both C++ and C# implementations. |
| [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. |
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
# CalculatorNuGet - React Native for Windows

This sample showcases the usage of React Native for Windows to build a simple Calculator, using the Microsoft.ReactNative NuGet.

It currently targets React Native Windows 0.74.

### Setup
First, make sure you've met the [React Native Windows System Requirements](https://microsoft.github.io/react-native-windows/docs/rnw-dependencies).

Then, within this folder, install the applications's dependencies. If you have `yarn` installed:

```cmd
yarn install
```

Otherwise, you can just use npm:

```cmd
npm install
```

### Run
Once you have all of the dependencies installed, you can run the application with the following command:

```cmd
npx react-native run-windows
```

The command will:
* Build the application and all dependencies
* Deploy the application
* Launch the React Native Server and Debugger
* Launch the application

### Upgrade
To upgrade this sample to the latest version of RNW:

1. Open a command prompt and navigate to the `samples` folder:
```cmd
cd ..
```
2. Delete this folder:
```cmd
rd /s /q CalculatorNuGet
```
3. Create a new React Native app and change version to version you want to upgrade to:
```cmd
npx react-native init CalculatorNuGet --template "react-native@^0.72.0"
```
4. Add Windows support:
```cmd
cd CalculatorNuGet
npx react-native-windows-init --version latest --overwrite --experimentalNuGetDependency
```
5. Restore these original app files:
```
git restore README.md
git restore App.tsx
```
6. Verify the new app builds and runs:
```
npx react-native run-windows
```
7. Look at windows/Calculator/Package.appxmanifast and change the publisher name to "CN=React Native Windows Sample".
8. Update this readme with the new major version at the top.
# CalculatorNuGet - React Native for Windows

This sample showcases the usage of React Native for Windows to build a simple Calculator, using the Microsoft.ReactNative NuGet.

It currently targets React Native Windows 0.74.

### Setup
First, make sure you've met the [React Native Windows System Requirements](https://microsoft.github.io/react-native-windows/docs/rnw-dependencies).

Then, within this folder, install the applications's dependencies. If you have `yarn` installed:

```cmd
yarn install
```

Otherwise, you can just use npm:

```cmd
npm install
```

### Run
Once you have all of the dependencies installed, you can run the application with the following command:

```cmd
npx react-native run-windows
```

The command will:
* Build the application and all dependencies
* Deploy the application
* Launch the React Native Server and Debugger
* Launch the application

### Upgrade
To upgrade this sample to the latest version of RNW:

1. Open a command prompt and navigate to the `samples` folder:
```cmd
cd ..
```
2. Delete this folder:
```cmd
rd /s /q CalculatorNuGet
```
3. Create a new React Native app and change version to version you want to upgrade to:
```cmd
npx react-native init CalculatorNuGet --template "react-native@^0.72.0"
```
4. Add Windows support:
```cmd
cd CalculatorNuGet
npx react-native-windows-init --version latest --overwrite --experimentalNuGetDependency
```
5. Restore these original app files:
```
git restore README.md
git restore App.tsx
```
6. Verify the new app builds and runs:
```
npx react-native run-windows
```
7. Look at windows/Calculator/Package.appxmanifast and change the publisher name to "CN=React Native Windows Sample".
8. Update this readme with the new major version at the top.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 69ba966

Please sign in to comment.