Skip to content

Commit

Permalink
chore(sample): describe jspm forks, closes #172
Browse files Browse the repository at this point in the history
  • Loading branch information
Thanood committed May 2, 2016
1 parent a341737 commit 0d97831
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion sample/src/help/docs/app-developers-tutorials/next-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,42 @@
### 7. What you need to know
<br>

__To be written__ ...
#### JSPM "forks"
<br>

JSPM allows for multiple versions of installed dependencies. When two dependencies
import two different versions of the same library, JSPM may detect a conflict
which it calls a "fork". In this case it issues a warning like this:

```
Installed Forks
github:systemjs/plugin-css 0.1.20 0.1.21
```

This example is taken from aurelia-skeleton-navigation 1.0.0-beta.1.2.2 (after installing the bridge)
which has a dependency on `font-awesome@^4.5.0` - itself depending on `[email protected]`.
Notice lack of the `^` indicator, meaning that JSPM will install **exactly this version**.

When installing the bridge you install an indirect dependency of `[email protected]`
which `Dogfalo/materialize` depends on.

As the version numbers in both cases are static (no `^` indicator), both versions
of `plugin-css` are installed, leading to a fork.

There are two options to resolve this:
* install with the `--lock` option
* use `jspm resolve`

##### Installing the bridge using `--lock`

The `--lock` option keeps existing dependencies locked during a JSPM installation.
So if you know the installation will introduce a fork and you want to keep
the installed version of a library, use `jspm install --lock aurelia-materialize-bridge`.

##### Using `jspm resolve`

JSPM has a builtin command to change every used version of a dependency to the
version you want.
In the case above you'd issue `jspm resolve --only github:systemjs/[email protected]`.
Please note that you *have to* give JSPM an exact package of the form `registry:pkg@version`.

0 comments on commit 0d97831

Please sign in to comment.