Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amend docs - "add typescript" global warning #6911

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docusaurus/docs/adding-typescript.md
Expand Up @@ -16,6 +16,7 @@ npx create-react-app my-app --typescript

yarn create react-app my-app --typescript
```
> Note that having `create-react-app` installed globally can cause conflicts when using `--typescript`. If you've previously installed `create-react-app` globally via `npm install -g create-react-app`, we recommend you uninstall the package using `npm uninstall -g create-react-app` to ensure that `npx` always uses the latest version.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This first sentence is not accurate. Having Create React App installed globally doesn't create a "conflict" with the --typescript flag. It just means you're more likely to have an old version installed that doesn't have the --typescript flag. As the last sentence says, you should use npx instead of a global install to ensure you're using an up to date version of Create React App.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made this change but I'm still not sure how to correctly remove the commits from @nagman.


To add [TypeScript](https://www.typescriptlang.org/) to a Create React App project, first install it:

Expand Down
16 changes: 7 additions & 9 deletions docusaurus/docs/loading-graphql-files.md
Expand Up @@ -4,16 +4,16 @@ title: Loading .graphql Files
sidebar_label: Loading .graphql Files
---

To load `.gql` and `.graphql` files, first install the [`graphql.macro`](https://www.npmjs.com/package/graphql.macro) package by running:
To load `.gql` and `.graphql` files, first install the [`graphql`](https://www.npmjs.com/package/graphql) and [`graphql.macro`](https://www.npmjs.com/package/graphql.macro) packages by running:

```sh
npm install --save graphql.macro
npm install --save graphql graphql.macro
```

Alternatively you may use `yarn`:

```sh
yarn add graphql.macro
yarn add graphql graphql.macro
```

Then, whenever you want to load `.gql` or `.graphql` files, import the `loader` from the macro package:
Expand All @@ -27,13 +27,11 @@ const query = loader('./foo.graphql');
And your results get automatically inlined! This means that if the file above, `foo.graphql`, contains the following:

```graphql
gql`
query {
hello {
world
}
query {
hello {
world
}
`;
}
```

The previous example turns into:
Expand Down