## Description
This PR addresses Component Governance alerts for 6/19/24.
### Type of Change
- Bug fix (non-breaking change which fixes an issue)
### Why
Resolve Component Governance alerts.
### What
Updated versions of `braces` (via updating `globby`) and `ws` (via resolution). Had to use a resolution for `ws` because I wasn't able to bump `webdriverio` because it doesn't work with WinAppDriver, see https://github.com/microsoft/WinAppDriver/issues/1543.
## Screenshots
N/A
## Testing
Verified e2e-test-app still works
## Changelog
Should this change be included in the release notes: no
* Use prettier-plugin-hermes-parser to match upstream settings
In order to minimize the delta between platform override files in react-native-windows and upstream facebook/react-native files, switch to prettier-plugin-hermes-parser. The same change was made in dc2037c0f1
* Change files
* linting
* Change files
---------
Co-authored-by: Marlene Cota <mcota@microsoft.com>
Co-authored-by: Andrew <30809111+acoates-ms@users.noreply.github.com>
## Description
Our existing implementation for `accessibilityState` does not support that the values of a state can be `null`. This means *every* View has *every* unset state with the default `false` value.
The problem stems from implementing the short-lived `accessibilityStates` prop at the same time as `accessibilityState`, but not removing the deprecated API right away.
This PR fixes our implementation to only include the states when explicitly set, and to otherwise clear them. This PR also removed the no longer required "opposite" states like `Collapsed` and `Unchecked`.
Resolves#11791
### Type of Change
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
### Why
Properly implement accessibility in preparation for doing the work correctly for Fabric.
Resolves#11791
### What
Removed the old unused states and updated FrameworkElementViewManager to allow for unset values rather than forcing the default false. Updated AccessbilityStateChecked to accept an enum of Unchecked, Mixed, or Checked. Updated the DynamicAutomationPeer to only express a View has the appropriate provider iff the matching state is present on the view.
## Screenshots
N/A
## Testing
Updated E2E test snapshots to include the AccessibilityRole and AccessibilityState properties in the XAML tree dumps.
## Description
This PR runs a spellcheck pass on the repo, fixing typos and updating the ignore list.
### Type of Change
- Bug fix (non-breaking change which fixes an issue)
### Why
N/A
### What
What changes were made to the codebase to solve the bug, add the functionality, etc. that you specified above.
## Screenshots
N/A
## Testing
N/A
* updated lage version
* try set node version on macos
* Revert "try set node version on macos"
This reverts commit cf2f565715.
* bump lage
---------
Co-authored-by: Yajur Grover <yajurgrover@microsoft.com>
Co-authored-by: Jon Thysell (JAUNTY) <jthysell@microsoft.com>
Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com>
Co-authored-by: Andrew Coates <acoates@microsoft.com>
PR #9655 improved our setup phase by moving us toward dependency correctness, and as such it put some of our private packages as dependencies in the repo's root package.json, with fixed version numbers.
Unfortunately, these dependencies in the root package.json don't get bumped by beachball during publish (like they bump the dependencies in all the child package.json files. This breaks yarn install, (with an unhelpful error about missing the braces package).
This PR resolves the issue and future-proofs us by switching to the root package.json's dependencies to rely on *, not fixed versions.
This starts to clean up our repo when using a package manager (`midgard-yarn-strict` in this case) which forces dependency correctness. It gets us to the point where we are able to run the setup phase successfully.
There are a couple of quick tsconfig fixes as well that I ran across (namely around `esModuleInterop` duplication after we enabled it by default). Other discovered fixes were split into different PRs.
This also makes our Setup phase a little faster since we can do a scoped yarn install (mitigating extra cost of the isolated node_modules structure).
Co-authored-by: Jon Thysell (JAUNTY) <jthysell@microsoft.com>
* Use current version of Metro and Community CLI
This removes the resolution forcing an older version of Metro, now that the newest CLI version has been updated to fix compatibiliy with the current version of Metro.
* Change files
* so close...
* GitHub issue
* Remove resolution
* Integrate Feb 6 Nightly RN Build
Commits: 20b9ed91c...113f8257c3f49e6763e added support for `Animated.color` to Android, with a separate JS implementation. Filed an issue for followup
* Change files
* Remove static vlew configs
* Remove static view configs
* update lockfile
* CLI Metro Resolution
* CG: Upgrade to node-fetch@^2.6.7
This PR resolved CVE-2022-0235 by upgrading the version of node-fetch
used by all packages.
* Remove unneeded node-fetch resolution
* Change files
Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com>
* Remove unused bot work
This removes the previous start of RNW bot work, targetting Azure Functions as a client for GitHub webhooks. GitHub Actions workflows can be triggered in response to many GH webhooks, with orchestration taken care of.
* Change files
* # nice-fs
`nice-fs` is a minimal-dependency drop-in replacement to `fs` with changes for resiliency, promises, and convenience. It has several opinionated changes, targeted towards cross-platform CLI apps.
## Async Usage (Default)
`nice-fs` exposes a Promise-based API, mostly matching that of `fs.promises`, with several methods added [extra methods](#Extra-Methods).
```ts
// import {promises as fs} from 'fs'
import fs from 'nice-fs';
const fileContent = await fs.readFile('foo.txt');
```
## Sync Usage
`nice-fs` exports all `fs.*Sync` Where an async version has a graceful implementation, and the synchronous version does not, the method is marked as deprecated.
```ts
// import fs from 'fs'
import fs from 'nice-fs';
const fileContent = await fs.readFileSync('foo.txt');
```
## Extra Methods
### `exists`
NodeJS deprecated `fs.exists`, and removed `fs.promises.exists`. The recommendation is to instead acquire a lock to the file via `fs.open` for the duration of file-use. One-shot existence checks are still useful, and because `fs.existsSync` is not deprecated, more likely means usage of blocking synchronous APIs.
```ts
import fs from 'nice-fs';
const fooExists = await fs.exists('foo.txt');
```
### `readFile.asJson`
`nice-fs` provides convenience methods to handle JSON files. These are implemented as methods under `fs.ReadFile`. The following conversions are added:
| Method | Return type |
|-|-|
| `readFile.asJson<T>` | `Promise<T>` or `Promise<Record<string, unknown> \| Array<unknown>>` |
| `readFileSync.asJson<T>` | `T` or `Record<string, unknown> \| Array<unknown>` |
```ts
import fs from 'nice-fs';
// foo is type: Record<string, unknown>
const foo = await fs.readFile.asJsonObject('foo.json');
```
## Resiliency
`nice-fs` uses [`graceful-fs`](https://github.com/isaacs/node-graceful-fs) to gracefully handle transient filesystem conditions, at the cost of extra latency. This includes transient `EPERM`, `EACCESS`, `EMFILE`, `ENFILE`. This can be important when handling files that a subject to antivirus, which may temporarily lock mutation of files on Windows.
## eslint
We reccomend adding the following rules to your eslint config if you would like to use `nice-fs` everywhere:
```js
module.exports = {
rules: {
'no-restricted-imports': [
'error', {
name: 'fs',
message: 'Please us `nice-fs` instead of `fs`'
}
],
}
}
```
* yarn
* Remove 'readFileSync' from import list
* Update package directory in package.json
* Update packages/nice-fs/README.md
* Update packages/react-native-platform-override/src/PackageUtils.ts
* Rename to @react-native-windows/fs
* PR Feedback
* Refine JSON API
* Change files
* bad find/replace
* @react-native-windows/fs
* missing import
* Node 12 compat
* sort dependencies
* readme cleanup
* Ensure MSRN Debug Builds Use Debug WinMD
Validated script changes by running locally.
* Revert
MSBuild version stamping is triggered by hooking into beachball. Right now we hook into prepublish, then modify Git history. This change uses a newly introduced hook to instead stamp versions during the bump phase.
* Stamp RNW Version into MSBuild Props
This change allows community modules to query against the RNW version used at compile-time. This creates a foundation for conditional compilation against new features/APIs/quirks.
In order to calculate the new version number, existing DLL stamping code is run after the NPM package is published. Because we want to insert the version into the NPM package, we need to hook-in earlier. We use beachball prePublish hook as a mechanism to do this,. For clarity, we also commit the generated version to the repo, alongside the change to update package.json.
Using beachball hooks requires us moving our root beachball config from our packge.json to a JS file. We previously mutated beachball args in the package.json, so we need to rewrite some of the code which generates beachball config.
Props source of truth is a generated PropertySheet, exposed to internal and external projects. Preprocessor definitions mirroring the props are exposed by default to C++ apps/libs via external property sheets in the npm package.
Stamping is done via a JS script and mustache templates (ala generator). This should make it easy to stamp versions into more file formats in the future (E.g. for runtime queries in C++/C#).
* ordering
* Add macros
* Update beachball.config.js
* yarn format
* fiz
* Update vnext/template/cpp-lib/src/pch.h
* formatting and git
* fix comparison
* Use existing commit message for familiarity
* Update TypeScript in package.json
* parens and subsequent `yarn format`
* inverted quotes
Git based resolution is not liked by dependabot, as it seems to add/remove uid from lockfile. Indirect deoebdebct was fixed in plist in fa8e184631
Update plist used and remove the resolution.
* Integrate 8/25 Nightly RN Build (Base of 0.66)
This integrates us up to a day after the 0.66 cut, which should be close enough to let us integrate the RC when we branch to 0.66-stable.
Commits: cbec66ef9...ad9030ca9
- 27fec9569e changed the native component interface for TextInput on Android, but we do not implement the changed API to begin with
- f1b4748a7c changed the pattern used for generating component specs to search for specs also starting with lowercase "n". Made a corresponding change in `vnext\just-task.js`. This was sort of reverted in 6daf5bbec5 but we seem not run into the same special-casing that caused the revert.
- f6d0f9deac brings in one of our forked fixes for BorderExample, but we still have another change still out for PR
- 8434177722 adds selection prop for TextInput to Fabric, but we don't need to do anything with it yet. d756d4394d does something similar in adding AccessibilityValue to Fabric.
- a6768bfd70 removes some RTTI usage, but I don't think removes everything, so we cannot disable RTTI for our Fabric binary yet.
- 7a770526c6 removes DatePickerAndroid, which lets us remove some JS stubs, but we already removed the Windows variant.
- 2550948ec6 lets us remove a temp resolution for @react-native/polyfills. This change missed the iniital 0.66 cut, but was cherry-picked intothe 0.66 branch later.
* Change files
* Compile react_native_log In ReactCommon Static Lib
* Integrate 7/28 Nightly RN Build
Commits: ff9c8cdac...f592ad050cd78558552 adds UTs I had duplicated to our repo. We now use the version I upstreamed.
37dc1d44a5 changed some BatchedBridge APIs, but nothing that our custom Executors interacts with.
There are some more RNTester changes, but they are pure JS and do not seem to intersect with any special functionality in RNW. I did validate things look sane in both XAML and NetUI though.
There are some interesting changes around ES microTasks special-cased to Hermes. Forwarded that along to folks working on non-Hermes JS engines in RN.
* Change files
* Add resolution for @react-native/polyfills
This was added a while back after a patch release meant that built-in RN code was no longer clean. They've I think since fixed this, and linting now passes. Removing the resolution (and doing some lockfile deduplication).
* Remove or Migrate Usages of Picker
The [6/23 RN integration](https://github.com/microsoft/react-native-windows/pull/8357) removes Picker. We still have a few usages of it in custom RNTester examples or the like. This change removes all usages of it from our own code, either removing where inapplicable, or using the reccomended community module instead. This gives us a bit of real coverage of a module in our repo, but we only require it for the RNW RNTester fork instead of including it in RNW itself.
This exposed an issue where we broke usageof RNW with existing community modules (see https://github.com/microsoft/react-native-windows/issues/8430). We workaround this with patch-package for now, which also has us enabling yarn scripts again so we can hook postinstall.
Playground and playground-win32 are both updated to support autolinking, and it is tested that community module picker controls work correctly in them.
* yarn format
* Try adding WinUI 3 Support to @react-native-picker/picker
With the recent renaming of the main branch, we should also set the
default branch name in package.json so we don't need to run:
```
yarn change -b main
```
* Integrate April 22 RN Nightly Build
Fixes#7618
Commits: 4c5182c1c...5127c71d6
Mostly mechanical resolution apart from needing to fixup depedency resolution to use newer Metro.
Not yet locally tested to build or run.
* Update lockfile
* Change files
handlebars before v4.7.7 are vulnerable to Remote Code Execution (RCE) when selecting certain compiling options to compile templates coming from an untrusted source. This PR bumps the version of handlebars we use to 4.7.7 using yarn resolutions. We have to use yarn resolutions because the root dependency for handlebars, just-scripts, has not yet been updated to use handlebars v4.7.7.