Skip to content

Commit

Permalink
Update samples to remove deprecated /master/ CDN (#2105)
Browse files Browse the repository at this point in the history
* Update samples to remove deprecated /master/ CDN

* Update CHANGELOG.md

* Fix breaking tests due to test harness change
  • Loading branch information
corinagum committed Jun 23, 2019
1 parent 4d79436 commit 55057db
Show file tree
Hide file tree
Showing 62 changed files with 148 additions and 179 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -61,6 +61,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix [#1926](https://github.com/microsoft/BotFramework-WebChat/issues/1926). Fixed scroll stickiness issue when submitting an Adaptive Card form with suggested actions opened, by [@compulim](https://github.com/compulim) in PR [#2107](https://github.com/microsoft/BotFramework-WebChat/pull/2107)
- Fix [#2106](https://github.com/Microsoft/BotFramework-WebChat/issues/2016). Fix AdaptiveCardHostConfig warning associated with the CommonCard component, by [@tdurnford](https://github.com/tdurnford) in PR [#2108](https://github.com/Microsoft/BotFramework-WebChat/pull/2108)
- Fix [#2110](https://github.com/Microsoft/BotFramework-WebChat/issues/2110). Fixed sendBox input/textarea background color issue, by [@tdurnford](https://github.com/johndoe) in PR [#2111](https://github.com/Microsoft/BotFramework-WebChat/pull/2111)
- Fix [#2104](https://github.com/Microsoft/BotFramework-WebChat/issues/2104). Remove deprecated `/master/webchat**.js links from samples, by [@corinagum](https://github.com/corinagum) in PR [#2105](https://github.com/Microsoft/BotFramework-WebChat/pull/2105)

### Samples

Expand Down
6 changes: 2 additions & 4 deletions __tests__/setup/web/index.html
Expand Up @@ -35,9 +35,7 @@
}();
</script>
<!--
For demonstration purposes, we are using development branch of Web Chat at "/master/webchat.js".
When you are using Web Chat for production, you should use the latest stable at "/latest/webchat.js".
Or locked down on a specific version "/4.1.0/webchat.js".
For demonstration purposes, we are using the latest official release of Web Chat at "/latest/webchat.js". When you are using Web Chat for production, you may lock down on a specific version with the following format: "/4.1.0/webchat.js".
-->
<style>
html, body { height: 100% }
Expand Down Expand Up @@ -145,4 +143,4 @@
};
</script>
</body>
</html>
</html>
7 changes: 3 additions & 4 deletions samples/01.a.getting-started-full-bundle/README.md
Expand Up @@ -42,13 +42,12 @@ We'll start by adding the CDN to the head of a blank `index.html` template.
```diff
<head>
+ <script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
+ <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
</head>
```

> For demonstration purposes, we are using the development branch of Web Chat at "/master/webchat.js". When you are using Web Chat for production, you should use the latest stable release at "/latest/webchat.js", or lock down on a specific version with the following format: "/4.1.0/webchat.js".
> This CDN points to the latest official release of Web Chat. If you need to test against Web Chat's latest bits, please refer to pointing to Web Chat's MyGet feed. https://github.com/microsoft/BotFramework-WebChat#how-to-test-with-web-chats-latest-bits
Next, the code to render Web Chat must be added to the body. Note that MockBot uses **tokens** rather than the **Direct Line secret**.

> It is **never recommended** to put the Direct Line secret in the browser or client app. To learn more about secrets and tokens for Direct Line, visit [this tutorial on authentication](https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-direct-line-3-0-authentication).
Expand Down Expand Up @@ -109,7 +108,7 @@ Here is the finished `index.html`:
<html lang="en-US">
<head>
<title>Web Chat: Full-featured bundle</title>
+ <script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
+ <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<style>
+ html, body { height: 100% }
+ body { margin: 0 }
Expand Down
7 changes: 3 additions & 4 deletions samples/01.a.getting-started-full-bundle/index.html
Expand Up @@ -4,11 +4,10 @@
<title>Web Chat: Full-featured bundle</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--
For demonstration purposes, we are using the development branch of Web Chat at "/master/webchat.js".
When you are using Web Chat for production, you should use the latest stable release at "/latest/webchat.js",
or lock down on a specific version with the following format: "/4.1.0/webchat.js".
This CDN points to the latest official release of Web Chat. If you need to test against Web Chat's latest bits, please refer to pointing to Web Chat's MyGet feed:
https://github.com/microsoft/BotFramework-WebChat#how-to-test-with-web-chats-latest-bits
-->
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<style>
html, body { height: 100% }
body { margin: 0 }
Expand Down
8 changes: 4 additions & 4 deletions samples/01.b.getting-started-es5-bundle/README.md
Expand Up @@ -59,8 +59,8 @@ Simply modify the CDN from the full-bundle Web Chat to full es5-polyfill Web Cha
```diff
<head>
+ <script src="https://cdn.botframework.com/botframework-webchat/master/webchat-es5.js"></script>
- <script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
+ <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat-es5.js"></script>
- <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
</head>
```
Expand All @@ -75,8 +75,8 @@ Here is the finished `index.html`:
<head>
<title>Web Chat: Full-featured bundle with ES5 polyfills</title>

+ <script src="https://cdn.botframework.com/botframework-webchat/master/webchat-es5.js"></script>
- <script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
+ <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat-es5.js"></script>
- <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<style>
html, body { height: 100% }
body { margin: 0 }
Expand Down
7 changes: 3 additions & 4 deletions samples/01.b.getting-started-es5-bundle/index.html
Expand Up @@ -4,11 +4,10 @@
<title>Web Chat: Full-featured bundle with ES5 polyfills</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--
For demonstration purposes, we are using the development branch of Web Chat at "/master/webchat.js".
When you are using Web Chat for production, you should use the latest stable release at "/latest/webchat.js",
or lock down on a specific version with the following format: "/4.1.0/webchat.js".
This CDN points to the latest official release of Web Chat. If you need to test against Web Chat's latest bits, please refer to pointing to Web Chat's MyGet feed:
https://github.com/microsoft/BotFramework-WebChat#how-to-test-with-web-chats-latest-bits
-->
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat-es5.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat-es5.js"></script>
<style>
html, body { height: 100% }
body { margin: 0 }
Expand Down
8 changes: 4 additions & 4 deletions samples/01.c.getting-started-migration/README.md
Expand Up @@ -64,15 +64,15 @@ We'll start by using our old v3 `index.html` as our starting point.
</html>
```

> For demonstration purposes, we are using the development branch of Web Chat at "/master/webchat.js". When you are using Web Chat for production, you should use the latest stable release at "/latest/webchat.js", or lock down on a specific version with the following format: "/4.1.0/webchat.js".
> This CDN points to the latest official release of Web Chat. If you need to test against Web Chat's latest bits, please refer to pointing to Web Chat's MyGet feed. https://github.com/microsoft/BotFramework-WebChat#how-to-test-with-web-chats-latest-bits
Our first change is to update the CDN the webpage uses from v3 to v4.

```diff
<head>
- <link href="https://cdn.botframework.com/botframework-webchat/0.13.1/botchat.css" rel="stylesheet" />
+ <script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
+ <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
</head>
<body>
- <div id="bot" />
Expand Down Expand Up @@ -129,7 +129,7 @@ Finally, we will add basic styling since there is no longer a stylesheet include
```diff
<head>
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
+ <style>
+ html, body { height: 100% }
+ body { margin: 0 }
Expand All @@ -152,7 +152,7 @@ Here is the finished `index.html`:
<html lang="en-US">
<head>
<title>Web Chat: Full-featured bundle</title>
+ <script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
+ <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
+ <style>
+ html, body { height: 100% }
+ body { margin: 0 }
Expand Down
7 changes: 3 additions & 4 deletions samples/01.c.getting-started-migration/index.html
Expand Up @@ -4,11 +4,10 @@
<title>Web Chat: Full-featured bundle</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--
For demonstration purposes, we are using the development branch of Web Chat at "/master/webchat.js".
When you are using Web Chat for production, you should use the latest stable release at "/latest/webchat.js",
or lock down on a specific version with the following format: "/4.1.0/webchat.js".
This CDN points to the latest official release of Web Chat. If you need to test against Web Chat's latest bits, please refer to pointing to Web Chat's MyGet feed:
https://github.com/microsoft/BotFramework-WebChat#how-to-test-with-web-chats-latest-bits
-->
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<style>
html, body { height: 100% }
body { margin: 0 }
Expand Down
10 changes: 5 additions & 5 deletions samples/02.a.getting-started-minimal-bundle/README.md
Expand Up @@ -47,13 +47,13 @@ The only change needed in this sample is to change the Web Chat CDN from the ful
```diff
<head>
- <script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
+ <script src="https://cdn.botframework.com/botframework-webchat/master/webchat-minimal.js"></script>
- <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
+ <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat-minimal.js"></script>
</head>
```

> For demonstration purposes, we are using the development branch of Web Chat at "/master/webchat-minimal.js". When you are using Web Chat for production, you should use the latest stable release at "/latest/webchat-minimal.js", or lock down on a specific version with the following format: "/4.1.0/webchat-minimal.js".
> For demonstration purposes, we are using the latest official release of Web Chat at "/latest/webchat-minimal.js". When you are using Web Chat for production, you may lock down on a specific version with the following format: "/4.1.0/webchat-minimal.js".
## Completed code

Expand All @@ -64,8 +64,8 @@ Here is the finished `index.html`:
<html lang="en-US">
<head>
<title>Web Chat: Minimal bundle</title>
- <script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
+ <script src="https://cdn.botframework.com/botframework-webchat/master/webchat-minimal.js"></script>
- <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
+ <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat-minimal.js"></script>
<style>
html, body { height: 100% }
body { margin: 0 }
Expand Down
7 changes: 3 additions & 4 deletions samples/02.a.getting-started-minimal-bundle/index.html
Expand Up @@ -14,11 +14,10 @@
- Direct Line JS
-->
<!--
For demonstration purposes, we are using the development branch of Web Chat at "/master/webchat.js".
When you are using Web Chat for production, you should use the latest stable release at "/latest/webchat.js",
or lock down on a specific version with the following format: "/4.1.0/webchat.js".
This CDN points to the latest official release of Web Chat. If you need to test against Web Chat's latest bits, please refer to pointing to Web Chat's MyGet feed:
https://github.com/microsoft/BotFramework-WebChat#how-to-test-with-web-chats-latest-bits
-->
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat-minimal.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat-minimal.js"></script>
<style>
html, body { height: 100% }
body { margin: 0 }
Expand Down
6 changes: 3 additions & 3 deletions samples/02.b.getting-started-minimal-markdown/README.md
Expand Up @@ -46,13 +46,13 @@ First, add the Markdown-It dependency to our `head`.
```diff
<head>
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat-minimal.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat-minimal.js"></script>
+ <script src="https://unpkg.com/markdown-it@8.4.2/dist/markdown-it.min.js"></script>
</head>
```

> For demonstration purposes, we are using the development branch of Web Chat at "/master/webchat-minimal.js". When you are using Web Chat for production, you should use the latest stable release at "/latest/webchat-minimal.js", or lock down on a specific version with the following format: "/4.1.0/webchat-minimal.js".
> For demonstration purposes, we are using the latest official release of Web Chat at "/latest/webchat-minimal.js". When you are using Web Chat for production, you may lock down on a specific version with the following format: "/4.1.0/webchat-minimal.js".
Next, add and bind the markdown-it object to `renderMarkdown`:

Expand All @@ -72,7 +72,7 @@ Here is the finished `index.html`:
<html lang="en-US">
<head>
<title>Web Chat: Minimal bundle with Markdown</title>
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat-minimal.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat-minimal.js"></script>
+ <script src="https://unpkg.com/markdown-it@8.4.2/dist/markdown-it.min.js"></script>
<style>
html, body { height: 100% }
Expand Down
7 changes: 3 additions & 4 deletions samples/02.b.getting-started-minimal-markdown/index.html
Expand Up @@ -13,11 +13,10 @@
And then, we bring Markdown-It back to the project.
-->
<!--
For demonstration purposes, we are using the development branch of Web Chat at "/master/webchat.js".
When you are using Web Chat for production, you should use the latest stable release at "/latest/webchat.js",
or lock down on a specific version with the following format: "/4.1.0/webchat.js".
This CDN points to the latest official release of Web Chat. If you need to test against Web Chat's latest bits, please refer to pointing to Web Chat's MyGet feed:
https://github.com/microsoft/BotFramework-WebChat#how-to-test-with-web-chats-latest-bits
-->
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat-minimal.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat-minimal.js"></script>
<script src="https://unpkg.com/markdown-it@8.4.2/dist/markdown-it.min.js"></script>
<style>
html, body { height: 100% }
Expand Down
6 changes: 3 additions & 3 deletions samples/03.a.host-with-react/README.md
Expand Up @@ -43,12 +43,12 @@ We'll start by adding React and Babel to the head or our template, based off of
+ <script src="https://unpkg.com/react@16.5.0/umd/react.development.js"></script>
+ <script src="https://unpkg.com/react-dom@16.5.0/umd/react-dom.development.js"></script>
+ <script src="https://unpkg.com/react-redux@5.0.7/dist/react-redux.min.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
</head>
```

> For demonstration purposes, we are using the development branch of Web Chat at "/master/webchat.js". When you are using Web Chat for production, you should use the latest stable release at "/latest/webchat.js", or lock down on a specific version with the following format: "/4.1.0/webchat.js".
> For demonstration purposes, we are using the latest official release of Web Chat at "/latest/webchat.js". When you are using Web Chat for production, you may lock down on a specific version with the following format: "/4.1.0/webchat.js".
The core of this code both creates and renders the React component that displays Web Chat.

Expand Down Expand Up @@ -84,7 +84,7 @@ Here is the finished `index.html`:
+ <script src="https://unpkg.com/react@16.5.0/umd/react.development.js"></script>
+ <script src="https://unpkg.com/react-dom@16.5.0/umd/react-dom.development.js"></script>
+ <script src="https://unpkg.com/react-redux@5.0.7/dist/react-redux.min.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<style>
html, body { height: 100% }
body { margin: 0 }
Expand Down
7 changes: 3 additions & 4 deletions samples/03.a.host-with-react/index.html
Expand Up @@ -10,11 +10,10 @@
<script src="https://unpkg.com/react@16.5.0/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16.5.0/umd/react-dom.development.js"></script>
<!--
For demonstration purposes, we are using the development branch of Web Chat at "/master/webchat.js".
When you are using Web Chat for production, you should use the latest stable release at "/latest/webchat.js",
or lock down on a specific version with the following format: "/4.1.0/webchat.js".
This CDN points to the latest official release of Web Chat. If you need to test against Web Chat's latest bits, please refer to pointing to Web Chat's MyGet feed:
https://github.com/microsoft/BotFramework-WebChat#how-to-test-with-web-chats-latest-bits
-->
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<style>
html, body { height: 100% }
body { margin: 0 }
Expand Down
6 changes: 4 additions & 2 deletions samples/03.b.host-with-angular/README.md
Expand Up @@ -33,12 +33,14 @@ We'll start by adding the CDN to the head of our Angular application's `index.ht
```diff
<head>
+ <script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
+ <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
</head>
```

> For demonstration purposes, we are using the development branch of Web Chat at "/master/webchat.js". When you are using Web Chat for production, you should use the latest stable release at "/latest/webchat.js", or lock down on a specific version with the following format: "/4.1.0/webchat.js".

> This CDN points to the latest official release of Web Chat. If you need to test against Web Chat's latest bits, please refer to pointing to Web Chat's MyGet feed. https://github.com/microsoft/BotFramework-WebChat#how-to-test-with-web-chats-latest-bits

To create a WebChat container, create an empty `div` in the component's template file and assign it a template variable to reference it from this component's `.ts` file.

Expand Down
2 changes: 1 addition & 1 deletion samples/04.a.display-user-bot-initials-styling/README.md
Expand Up @@ -67,7 +67,7 @@ Here is the finished `index.html`:
<html lang="en-US">
<head>
<title>Web Chat: Avatar with images and initials</title>
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<style>
html, body { height: 100% }
body { margin: 0 }
Expand Down
7 changes: 3 additions & 4 deletions samples/04.a.display-user-bot-initials-styling/index.html
Expand Up @@ -4,11 +4,10 @@
<title>Web Chat: Avatar with initials</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--
For demonstration purposes, we are using the development branch of Web Chat at "/master/webchat.js".
When you are using Web Chat for production, you should use the latest stable release at "/latest/webchat.js",
or lock down on a specific version with the following format: "/4.1.0/webchat.js".
This CDN points to the latest official release of Web Chat. If you need to test against Web Chat's latest bits, please refer to pointing to Web Chat's MyGet feed:
https://github.com/microsoft/BotFramework-WebChat#how-to-test-with-web-chats-latest-bits
-->
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<style>
html, body { height: 100% }
body { margin: 0 }
Expand Down

0 comments on commit 55057db

Please sign in to comment.