Skip to content

Commit e0349ce

Browse files
authored
Merge pull request #530 from MindscapeHQ/js/fix-jquery-isfunction-deprecation
Resolve jQuery isFunction warning
2 parents 2d0eeb3 + a5fadcd commit e0349ce

File tree

6 files changed

+151
-53
lines changed

6 files changed

+151
-53
lines changed

.github/workflows/prerelease.yml

Lines changed: 90 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,100 @@
1-
name: Build & Publish Raygun4JS to the pre-release environment
1+
name: Publish Raygun4JS to the pre-release environment
22

33
on:
4-
push:
5-
branches: [ master ]
64
workflow_dispatch:
7-
5+
86
jobs:
97
build:
108
runs-on: ubuntu-latest
119

1210
strategy:
1311
matrix:
14-
node-version: [12.x]
15-
12+
node-version: [ 20.x ]
13+
1614
steps:
17-
- uses: actions/checkout@v2
18-
19-
- name: Use Node.js ${{ matrix.node-version }}
20-
uses: actions/setup-node@v1
21-
with:
22-
node-version: ${{ matrix.node-version }}
23-
24-
- name: Install Grunt
25-
run: npm install -g grunt
26-
27-
- name: Install node modules
28-
run: npm install
29-
30-
- name: Build
31-
run: grunt build
32-
33-
- name: Complete
34-
run: echo Build successfully completed!
35-
36-
- name: Configure AWS Credentials
37-
uses: aws-actions/configure-aws-credentials@v1
38-
with:
39-
aws-access-key-id: ${{ secrets.AWS_ACCESS_ID }}
40-
aws-secret-access-key: ${{ secrets.AWS_ACCESS_SECRET }}
41-
aws-region: ${{ secrets.AWS_REGION }}
42-
43-
- name: Publish to S3 Pre-release
44-
run: aws s3 sync ./dist ${{ secrets.AWS_PUBLISH_TARGET }}
45-
46-
- name: Deployment Complete
47-
run: echo A new version of Raygun4JS has been deployed to pre-release!
48-
49-
- name: Notify Slack
50-
id: slack
51-
uses: slackapi/[email protected]
52-
env:
53-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
15+
- uses: actions/checkout@v4
16+
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
22+
- name: Install Grunt
23+
run: npm install -g grunt
24+
25+
- name: Install node modules
26+
run: npm install
27+
28+
- name: Build
29+
id: build_step
30+
run: grunt build
31+
32+
- name: Configure AWS Credentials
33+
uses: aws-actions/configure-aws-credentials@v4
34+
with:
35+
aws-access-key-id: ${{ secrets.AWS_ACCESS_ID }}
36+
aws-secret-access-key: ${{ secrets.AWS_ACCESS_SECRET }}
37+
aws-region: ${{ secrets.AWS_REGION }}
38+
39+
- name: Publish to S3 Pre-release
40+
id: publish_s3
41+
run: aws s3 sync ./dist ${{ secrets.AWS_PUBLISH_TARGET }}
42+
43+
- name: Create CloudFront Cache Invalidation
44+
id: cache_invalidation
45+
run: |
46+
aws cloudfront create-invalidation \
47+
--distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} \
48+
--paths "${{ secrets.AWS_CLOUDFRONT_INVALIDATION_PATH }}"
49+
50+
- name: Notify Slack
51+
id: slack
52+
uses: slackapi/[email protected]
53+
with:
54+
payload: |
55+
{
56+
"blocks": [
57+
{
58+
"type": "header",
59+
"text": {
60+
"type": "plain_text",
61+
"text": "A new pre-release version of Raygun4JS has been published"
62+
}
63+
},
64+
{
65+
"type": "section",
66+
"text": {
67+
"type": "mrkdwn",
68+
"text": "<https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View this action run in GitHub>"
69+
}
70+
},
71+
{
72+
"type": "section",
73+
"fields": [
74+
{
75+
"type": "mrkdwn",
76+
"text": "*Branch:*\n`${{ github.ref_name }}`"
77+
},
78+
{
79+
"type": "mrkdwn",
80+
"text": "*Node version:*\n`${{ matrix.node-version }}`"
81+
},
82+
{
83+
"type": "mrkdwn",
84+
"text": "*Build status:*\n_${{ steps.build_step.outcome }}_"
85+
},
86+
{
87+
"type": "mrkdwn",
88+
"text": "*S3 publish status:*\n_${{ steps.publish_s3.outcome }}_"
89+
},
90+
{
91+
"type": "mrkdwn",
92+
"text": "*CloudFront cache invalidation status:*\n_${{ steps.cache_invalidation.outcome }}_"
93+
}
94+
]
95+
}
96+
]
97+
}
98+
env:
99+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
100+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

