Skip to content

Commit

Permalink
Merge pull request #494 from aoberoi/migration-guide-docs
Browse files Browse the repository at this point in the history
adds link to migration guide onto landing pages
  • Loading branch information
aoberoi authored Mar 13, 2018
2 parents 474878a + b34c18e commit c49ba78
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ So you want to build a Slack app with Node.js? We've got you covered. This packa
building Slack apps ridiculously easy. It helps you build on all aspects of the Slack platform, from dropping
notifications in channels to fully interactive bots.

**Upgrading from version 3?** The
[migration guide](https://github.com/slackapi/node-slack-sdk/wiki/Migration-Guide-for-v4) has all the information you
need to bring your app up to speed.

## Requirements

This package supports Node v6 and higher. It's highly recommended to use
Expand Down
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ through building your first Slack app using Node.js.
that explains and compares the options. If you're still not sure,
[reach out for help](#getting-help) and our community can guide you.

**Upgrading from version 3?** The
[migration guide](https://github.com/slackapi/node-slack-sdk/wiki/Migration-Guide-for-v4) has all the information you
need to bring your app up to speed

---

You'll notice that some of the API tools are not included in the `@slack/client` package.
Expand Down
33 changes: 33 additions & 0 deletions migration_guide_v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,39 @@ between events in the `v3.x` series and events in the `v4.x` series.
- `unfurlLinks` => `unfurl_links`
- `unfurlMedia` => `unfurl_media`

## CLIENT_EVENTS, RTM_EVENTS, RTM_MESSAGE_SUBTYPES

These constants have been removed. We recommend using simple strings for event names. The values that were in
`CLIENT_EVENTS` have been migrated according to the [events table above](#events). The `RTM_EVENTS` dictionary isn't
necessary, just directly subscribe to the event name as a string.

**Before:**
```javascript
rtm.on(CLIENT_EVENTS.RTM.AUTHENTICATED, (connectionData) => {
console.log('RTMClient authenticated');
});

rtm.on(RTM_EVENTS.MESSAGE, (event) => {
console.log(`Incoming message: ${event.ts}`);
})
```

**After:**
```javascript
rtm.on('authenticated', (connectionData) => {
console.log('RTMClient authenticated');
});

rtm.on('message', (event) => {
console.log(`Incoming message: ${event.ts}`);
})
```

## RETRY_POLICIES

The names of these policies have slightly changed for more consistency with our style guide. The dictionary of policies
is now exported under the name `retryPolicies`. See `src/retry-policies.ts` for details.

## Proxy Support with `agent`

In order to pass outgoing requests from `WebClient` or `RTMClient` through an HTTP proxy, you'll first need to install
Expand Down

0 comments on commit c49ba78

Please sign in to comment.