Skip to content

Commit

Permalink
Fix: spelling of "TypeScript"
Browse files Browse the repository at this point in the history
  • Loading branch information
Marius Schulz committed Dec 6, 2023
1 parent ab9028d commit 6dcddf6
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion apps/docs/blog/2023-12-05-introducing-stylex.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ always merge with predictable results.

### Type-Safe

You can constrain the styles a component accepts by using Typescript or Flow
You can constrain the styles a component accepts by using TypeScript or Flow
types. Every style property and variable is fully typed.

### Colocation
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/docs/api/types/StaticStyles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ Any key not defined in the object type will be disallowed.

:::danger Only known keys are checked

Due to a Typescript limitation, any key not in your custom object type
Due to a TypeScript limitation, any key not in your custom object type
will only be disallowed if it's one of the known style properties
in the internal StyleX types.

Typescript will not error if you pass an additional unknown key.
TypeScript will not error if you pass an additional unknown key.

:::
6 changes: 3 additions & 3 deletions apps/docs/docs/api/types/StyleXStyles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ Any key not defined in the object type will be disallowed.

:::danger Only known keys are checked

Due to a Typescript limitation, any key not in your custom object type
Due to a TypeScript limitation, any key not in your custom object type
will only be disallowed if it's one of the known style properties
in the internal StyleX types.

Typescript will not error if you pass an additional unknown key.
TypeScript will not error if you pass an additional unknown key.

:::
:::
6 changes: 3 additions & 3 deletions apps/docs/docs/learn/02-thinking-in-stylex.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ There should be no surprises.

### Type-Safe styles

