Comments (10)
I use a post deploy script for this purpose. Here's the meat of it:
URL_BASE="https://my.website.com"
for js in dist/assets/*.js; do
# $js has the full path. Chop it down to just the file name.
filename=$(basename ${js})
if [ "$EMBER_ENV" == "production" ]; then
# Production requires a little more work because of Ember CLI's fingerprinting.
# First, remove the ember-generated fingerprint and .js extension. This prefix is common between JS and MAP file.
filebase=$(expr match "$filename" '\(.*-\)')
# Find the map file with this prefix. We take extra care to make sure it's simply the prefix + fingerprint + .map.
# Without this additional logic, spigotlabs-abcd.map and spigotlabs-frontend-dcba.map would both match while handling
# spigotlabs-1234.js
mapfile=$(find dist/assets -regex "dist/assets/${filebase}[0-9a-f]+\.map")
else
mapfile=${js%%.js}.map
fi
if [ -e ${mapfile} ]; then
echo "Uploading js/map files to Rollbar: ${filename}, ${mapfile}"
curl https://api.rollbar.com/api/1/sourcemap \
-F access_token=${ROLLBAR_ACCESS_TOKEN} \
-F version=${SOURCE_VERSION} \
-F minified_url=${URL_BASE}/assets/${filename} \
-F source_map=@${mapfile}
fi
done
This could be included in the add-on using the postBuild hook, which would be a nice enhancement.
from ember-cli-rollbar.
@NullVoxPopuli Hey, Rollbar support here. You'll need to setup the correct additional parameters in your rollbar configuration: https://rollbar.com/docs/source-maps/.
from ember-cli-rollbar.
I don't have a ton of free cycles at the moment to tackle this, but PRs are welcome :) Otherwise, I'll take a stab when I find some time.
from ember-cli-rollbar.
You and me both - race ya :D
from ember-cli-rollbar.
@wcurtis I dug into those docs, and Rollbar's recommended approach to handling source maps is to upload the source map files on every deploy (which is well outside the scope of this addon). If you do that, then all you need is to enable a couple options in the Rollbar config (which is currently supported via ENV.rollbar
). So it seems this is currently possible, unless I'm misunderstanding their docs?
from ember-cli-rollbar.
We ended up enabling source maps through ember-cli and all worked as expected 👍
Sourcemaps are enabled by default in dev, to enable them in production pass {sourcemaps: { enabled: true, extensions: ['js']}} to your EmberApp constructor.
No change to this addon needed - will close it out.
from ember-cli-rollbar.
Glad to hear it! Thanks for the update
from ember-cli-rollbar.
@wcurtis how did you get rollbar to recognize source maps? I don't even know if mine are uploaded.
in ember-cli-build.js, I have sourcemaps: { enabled: true }
from ember-cli-rollbar.
but how do I set all that with ember-cli-rollbar?
I don't know if the deploy fingerprint is accessible in my environment.js (where rollbar is configured)
and the docs show snake_cased config, whereas ember-cli-rollbar is camelCase :-\
from ember-cli-rollbar.
my sourcemaps are getting uploaded -
I guess, now there needs to be a way to configure deploy.js to point to whichever one of those is correct?
from ember-cli-rollbar.
Related Issues (20)
- cannot be used within addons: Cannot read property 'env' of undefined
- update ember-cli-babel
- "document is not defined" in FastBoot environment
- Not catching errors for Android and Ios builds
- window.Rollbar.init is not a function
- CDN link causing CORS errors HOT 1
- Interested in Deprecating this? HOT 1
- person payload HOT 2
- Content Security Policy HOT 2
- Release 0.2.6 on NPM HOT 1
- upgrade snippet again please. HOT 1
- Add documentation for source map support
- Support static imports HOT 4
- Support Fastboot environment HOT 1
- Report errors from Ember.onerror
- Could not find module `rollbar` for disabled environments HOT 1
- Question on Ember version support HOT 2
- Option to disable logging warnings & debug messages? HOT 1
- Fix breaking changes in FastBoot 1.0
- Depreciation for .container should be .getOwner
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-cli-rollbar.