-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sentry 7 update, profiling, and session replays (#28)
* Update Sentry to v7; generate tracing & non-tracing bundles * Create custom Sentry client to tree-shake properly (reduces dist by ~200K) * Add support for Session Replay * Add support for Sentry PHP performance profiling * Show whether Excimer is enabled in admin * Only report email in PHP if enabled
- Loading branch information
1 parent
828b02b
commit 0fe0703
Showing
10 changed files
with
1,714 additions
and
4,168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,64 @@ | ||
module.exports = require('flarum-webpack-config')(); | ||
const webpack = require('webpack'); | ||
const { merge } = require('webpack-merge'); | ||
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); | ||
|
||
const config = merge( | ||
require('flarum-webpack-config')(), | ||
{ | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
__SENTRY_DEBUG__: false, | ||
}), | ||
], | ||
} | ||
); | ||
|
||
const buildDist = (filename, env, define = {}, buildAdmin = false) => merge( | ||
config, | ||
{ | ||
entry: () => { | ||
const entries = { | ||
forum: config.entry.forum, | ||
}; | ||
|
||
// No need to build admin JS multiple times | ||
if (buildAdmin) { | ||
entries.admin = config.entry.admin; | ||
} | ||
|
||
return entries; | ||
}, | ||
output: { | ||
filename, | ||
}, | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
__SENTRY_SESSION_REPLAY__: false, | ||
__SENTRY_TRACING__: false, | ||
...define, | ||
}), | ||
env.analyze && new BundleAnalyzerPlugin({ | ||
analyzerPort: 'auto', | ||
}), | ||
].filter(Boolean), | ||
} | ||
); | ||
|
||
module.exports = env => { | ||
const plain = buildDist('[name].js', env, {}, true); | ||
|
||
const tracing = buildDist('[name].tracing.js', env, { | ||
__SENTRY_TRACING__: true, | ||
}); | ||
|
||
const replay = buildDist('[name].replay.js', env, { | ||
__SENTRY_SESSION_REPLAY__: true, | ||
}); | ||
|
||
const tracingAndReplay = buildDist('[name].tracing.replay.js', env, { | ||
__SENTRY_TRACING__: true, | ||
__SENTRY_SESSION_REPLAY__: true, | ||
}); | ||
|
||
return [plain, tracing, replay, tracingAndReplay]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.