123456 |
- {
- "html": "<div class=\"section\" id=\"installation\">\n<h2>Installation</h2>\n<p>Raven.js and the Raven.js Ember plugin are distributed using a few different methods.</p>\n<div class=\"section\" id=\"using-our-cdn\">\n<h3>Using our CDN</h3>\n<p>For convenience, our CDN serves a single, minified JavaScript file containing both Raven.js and the Raven.js Ember plugin. It should be included <strong>after</strong> Ember, but <strong>before</strong> your application code.</p>\n<p>Example:</p>\n<div class=\"highlight-html\"><div class=\"highlight\" style=\"background: #ffffff\"><pre style=\"line-height: 125%\"><span></span><span style=\"color: #111111\"><</span><span style=\"color: #2eb0f7\">script</span> <span style=\"color: #a47ac6\">src</span><span style=\"color: #4b4f5c\">=</span><span style=\"color: #e8535a\">"http://builds.emberjs.com/tags/v2.3.1/ember.prod.js"</span><span style=\"color: #111111\">></</span><span style=\"color: #2eb0f7\">script</span><span style=\"color: #111111\">></span>\n<span style=\"color: #111111\"><</span><span style=\"color: #2eb0f7\">script</span> <span style=\"color: #a47ac6\">src</span><span style=\"color: #4b4f5c\">=</span><span style=\"color: #e8535a\">"https://cdn.ravenjs.com/3.20.1/ember/raven.min.js"</span> <span style=\"color: #a47ac6\">crossorigin</span><span style=\"color: #4b4f5c\">=</span><span style=\"color: #e8535a\">"anonymous"</span><span style=\"color: #111111\">></</span><span style=\"color: #2eb0f7\">script</span><span style=\"color: #111111\">></span>\n<span style=\"color: #111111\"><</span><span style=\"color: #2eb0f7\">script</span><span style=\"color: #111111\">>Raven.config(</span><span style=\"color: #e8535a\">'___PUBLIC_DSN___'</span><span style=\"color: #111111\">).install();</</span><span style=\"color: #2eb0f7\">script</span><span style=\"color: #111111\">></span>\n</pre></div>\n</div>\n<p>Note that this CDN build auto-initializes the Ember plugin.</p>\n</div>\n<div class=\"section\" id=\"using-package-managers\">\n<h3>Using package managers</h3>\n<p>Pre-built distributions of Raven.js and the Raven.js Ember plugin are available via both Bower and npm for importing in your <code class=\"docutils literal\"><span class=\"pre\">ember-cli-build.js</span></code> file.</p>\n<div class=\"section\" id=\"bower\">\n<h4>Bower</h4>\n<div class=\"highlight-sh\"><div class=\"highlight\" style=\"background: #ffffff\"><pre style=\"line-height: 125%\"><span></span>$ bower install raven-js --save\n</pre></div>\n</div>\n<div class=\"highlight-javascript\"><div class=\"highlight\" style=\"background: #ffffff\"><pre style=\"line-height: 125%\"><span></span><span style=\"color: #111111\">app.</span><span style=\"color: #2eb0f7\">import</span><span style=\"color: #111111\">(</span><span style=\"color: #e8535a\">'bower_components/raven-js/dist/raven.js'</span><span style=\"color: #111111\">);</span>\n<span style=\"color: #111111\">app.</span><span style=\"color: #2eb0f7\">import</span><span style=\"color: #111111\">(</span><span style=\"color: #e8535a\">'bower_components/raven-js/dist/plugins/ember.js'</span><span style=\"color: #111111\">);</span>\n</pre></div>\n</div>\n<div class=\"highlight-html\"><div class=\"highlight\" style=\"background: #ffffff\"><pre style=\"line-height: 125%\"><span></span><span style=\"color: #111111\"><</span><span style=\"color: #2eb0f7\">script</span> <span style=\"color: #a47ac6\">src</span><span style=\"color: #4b4f5c\">=</span><span style=\"color: #e8535a\">"assets/vendor.js"</span><span style=\"color: #111111\">></</span><span style=\"color: #2eb0f7\">script</span><span style=\"color: #111111\">></span>\n<span style=\"color: #111111\"><</span><span style=\"color: #2eb0f7\">script</span><span style=\"color: #111111\">></span>\n <span style=\"color: #111111\">Raven</span>\n <span style=\"color: #111111\">.config(</span><span style=\"color: #e8535a\">'___PUBLIC_DSN___'</span><span style=\"color: #111111\">)</span>\n <span style=\"color: #111111\">.addPlugin(Raven.Plugins.Ember)</span>\n <span style=\"color: #111111\">.install();</span>\n<span style=\"color: #111111\"></</span><span style=\"color: #2eb0f7\">script</span><span style=\"color: #111111\">></span>\n<span style=\"color: #111111\"><</span><span style=\"color: #2eb0f7\">script</span> <span style=\"color: #a47ac6\">src</span><span style=\"color: #4b4f5c\">=</span><span style=\"color: #e8535a\">"assets/your-app.js"</span><span style=\"color: #111111\">></</span><span style=\"color: #2eb0f7\">script</span><span style=\"color: #111111\">></span>\n</pre></div>\n</div>\n</div>\n<div class=\"section\" id=\"npm\">\n<h4>npm</h4>\n<div class=\"highlight-sh\"><div class=\"highlight\" style=\"background: #ffffff\"><pre style=\"line-height: 125%\"><span></span>$ npm install raven-js --save\n</pre></div>\n</div>\n<div class=\"highlight-javascript\"><div class=\"highlight\" style=\"background: #ffffff\"><pre style=\"line-height: 125%\"><span></span><span style=\"color: #111111\">app.</span><span style=\"color: #2eb0f7\">import</span><span style=\"color: #111111\">(</span><span style=\"color: #e8535a\">'node_modules/raven-js/dist/raven.js'</span><span style=\"color: #111111\">);</span>\n<span style=\"color: #111111\">app.</span><span style=\"color: #2eb0f7\">import</span><span style=\"color: #111111\">(</span><span style=\"color: #e8535a\">'node_modules/raven-js/dist/plugins/ember.js'</span><span style=\"color: #111111\">);</span>\n</pre></div>\n</div>\n<div class=\"highlight-html\"><div class=\"highlight\" style=\"background: #ffffff\"><pre style=\"line-height: 125%\"><span></span><span style=\"color: #111111\"><</span><span style=\"color: #2eb0f7\">script</span> <span style=\"color: #a47ac6\">src</span><span style=\"color: #4b4f5c\">=</span><span style=\"color: #e8535a\">"assets/vendor.js"</span><span style=\"color: #111111\">></</span><span style=\"color: #2eb0f7\">script</span><span style=\"color: #111111\">></span>\n<span style=\"color: #111111\"><</span><span style=\"color: #2eb0f7\">script</span><span style=\"color: #111111\">></span>\n <span style=\"color: #111111\">Raven</span>\n <span style=\"color: #111111\">.config(</span><span style=\"color: #e8535a\">'___PUBLIC_DSN___'</span><span style=\"color: #111111\">)</span>\n <span style=\"color: #111111\">.addPlugin(Raven.Plugins.Ember)</span>\n <span style=\"color: #111111\">.install();</span>\n<span style=\"color: #111111\"></</span><span style=\"color: #2eb0f7\">script</span><span style=\"color: #111111\">></span>\n<span style=\"color: #111111\"><</span><span style=\"color: #2eb0f7\">script</span> <span style=\"color: #a47ac6\">src</span><span style=\"color: #4b4f5c\">=</span><span style=\"color: #e8535a\">"assets/your-app.js"</span><span style=\"color: #111111\">></</span><span style=\"color: #2eb0f7\">script</span><span style=\"color: #111111\">></span>\n</pre></div>\n</div>\n<p>These examples assume that Ember is exported globally as <code class=\"docutils literal\"><span class=\"pre\">window.Ember</span></code>. You can alternatively pass a reference to the <code class=\"docutils literal\"><span class=\"pre\">Ember</span></code> object directly as the second argument to <code class=\"docutils literal\"><span class=\"pre\">addPlugin</span></code>:</p>\n<div class=\"highlight-javascript\"><div class=\"highlight\" style=\"background: #ffffff\"><pre style=\"line-height: 125%\"><span></span><span style=\"color: #111111\">Raven.addPlugin(Raven.Plugins.Ember,</span> <span style=\"color: #111111\">Ember);</span>\n</pre></div>\n</div>\n</div>\n</div>\n</div>\n",
- "link": "https://docs.getsentry.com/clients/javascript/integrations/ember/",
- "id": "javascript-ember",
- "name": "Ember"
- }
|