Skip to content

Commit cada72c

Browse files
committed
Updates javascript sentry for all apps using theme
Why are these changes being introduced: * The raven version of sentry has been deprecated for quite some time * This is a drop in replacement for most of our apps as they don't do explicit configurations * Th.Ing does have a Raven configuration and will need to change that to Sentry before upgrading to this theme (the PR that changes that app to use this new theme version will need to handle that at the same time) Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/ENGX-88
1 parent 9aeaf16 commit cada72c

3 files changed

Lines changed: 25 additions & 8 deletions

File tree

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,27 @@ gem 'mitlibraries-theme'
1212

1313
And then execute:
1414

15-
$ bundle
15+
```shell
16+
$ bundle
17+
```
1618

1719
Or install it yourself as:
1820

19-
$ gem install mitlibraries-theme
21+
```shell
22+
$ gem install mitlibraries-theme
23+
```
2024

2125
## Usage
2226

2327
After you bundle, delete your application local `app/views/layouts/application.rb` to use the layout the gem provides.
2428

2529
Rename your `app/assets/stylesheets/application.css` to `app/assets/stylesheets/application.scss` and remove anything like:
26-
```
30+
31+
```ruby
2732
*= require_tree .
2833
*= require_self
2934
```
35+
3036
Add
3137
`@import "libraries-main";`
3238

@@ -46,7 +52,7 @@ If you need to make changes to other templates, you can also copy those to your
4652

4753
You can load additional js to individual pages using:
4854

49-
```
55+
```ruby
5056
<% content_for :additional_js do %>
5157
<script>alert("hi");</script>
5258
<% end %>
@@ -61,7 +67,7 @@ for adding external support libraries. For JS you are writing, include via
6167
6268
You can load additional meta headers to individual pages using:
6369
64-
```
70+
```ruby
6571
<% content_for :additional_meta_tag do %>
6672
<meta name="description" content="Words and stuff about stuff or something.">
6773
<meta name="keywords" content="words,stuff,yoyos">
@@ -81,6 +87,7 @@ Run `make help` for details.
8187
8288
If your goal is to fetch the latest assets from the style repo and publish the
8389
changes, this would get you there:
90+
8491
- `make update`
8592
- manually update the version in `lib/mitlibraries/theme/version.rb`
8693
- `make dist`
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
<% if ENV['JS_EXCEPTION_LOGGER_KEY'].present? %>
2-
<script src="https://cdn.ravenjs.com/3.25.2/raven.min.js" crossorigin="anonymous"></script>
3-
<script>Raven.config('<%= ENV['JS_EXCEPTION_LOGGER_KEY'] %>').install()</script>
2+
<script
3+
src="https://browser.sentry-cdn.com/6.13.3/bundle.min.js"
4+
integrity="sha384-sGMbmxgVprpEFMz6afNDyADd4Kav86v5Tvo2Y6w5t8tHUn1P1at3lCjN7IQo2c7E"
5+
crossorigin="anonymous"
6+
></script>
7+
8+
<script>
9+
Sentry.init({
10+
dsn: <%= ENV['JS_EXCEPTION_LOGGER_KEY'] %>,
11+
maxBreadcrumbs: 50,
12+
});
13+
</script>
414
<% end %>

lib/mitlibraries/theme/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Mitlibraries
22
module Theme
3-
VERSION = '0.5.0'.freeze
3+
VERSION = '0.6.0'.freeze
44
end
55
end

0 commit comments

Comments
 (0)