Typescript has become massively popular due to the experience and safety it
TypeScript has become massively popular due to the experience and safety it
provides. Our styles, however, have largely remained untyped and unreliable.
Other than some path-breaking projects such as
[Vanilla Extract](https://vanilla-extract.style/), styles are just bags of
Expand All @@ -199,7 +199,7 @@ strings in most styling solutions.
StyleX is authored in Flow with strong static types. Its packages on NPM come
with auto-generated types for both Flow and TypeScript. When there are
incompatibilities between the two type-systems, we take the time to ensure that we
write custom Typescript types to achieve at least the same level of power and safety
write custom TypeScript types to achieve at least the same level of power and safety
as the original Flow.

_All styles are typed_. When accepting styles as props, types can be used to
Expand Down Expand Up @@ -254,7 +254,7 @@ a component's styles can be customized with **zero-runtime cost**.
### Shareable constants

CSS class names, CSS variables, and other CSS identifiers are defined in a global
namespace. Bringing CSS strings into JavaScript can mean losing type-safety and
namespace. Bringing CSS strings into JavaScript can mean losing type-safety and
composability.

We want styles to be type-safe, so we've spent a lot of time coming up with
Expand Down
12 changes: 6 additions & 6 deletions apps/docs/docs/learn/06-static-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ StyleX comes with full support for Static Types. The most common utility type is
`StyleXStyles` which is used to accept any arbitrary StyleX styles.

<Tabs>
<TabItem value="typescript" label="Typescript" default>
<TabItem value="typescript" label="TypeScript" default>

```tsx
import type {StyleXStyles} from '@stylexjs/stylex';
Expand Down Expand Up @@ -83,7 +83,7 @@ To limit the accepted style properties to a given set, an object type with the
allowed properties can be used:

<Tabs>
<TabItem value="typescript" label="Typescript" default>
<TabItem value="typescript" label="TypeScript" default>

```tsx
import type {StyleXStyles} from '@stylexjs/stylex';
Expand Down Expand Up @@ -135,9 +135,9 @@ baseline styles in the component itself.

:::

:::danger Typescript may not catch extra style properties
:::danger TypeScript may not catch extra style properties

Typescript object types don’t error when given objects with extra properties.
TypeScript object types don’t error when given objects with extra properties.
We’ve taken steps to mitigate this issue, but there may be edge-cases where
you’ll be able to pass in extra, disallowed styles without a type error.

Expand All @@ -149,7 +149,7 @@ In addition to the accepted style properties, the values for those properties
can be constrained too.

<Tabs>
<TabItem value="typescript" label="Typescript" default>
<TabItem value="typescript" label="TypeScript" default>

```tsx
import type {StyleXStyles} from '@stylexjs/stylex';
Expand Down Expand Up @@ -192,7 +192,7 @@ other properties. The value for `marginTop` can only be one of `0`, `4`, `8`, or
It is sometimes more convenient to define a blocklist instead of an allowlist.

<Tabs>
<TabItem value="typescript" label="Typescript" default>
<TabItem value="typescript" label="TypeScript" default>

```tsx
import type {StyleXStylesWithout} from '@stylexjs/stylex';
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs-example/typetests/typetests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ const styles6: Readonly<{
'@media (max-width: 1000px)': mobile,
},
},
}) as const, // Typescript limitation
}) as const, // TypeScript limitation
});
// @ts-expect-error - Functions don't return static styles.
styles6.foo(100) satisfies StaticStyles;
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ by passing them to the functions of the corresponding names within `@stylex/shar

## Babel Metadata

The StyleX Babel plugin does more than transform JavaScript (or Typescript) files. It also returns a list of injected styles. The way that such a value can be returned while transforming a JS file is by using Babel's `metadata` API.
The StyleX Babel plugin does more than transform JavaScript (or TypeScript) files. It also returns a list of injected styles. The way that such a value can be returned while transforming a JS file is by using Babel's `metadata` API.

An example of this can be seen in some of the tests, but the result of using Babel's `transform(...)` function returns an object contains at least two keys:

Expand Down
4 changes: 2 additions & 2 deletions packages/nextjs-plugin/src/custom-webpack-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class StylexPlugin {
if (
// JavaScript (and Flow) modules
/\.jsx?/.test(path.extname(module.resource)) ||
// Typescript modules
// TypeScript modules
/\.tsx?/.test(path.extname(module.resource))
) {
// We use .push() here instead of .unshift()
Expand Down Expand Up @@ -194,7 +194,7 @@ class StylexPlugin {
{
babelrc: this.babelConfig.babelrc,
filename,
// Use Typescript syntax plugin if the filename ends with `.ts` or `.tsx`
// Use TypeScript syntax plugin if the filename ends with `.ts` or `.tsx`
// and use the Flow syntax plugin otherwise.
plugins: [
...this.babelConfig.plugins,
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/gen-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async function generateTypes(inputDir, outputDir, rootDir) {

await fsPromises.writeFile(
outputFullPath.replace(/\.js$/, '.d.ts'),
// Typescript Prefers `NodePath` unlike `NodePath<>` in Flow
// TypeScript Prefers `NodePath` unlike `NodePath<>` in Flow
// `flow-api-translator` doesn't handle this case yet.
postProcessTSOutput(outputTSContents),
);
Expand Down
2 changes: 1 addition & 1 deletion packages/stylex/src/StyleXCSSTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ export type CSSProperties = $ReadOnly<{
// NOTE: adding a non-CSS property here for support themes in Stylex.
theme?: all | string,

// ...$Exact<SupportedVendorSpecificCSSProperties>, for Typescript compatibility
// ...$Exact<SupportedVendorSpecificCSSProperties>, for TypeScript compatibility
MozOsxFontSmoothing?: all | 'grayscale',
WebkitAppearance?: all | appearance,
WebkitFontSmoothing?: all | 'antialiased',
Expand Down
4 changes: 2 additions & 2 deletions packages/webpack-plugin/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class StylexPlugin {
if (
// JavaScript (and Flow) modules
/\.jsx?/.test(path.extname(module.resource)) ||
// Typescript modules
// TypeScript modules
/\.tsx?/.test(path.extname(module.resource))
) {
// It might make sense to use .push() here instead of .unshift()
Expand Down Expand Up @@ -165,7 +165,7 @@ class StylexPlugin {
{
babelrc: this.babelConfig.babelrc,
filename,
// Use Typescript syntax plugin if the filename ends with `.ts` or `.tsx`
// Use TypeScript syntax plugin if the filename ends with `.ts` or `.tsx`
// and use the Flow syntax plugin otherwise.
plugins: [
...this.babelConfig.plugins,
Expand Down

0 comments on commit 6dcddf6

Please sign in to comment.