Skip to content

Commit

Permalink
Merge branch 'master' into feature/new-sdks
Browse files Browse the repository at this point in the history
* master:
  Manual setup instructions in settings.gradle (#309)
  Add link to GHE on Integrations page
  fix (ui): broken layout on certain pages due to flexbox
  Remove twitter, linkedin, bing
  build: Increase timeout
  Add a space
  fix: switch to jsx highlighting for react docs
  Fix: broken link to angular error handler docs
  remove log
  Handle empty search
  Document payload size for javascript SDK
  • Loading branch information
HazAT committed Sep 5, 2018
2 parents a268deb + 310b094 commit fbb45e3
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 67 deletions.
1 change: 1 addition & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ images: [
'us.gcr.io/$PROJECT_ID/$REPO_NAME:latest',
'us.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA',
]
timeout: 20m
12 changes: 8 additions & 4 deletions src/_js/lib/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ const renderResult = function(data) {

const renderResults = function(results, query) {
const $results = $('[data-search-results]').clone();
if (!results.length) {
$results.append(`<p>No results matching "${query}"</p>`);
if (!results || !results.length) {
const msg = `No results${!!results ? ` matching "${query}"` : ''}`;
$results.append(`<p>${msg}</p>`);
}
$.each(results, function(i, result) {
$results.append(renderResult(result));
Expand Down Expand Up @@ -53,8 +54,11 @@ class Search {
init() {
const params = qs.parse(location.search);

if (!params.q) return Promise.resolve();

if (!params.q) {
return Promise.resolve().then(() => {
$('[data-search-results]').append(renderResults());
});
}
$('input[name="q"]').val(params.q);

return this.Lunr.search(params.q).then(results => {
Expand Down
54 changes: 0 additions & 54 deletions src/_js/lib/Trackers.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
export const twitter = function() {
const img1 = document.createElement('img');
img1.src =
'https://analytics.twitter.com/i/adsct?txn_id=nydby&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0';
img1.setAttribute('height', '1');
img1.setAttribute('width', '1');
img1.setAttribute('style', 'display:none;');
img1.setAttribute('alt', '');
img1.setAttribute('aria-hidden', 'true');

const img2 = document.createElement('img');
img2.src =
'//t.co/i/adsct?txn_id=nydby&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0';
img2.setAttribute('height', '1');
img2.setAttribute('width', '1');
img2.setAttribute('style', 'display:none;');
img2.setAttribute('alt', '');
img2.setAttribute('aria-hidden', 'true');

document.body.appendChild(img1);
document.body.appendChild(img2);
};

export const facebook = function() {
const img = document.createElement('img');
img.src =
Expand All @@ -33,37 +10,6 @@ export const facebook = function() {
document.body.appendChild(img);
};

export const linkedin = function() {
window._linkedin_data_partner_id = '107517';
const s = document.getElementsByTagName('script')[0];
const b = document.createElement('script');
b.type = 'text/javascript';
b.async = true;
b.src = 'https://snap.licdn.com/li.lms-analytics/insight.min.js';
s.parentNode.insertBefore(b, s);
};

export const bing = function() {
(function(w, d, t, r, u) {
var f, n, i;
(w[u] = w[u] || []),
(f = function() {
var o = { ti: '5751143' };
(o.q = w[u]), (w[u] = new UET(o)), w[u].push('pageLoad');
}),
(n = d.createElement(t)),
(n.src = r),
(n.async = 1),
(n.onload = n.onreadystatechange = function() {
var s = this.readyState;
(s && s !== 'loaded' && s !== 'complete') ||
(f(), (n.onload = n.onreadystatechange = null));
}),
(i = d.getElementsByTagName(t)[0]),
i.parentNode.insertBefore(n, i);
})(window, document, 'script', '//bat.bing.com/bat.js', 'uetq');
};

export const hubspot = function() {
const script = document.createElement('script');
script.setAttribute('src', '//js.hs-scripts.com/3344477.js');
Expand Down
3 changes: 0 additions & 3 deletions src/_js/lib/Tracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ const init = function() {
const namespace = 'trackersOk';

loadIfTrackersOk.push(google);
loadIfTrackersOk.push(twitter);
loadIfTrackersOk.push(facebook);
loadIfTrackersOk.push(linkedin);
loadIfTrackersOk.push(bing);
loadIfTrackersOk.push(hubspot);

// If we've been given permission to track, set a cookie that we can check
Expand Down
4 changes: 2 additions & 2 deletions src/_layouts/doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="row h-md-100 mx-0 no-gutters document-wrapper align-items-stretch">

<div class="col-12 h-md-100 col-md sidebar bg-dark">
<div class="h-md-100 col-md-3 sidebar bg-dark">
{% meminclude global_brand.html %}

<div class="toc collapse navbar-collapse" id="sidebar">
Expand All @@ -17,7 +17,7 @@
</div>


<main role="main" class="col h-md-100 px-0 d-md-flex flex-column">
<main role="main" class="col-md-9 h-md-100 px-0 d-md-flex flex-column">
<div class="flex-grow-1 overflow-md-scroll main-scroll">
<div class="d-none d-md-block">
{% meminclude global_navbar.html %}
Expand Down
4 changes: 3 additions & 1 deletion src/collections/_documentation/clients/javascript/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,14 @@ Those configuration options are documented below:

: `fetch()` init parameters ([https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)).

Setting `keepalive: true` parameter will allow SDK to send events in `unload` and `beforeunload` handlers.
However, it'll also restrict the size of a single event to 64kB, per [fetch specification](https://fetch.spec.whatwg.org/#http-network-or-cache-fetch) (point 8.5).

Defaults:

```javascript
{
method: 'POST',
keepalive: true,
referrerPolicy: 'origin'
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebar_order: 7

This document uses Angular to refer to Angular 2+. On its own, Raven.js will report any uncaught exceptions triggered from your application. For advanced usage examples of Raven.js, please read [_Raven.js usage_]({%- link _documentation/clients/javascript/usage.md -%}).

Additionally, Raven.js can be configured to catch any Angular-specific (2.x) exceptions reported through the [@angular/core/ErrorHandler](https://angular.io/docs/js/latest/api/core/index/ErrorHandler-class.html) component.
Additionally, Raven.js can be configured to catch any Angular-specific (2.x) exceptions reported through the [@angular/core/ErrorHandler](https://angular.io/api/core/ErrorHandler) component.

## TypeScript Support

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ At this point, Raven is ready to capture any uncaught exception.

If you’re using React 16 or above, [Error Boundaries](https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html) are an important tool for defining the behavior of your application in the face of errors. Be sure to send errors they catch to Sentry using `Raven.captureException`, and optionally this is also a great opportunity to surface [User Feedback]({%- link _documentation/learn/user-feedback.md -%})

```javascript
```jsx
class ExampleBoundary extends Component {
constructor(props) {
super(props);
Expand Down Expand Up @@ -58,7 +58,7 @@ class ExampleBoundary extends Component {
}
```

```javascript
```html
<div>
<ExampleBoundary>
<h2>Sidebar</h2>
Expand Down
4 changes: 4 additions & 0 deletions src/collections/_documentation/clients/javascript/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ The `captureMessage`, `captureException`, `context`, and `wrap` functions all al
Raven.setTagsContext(tags); // Add back the tags you want to keep.
```

**Be aware of maximal payload size** - There are times, when you want to send a whole application state as an extra data.
This can be quite a large object, which can easily weigh more than 200kB, which is currently maximamal payload size of a single event sent to Sentry.
When this happens, you'll get an `HTTP Error 413 Payload Too Large` as the server response or (when `keepalive: true` is set as `fetch` parameter) request will stay in `pending` state forever (eg. in Chrome).

`extra`

: Arbitrary data to associate with the event.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,10 @@ public class MainApplication extends Application implements ReactApplication {

}
```


Add the following to your `settings.gradle` file:
```java
include ':react-native-sentry'
project(':react-native-sentry').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sentry/android')
```
1 change: 1 addition & 0 deletions src/collections/_documentation/integrations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Sentry integrates seamlessly with your favorite apps and services.
- Campfire
- Flowdock
- [_GitHub_]({%- link _documentation/integrations/github.md -%})
- [_GitHub Enterprise_]({%- link _documentation/integrations/github-enterprise.md -%})
- GitLab
- [_Heroku_]({%- link _documentation/integrations/heroku.md -%})
- [_HipChat_]({%- link _documentation/integrations/hipchat.md -%})
Expand Down

0 comments on commit fbb45e3

Please sign in to comment.