.github/workflows/tests.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,28 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
16+
1617
- name: Use Node.js 20.x
17-
uses: actions/setup-node@v3
18+
uses: actions/setup-node@v4
1819
with:
1920
node-version: 20.x
20-
- uses: browser-actions/setup-chrome@latest
21+
22+
- name: Setup Chrome
23+
id: setup-chrome
24+
uses: browser-actions/setup-chrome@latest
2125
with:
2226
chrome-version: latest
27+
install-chromedriver: true
28+
29+
- name: Set Chrome and ChromeDriver paths
30+
run: |
31+
echo "CHROME_BIN=${{ steps.setup-chrome.outputs.chrome-path }}" >> $GITHUB_ENV
32+
echo "CHROMEDRIVER_PATH=${{ steps.setup-chrome.outputs.chromedriver-path }}" >> $GITHUB_ENV
33+
2334
- run: npm ci
2435
- run: npx grunt
2536
- run: npm test
37+
env:
38+
CHROME_BIN: ${{ env.CHROME_BIN }}
39+
CHROMEDRIVER_PATH: ${{ env.CHROMEDRIVER_PATH }}

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2828
- Unused normalize.css file
2929
3030
-->
31+
32+
## [3.1.1]
33+
34+
### Fixed
35+
- Resolved jQuery `isFunction` deprecation warnings. As of jQuery 3.3, `jQuery.isFunction()` is deprecated. It is replaced by `typeof x === "function"` - [source](https://api.jquery.com/jQuery.isFunction/).
36+
3137
## [3.1.0]
3238

3339
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"title": "Raygun4js",
99
"description": "Raygun.com plugin for JavaScript",
10-
"version": "3.1.0",
10+
"version": "3.1.1",
1111
"homepage": "https://github.com/MindscapeHQ/raygun4js",
1212
"author": {
1313
"name": "MindscapeHQ",

src/raygun.tracekit.jquery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
var keys = ['complete', 'error', 'success'], key;
5757
while(key = keys.pop()) {
58-
if ($.isFunction(options[key])) {
58+
if (typeof options[key] === "function") {
5959
options[key] = TraceKit.wrap(options[key]);
6060
}
6161
}

wdio.conf.js

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
const chromeDriverExists = (path) => {
5+
return fs.existsSync(path);
6+
};
7+
8+
const githubActionsChromeDriver = process.env.CHROMEDRIVER_PATH;
9+
const localChromeDriver = path.join(__dirname, 'node_modules', 'chromedriver', 'bin', 'chromedriver');
10+
11+
// If we are on a Continuous Integration server, use the ChromeDriver installed by browser-actions/setup-chrome.
12+
// Otherwise, use the ChromeDriver installed as a devDependency.
13+
let chromeDriverPath;
14+
if (githubActionsChromeDriver && chromeDriverExists(githubActionsChromeDriver)) {
15+
chromeDriverPath = githubActionsChromeDriver;
16+
} else if (chromeDriverExists(localChromeDriver)) {
17+
chromeDriverPath = localChromeDriver;
18+
} else {
19+
console.warn('ChromeDriver not found in expected locations. Using default.');
20+
}
21+
122
exports.config = {
223
//
324
// ====================
@@ -48,9 +69,16 @@ exports.config = {
4869
capabilities: [{
4970
maxInstances: 4,
5071
browserName: 'chrome',
51-
'goog:chromeOptions': {
52-
args: ['headless', 'disable-gpu', 'no-sandbox']
53-
},
72+
'goog:chromeOptions': (function() {
73+
const options = {
74+
args: ['headless', 'disable-gpu', 'no-sandbox'],
75+
};
76+
// Use the CHROME_BIN environment variable if present.
77+
if (process.env.CHROME_BIN) {
78+
options.binary = process.env.CHROME_BIN;
79+
}
80+
return options;
81+
})(),
5482
}],
5583
//
5684
// ===================
@@ -112,8 +140,11 @@ exports.config = {
112140
{ mount: '/fixtures', path: './tests/fixtures' },
113141
{ mount: '/dist', path: './dist' },
114142
]
115-
}
116-
], 'chromedriver'],
143+
}],
144+
['chromedriver', {
145+
chromedriverCustomPath: chromeDriverPath
146+
}]
147+
],
117148
chromeDriverArgs: ['--headless', '--disable-gpu'],
118149

119150
// Framework you want to run your specs with.

0 commit comments

Comments
 (0)