Skip to content

Commit

Permalink
Publish website with v2 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulLeCam committed May 26, 2018
1 parent 6623090 commit a0c4a38
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## v2 (in progress)
## v2.0.0-beta.1 (2018-05-26)

* [BREAKING] Updated React dependency to v16.3.
* [BREAKING] Replaced React context usage with new APIs introduced in React v16.3.
Expand Down
2 changes: 1 addition & 1 deletion UPGRADING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Upgrading

## v2 (in progress)
## v2 (beta)

This release requires [React v16.3.0+](https://reactjs.org/blog/2018/03/29/react-v-16-3.html) and brings breaking changes in the way the necessary context is propagated. Most third-party plugins and custom components will likely need to be updated in order to access the context.

Expand Down
3 changes: 2 additions & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"write-translations": "docusaurus-write-translations",
"version": "docusaurus-version",
"rename-version": "docusaurus-rename-version",
"crowdin-upload": "crowdin --config ../crowdin.yaml upload sources --auto-update -b master",
"crowdin-upload":
"crowdin --config ../crowdin.yaml upload sources --auto-update -b master",
"crowdin-download": "crowdin --config ../crowdin.yaml download -b master"
},
"dependencies": {
Expand Down
8 changes: 7 additions & 1 deletion website/pages/en/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,13 @@ render(map, document.getElementById('map-container'))`}
The example code above is only meant to present the syntax change, it will
not work as-is.<br />
You can run an example code using React-Leaflet in{' '}
<a href="https://codepen.io/PaulLeCam/pen/XVPmmj">▶️ this CodePen</a>.
<a href="https://codepen.io/PaulLeCam/pen/XVPmmj">
▶️ this CodePen (v1 - stable)
</a>{' '}
or{' '}
<a href="https://codepen.io/PaulLeCam/pen/gzVmGw">
the v2 (beta) version
</a>.
</p>
<PromoSection>
<Button href={docUrl('intro.html', props.language)}>Get started</Button>
Expand Down
2 changes: 1 addition & 1 deletion website/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const siteConfig = {
useEnglishUrl: true,
headerLinks: [
{ doc: 'intro', label: 'Getting started' },
{ doc: 'prop-types', label: 'API' },
{ doc: 'components', label: 'API' },
{ page: 'help', label: 'Help' },
{ languages: true },
{ href: 'https://github.com/PaulLeCam/react-leaflet', label: 'GitHub' },
Expand Down
39 changes: 39 additions & 0 deletions website/versioned_docs/version-v2-beta/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
id: version-v2-beta-installation
title: Installation
original_id: installation
---

⚠️ If you have not read the [introduction](intro.md) and [Leaflet setup](setup.md) parts before accessing this page, please **read them first**. The Leaflet setup is **required** to make the following instructions work.

## Using npm or Yarn

```bash
npm install react-leaflet@next # npm
yarn add react-leaflet@next # Yarn
```

React, ReactDOM and Leaflet are peer dependencies, if you haven't already installed them you can use:

```bash
npm install leaflet react react-dom # npm
yarn add leaflet react react-dom # Yarn
```

You can then use the API as presented in the [example CodePen](https://codepen.io/PaulLeCam/pen/gzVmGw).

## UMD

UMD builds are available on [unpkg](https://unpkg.com/):

```html
<!-- unpkg, production (minified) -->
<script src="https://unpkg.com/react-leaflet@next/dist/react-leaflet.min.js"></script>
<!-- unpkg, development -->
<script src="https://unpkg.com/react-leaflet@next/dist/react-leaflet.js"></script>
```

The library is injected as `window.ReactLeaflet`.\
See the [UMD example](https://github.com/PaulLeCam/react-leaflet/blob/master/example/umd.html) to get started.

⚠️ When using Object destructuring with the UMD build, prefer aliasing the `Map` class to avoid shadowing the browser's `Map`, using `const { Map: LeafletMap } = window.ReactLeaflet` rather than `const { Map } = window.ReactLeaflet` for example.

0 comments on commit a0c4a38

Please sign in to comment.