Skip to content

Commit

Permalink
Release v7.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
bengourley committed Sep 10, 2020
2 parents 31f1546 + 2485885 commit 29efc95
Show file tree
Hide file tree
Showing 115 changed files with 470 additions and 6,417 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 7.3.4 (2020-09-10)

### Fixed

- (react-native): Suppress unchecked cast warnings for React Native Android [#1027](https://github.com/bugsnag/bugsnag-js/pull/1027)
- (react-native): Provide proguard rules to ensure reflection works on minified/obfuscated Android builds [#1030](https://github.com/bugsnag/bugsnag-js/pull/1030)

### Removed

- (react-native): Remove unnecessary log on iOS [#1028](https://github.com/bugsnag/bugsnag-js/pull/1028)

## 7.3.3 (2020-08-26)

### Added
Expand Down
2 changes: 1 addition & 1 deletion bin/local-test-util
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,6 @@ async function runTests (args) {
`-v`, `${process.cwd()}/test/browser/:/app/test/browser`,
`-w`, `/app/test/browser`,
`-p`, `9020:9020`,
`855461928731.dkr.ecr.us-west-1.amazonaws.com/maze-runner:latest-cli`
`855461928731.dkr.ecr.us-west-1.amazonaws.com/maze-runner:latest-v2-cli`
].concat(args || []))
}
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile.browser
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ RUN find . -name package.json -type f -mindepth 2 -maxdepth 3 ! -path "./node_mo
RUN rm -fr **/*/node_modules/

# The maze-runner browser tests
FROM 855461928731.dkr.ecr.us-west-1.amazonaws.com/maze-runner:latest-cli as browser-maze-runner
FROM 855461928731.dkr.ecr.us-west-1.amazonaws.com/maze-runner:latest-v2-cli as browser-maze-runner
RUN apk add --no-cache ruby-dev build-base libffi-dev curl-dev
ENV GLIBC_VERSION 2.23-r3

Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile.expo
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CI test image for unit/lint/type tests
FROM 855461928731.dkr.ecr.us-west-1.amazonaws.com/maze-runner:latest-cli as expo-maze-runner
FROM 855461928731.dkr.ecr.us-west-1.amazonaws.com/maze-runner:latest-v2-cli as expo-maze-runner
RUN apk add --no-cache ruby-dev build-base libffi-dev curl-dev curl
COPY /test/expo /app/test/expo
WORKDIR /app/test/expo
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile.node
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN npm pack --verbose packages/plugin-koa/
RUN npm pack --verbose packages/plugin-restify/

# The maze-runner node tests
FROM 855461928731.dkr.ecr.us-west-1.amazonaws.com/maze-runner:latest-cli as node-maze-runner
FROM 855461928731.dkr.ecr.us-west-1.amazonaws.com/maze-runner:latest-v2-cli as node-maze-runner
WORKDIR /app/
COPY packages/node/ .
COPY test/node test/node
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile.react-native
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CI test image for unit/lint/type tests
FROM 855461928731.dkr.ecr.us-west-1.amazonaws.com/maze-runner:typed-platform-checks-ci
FROM 855461928731.dkr.ecr.us-west-1.amazonaws.com/maze-runner:latest-v2-cli
RUN apk add --no-cache ruby-dev build-base libffi-dev curl-dev curl
COPY /test/react-native /app/test/react-native
WORKDIR /app/test/react-native
Expand Down
2 changes: 1 addition & 1 deletion examples/js/nuxtjs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ build: {
if (!isDev && isClient) {
config.devtool = '#source-map'
config.devtool = 'source-map'
config.plugins.push(
new BugsnagSourceMapUploaderPlugin({
Expand Down
13 changes: 13 additions & 0 deletions examples/js/nuxtjs/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,20 @@ module.exports = {
** You can extend webpack config here
*/
extend (config, ctx) {
if (!isDev && isClient) {

config.devtool = 'source-map'

config.plugins.push(
new BugsnagSourceMapUploaderPlugin({
apiKey: 'YOUR_BROWSER_API_KEY',
appVersion: require('./package.json').version,
releaseStage: 'production',
overwrite: true,
publicPath: '*'
})
)
}
}
}
}
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ module.exports = {
testMatch: [
testsForPackage('browser'),
testsForPackage('delivery-x-domain-request'),
testsForPackage('delivery-xml-http-request'),
testsForPackage('plugin-react'),
testsForPackage('plugin-vue'),
testsForPackage('plugin-browser-context'),
testsForPackage('plugin-browser-device'),
testsForPackage('plugin-browser-request'),
testsForPackage('plugin-client-ip'),
testsForPackage('plugin-window-unhandled-rejection'),
testsForPackage('plugin-window-onerror'),
testsForPackage('plugin-strip-query-string'),
Expand All @@ -41,6 +43,7 @@ module.exports = {
testsForPackage('plugin-react-native-app-state-breadcrumbs'),
testsForPackage('plugin-react-native-unhandled-rejection'),
testsForPackage('plugin-react-native-hermes'),
testsForPackage('plugin-react-native-client-sync'),
testsForPackage('plugin-react-native-event-sync')
],
setupFiles: [
Expand All @@ -54,6 +57,7 @@ module.exports = {
testEnvironment: 'node',
testMatch: [
testsForPackage('delivery-node'),
testsForPackage('plugin-contextualize'),
testsForPackage('plugin-server-*'),
testsForPackage('plugin-strip-project-root'),
testsForPackage('plugin-intercept'),
Expand Down
17 changes: 14 additions & 3 deletions packages/browser/bin/cdn-upload
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,20 @@ const headers = {
'x-amz-acl': 'public-read'
}

const upload = (localPath, remotePath) => {
console.log(`uploading ${relative('..', localPath)} -> ${remotePath}`)
return promisify(s3Client.putFile.bind(s3Client))(localPath, remotePath, headers)
const putFile = promisify(s3Client.putFile.bind(s3Client))

const upload = async (localPath, remotePath) => {
const relativePath = relative('..', localPath)
console.log(`uploading ${relativePath} -> ${remotePath}`)

const response = await putFile(localPath, remotePath, headers)

// Knox doesn't error if the request fails, so we need to check if this was a successful upload
if (response.statusCode >= 400) {
throw new Error(`Failed to upload ${relativePath}: ${response.statusCode} ${response.statusMessage}`)
}

return response
}

const invalidate = (paths) => {
Expand Down
4 changes: 3 additions & 1 deletion packages/core/client.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, OnErrorCallback, Config, Breadcrumb, Session, OnSessionCallback, OnBreadcrumbCallback, Plugin, Device, App } from './types'
import { Client, OnErrorCallback, Config, Breadcrumb, Session, OnSessionCallback, OnBreadcrumbCallback, Plugin, Device, App, User } from './types'
import EventWithInternals from './event'

interface LoggerConfig {
Expand Down Expand Up @@ -46,6 +46,8 @@ export default class ClientWithInternals<T extends Config = Config> extends Clie
_delivery: Delivery
_setDelivery: (handler: (client: Client) => Delivery) => void

_user: User

_metadata: { [key: string]: any }

startSession(): ClientWithInternals
Expand Down
1 change: 1 addition & 0 deletions packages/core/event.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface HandledState {
export default class EventWithInternals extends Event {
constructor (errorClass: string, errorMessage: string, stacktrace: any[], handledState?: HandledState, originalError?: Error)
_metadata: { [key: string]: any }
_user: User
_handledState: HandledState
_session?: Session
toJSON(): {
Expand Down
6 changes: 6 additions & 0 deletions packages/delivery-xml-http-request/delivery.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Delivery } from '@bugsnag/core/client'
import { Client } from '@bugsnag/core'

declare const delivery: (client: Client, window?: Window) => Delivery

export default delivery
7 changes: 1 addition & 6 deletions packages/delivery-xml-http-request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,10 @@
"files": [
"*.js"
],
"scripts": {
"test": "nyc --reporter=lcov -- jasmine '!(node_modules)/**/*.test.js'"
},
"author": "Bugsnag",
"license": "MIT",
"devDependencies": {
"@bugsnag/core": "^7.3.3",
"jasmine": "^3.1.0",
"nyc": "^12.0.2"
"@bugsnag/core": "^7.3.3"
},
"peerDependencies": {
"@bugsnag/core": "^7.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
const { describe, it, expect } = global
import delivery from '../'
import { Client } from '@bugsnag/core'
import { EventDeliveryPayload } from '@bugsnag/core/client'

const delivery = require('../')
interface MockXMLHttpRequest {
method: string | null
url: string | null
data: string | null
headers: { [key: string]: string }
readyState: string | null
}

describe('delivery:XMLHttpRequest', () => {
it('sends events successfully', done => {
const requests = []
const requests: MockXMLHttpRequest[] = []

// mock XMLHttpRequest class
function XMLHttpRequest () {
function XMLHttpRequest (this: MockXMLHttpRequest) {
this.method = null
this.url = null
this.data = null
Expand All @@ -16,26 +24,26 @@ describe('delivery:XMLHttpRequest', () => {
requests.push(this)
}
XMLHttpRequest.DONE = 4
XMLHttpRequest.prototype.open = function (method, url) {
XMLHttpRequest.prototype.open = function (method: string, url: string) {
this.method = method
this.url = url
}
XMLHttpRequest.prototype.setRequestHeader = function (key, val) {
XMLHttpRequest.prototype.setRequestHeader = function (key: string, val: string) {
this.headers[key] = val
}
XMLHttpRequest.prototype.send = function (data) {
XMLHttpRequest.prototype.send = function (data: string) {
this.data = data
this.readyState = XMLHttpRequest.DONE
this.onreadystatechange()
}

const payload = { sample: 'payload' }
const payload = { sample: 'payload' } as unknown as EventDeliveryPayload
const config = {
apiKey: 'aaaaaaaa',
endpoints: { notify: '/echo/' },
redactedKeys: []
}
delivery({ logger: {}, _config: config }, { XMLHttpRequest }).sendEvent(payload, (err) => {
delivery({ logger: {}, _config: config } as unknown as Client, { XMLHttpRequest } as unknown as Window).sendEvent(payload, (err: any) => {
expect(err).toBe(null)
expect(requests.length).toBe(1)
expect(requests[0].method).toBe('POST')
Expand All @@ -50,10 +58,10 @@ describe('delivery:XMLHttpRequest', () => {
})

it('sends sessions successfully', done => {
const requests = []
const requests: MockXMLHttpRequest[] = []

// mock XMLHttpRequest class
function XMLHttpRequest () {
function XMLHttpRequest (this: MockXMLHttpRequest) {
this.method = null
this.url = null
this.data = null
Expand All @@ -62,26 +70,26 @@ describe('delivery:XMLHttpRequest', () => {
requests.push(this)
}
XMLHttpRequest.DONE = 4
XMLHttpRequest.prototype.open = function (method, url) {
XMLHttpRequest.prototype.open = function (method: string, url: string) {
this.method = method
this.url = url
}
XMLHttpRequest.prototype.setRequestHeader = function (key, val) {
XMLHttpRequest.prototype.setRequestHeader = function (key: string, val: string) {
this.headers[key] = val
}
XMLHttpRequest.prototype.send = function (data) {
XMLHttpRequest.prototype.send = function (data: string) {
this.data = data
this.readyState = XMLHttpRequest.DONE
this.onreadystatechange()
}

const payload = { sample: 'payload' }
const payload = { sample: 'payload' } as unknown as EventDeliveryPayload
const config = {
apiKey: 'aaaaaaaa',
endpoints: { notify: '/', sessions: '/echo/' },
redactedKeys: []
}
delivery({ _config: config, logger: {} }, { XMLHttpRequest }).sendSession(payload, (err) => {
delivery({ _config: config, logger: {} } as unknown as Client, { XMLHttpRequest } as unknown as Window).sendSession(payload, (err) => {
expect(err).toBe(null)
expect(requests.length).toBe(1)
expect(requests[0].method).toBe('POST')
Expand Down
Loading

0 comments on commit 29efc95

Please sign in to comment.