Skip to content

Commit 25cc63f

Browse files
authored
Merge pull request #337 from Larocceau/restore-incorrect-changes-from-main
Fix incorrectly changed v4 recipes
2 parents f2a4f61 + cd862f5 commit 25cc63f

File tree

8 files changed

+39
-8
lines changed

8 files changed

+39
-8
lines changed

docs/v4-recipes/client-server/fable-remoting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#### 1. Install NuGet Packages
77
Add [Fable.Remoting.Giraffe](https://www.nuget.org/packages/Fable.Remoting.Giraffe/) to the Server and [Fable.Remoting.Client](https://www.nuget.org/packages/Fable.Remoting.Client/) to the Client.
88

9-
> See [How Do I Add a NuGet Package to the Server](../../v4-recipes/package-management/add-nuget-package-to-server.md)
10-
> and [How Do I Add a NuGet Package to the Client](../../recipes/package-management/add-nuget-package-to-client.md).
9+
> See [How Do I Add a NuGet Package to the Server](../package-management/add-nuget-package-to-server.md)
10+
> and [How Do I Add a NuGet Package to the Client](../package-management/add-nuget-package-to-client.md).
1111
1212
#### 2. Create the API protocol
1313
You now need to create the protocol, or contract, of the API we’ll be creating. Insert the following below the `Route` module in `Shared.fs`:

docs/v4-recipes/javascript/third-party-react-package.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
To use a third-party React library in a SAFE application, you need to write an F# wrapper around it. There are two ways for doing this - using [Fable.React](https://www.nuget.org/packages/Fable.React/) or using [Feliz](https://zaid-ajaj.github.io/Feliz/).
22
## Prerequisites
33

4-
This recipe uses the [react-d3-speedometer NPM package](https://www.npmjs.com/package/react-d3-speedometer) for demonstration purposes. [Add it to your Client](../../recipes/package-management/add-npm-package-to-client.md) before continuing.
4+
This recipe uses the [react-d3-speedometer NPM package](https://www.npmjs.com/package/react-d3-speedometer) for demonstration purposes. [Add it to your Client](../package-management/add-npm-package-to-client.md) before continuing.
55

66
## Fable.React - Setup
77

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# How do I add an NPM package to the Client?
2+
3+
When you want to call a JavaScript library from your Client, it is easy to import and reference it using [NPM](https://docs.npmjs.com/cli/npm).
4+
5+
Run the following command:
6+
```bash
7+
npm install name-of-package
8+
```
9+
10+
This will download the package into the solution's **node_modules** folder.
11+
12+
You will also see a reference to the package in the Client's **package.json** file:
13+
```json
14+
"dependencies": {
15+
"name-of-package": "^1.0.0"
16+
}
17+
```
18+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# How do I add a NuGet package to the Client?
2+
Adding packages to the Client project is a very [similar process to the Server](add-nuget-package-to-server.md), with a few key differences:
3+
4+
- Any references to the `Server` directory should be `Client`
5+
6+
- Client code written in F# is converted into JavaScript using [Fable](https://fable.io/docs/index.html). Because of this, we must be careful to only reference libraries which are [Fable compatible](https://fable.io/docs/your-fable-project/use-a-fable-library.html).
7+
8+
- If the NuGet package uses any JS libraries you must install them.
9+
For simplicity, [use Femto to sync](./sync-nuget-and-npm-packages.md) - if the NuGet package is compatible - or [install via NPM](./add-npm-package-to-client.md) manually, if not.
10+
11+
There are [lots of great libraries](../../awesome-safe-components.md) available to choose from.

docs/v4-recipes/ui/add-bulma.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
By adding either of these to your SAFE project alongside the [Bulma stylesheet or the Bulma NPM package](https://bulma.io/documentation/overview/start/), you can take full advantage of Bulma.
99

1010
### Using Feliz.Bulma
11-
1. [Add the Feliz.Bulma NuGet package to the solution](../../recipes/package-management/add-nuget-package-to-client.md).
11+
1. [Add the Feliz.Bulma NuGet package to the solution](../package-management/add-nuget-package-to-client.md).
1212
1. Start using Feliz.Bulma components in your F# files.
1313
```fsharp
1414
open Feliz.Bulma
@@ -19,12 +19,12 @@ Bulma.button.button [
1919
```
2020

2121
### Using Fulma
22-
1. [Add the Fulma NuGet package to the solution](../../recipes/package-management/add-nuget-package-to-client.md).
22+
1. [Add the Fulma NuGet package to the solution](../package-management/add-nuget-package-to-client.md).
2323
1. Start using Fulma components in your F# files.
2424
```fsharp
2525
open Fulma
2626
2727
Button.button [] [
2828
str "Click me!"
2929
]
30-
```
30+
```

docs/v4-recipes/ui/add-fontawesome.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ If you’re using the minimal template, there are a couple of things to do befor
1313

1414
#### 1. The NuGet Package
1515
Add [Fable.FontAwesome.Free NuGet Package](https://www.nuget.org/packages/Fable.FontAwesome.Free/) to the Client project.
16-
> See [How do I add a NuGet package to the Client?](../../recipes/package-management/add-nuget-package-to-client.md).
16+
> See [How do I add a NuGet package to the Client?](../package-management/add-nuget-package-to-client.md).
1717
1818
#### 2. The CDN Link
1919
Open the `index.html` file and add the following line to the `head` element:

docs/v4-recipes/ui/cdn-to-npm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Find the following line in `src/Client/index.html` and delete it before moving o
1111

1212
#### 2. Add the NPM Package
1313
Go ahead and add the [Bulma NPM package](https://www.npmjs.com/package/bulma) to your project.
14-
> See: [How do I add an NPM package to the client?](../../recipes/package-management/add-npm-package-to-client.md)
14+
> See: [How do I add an NPM package to the client?](../package-management/add-npm-package-to-client.md)
1515
1616
#### 3. Load the Stylesheets
1717
There are two ways for loading the stylesheets:

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ nav:
163163
- Import a JavaScript module: "v4-recipes/javascript/import-js-module.md"
164164
- Add Support for a Third Party React Library: "v4-recipes/javascript/third-party-react-package.md"
165165
- Package Management:
166+
- Add an NPM package to the Client: "v4-recipes/package-management/add-npm-package-to-client.md"
166167
- Add a NuGet package to the Server: "v4-recipes/package-management/add-nuget-package-to-server.md"
168+
- Add a NuGet package to the Client: "v4-recipes/package-management/add-nuget-package-to-client.md"
167169
- Migrate to Paket from NuGet: "v4-recipes/package-management/migrate-to-paket.md"
168170
- Migrate to NuGet from Paket: "v4-recipes/package-management/migrate-to-nuget.md"
169171
- Sync NuGet and NPM Packages: "v4-recipes/package-management/sync-nuget-and-npm-packages.md"

0 commit comments

Comments
 (0)