Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: esbuild plugin #1318

Merged
merged 21 commits into from
Apr 19, 2024
Merged

feat: esbuild plugin #1318

merged 21 commits into from
Apr 19, 2024

Conversation

subzero10
Copy link
Member

@subzero10 subzero10 commented Mar 24, 2024

Status

READY

Description

Refs: #1236.
Creates an esbuild-plugin to automatically upload source maps and send deploy notifications to Honeybadger.

Todos

  • Tests
  • Manual test
  • Documentation
  • README.md
  • Create new npm plugin
  • Upload source maps
  • Send deploy notifications

@subzero10 subzero10 self-assigned this Mar 24, 2024
packages/react-native/example/package-lock.json
packages/nextjs/examples/app-router/package-lock.json
packages/nextjs/examples/pages-router/package-lock.json
cache-dependency-path: package-lock.json
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These aren't necessary anymore since we aren't installing packages in the example folders.

@@ -0,0 +1,113 @@
# Honeybadger's esbuild Source Map Plugin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of this is a copy-paste from the Rollup README.

@@ -0,0 +1,7 @@
{
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are not installing deps in example apps, we need this eslint configuration to ignore the dependency not found error.

"description": "Esbuild plugin to upload source maps to Honeybadger's API - http://docs.honeybadger.io/guides/source-maps.html",
"main": "./dist/index.js",
"scripts": {
"build": "tsc",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could've have used esbuild to actually transpile the Typescript code into javascript, but esbuild does not support type declarations, so I went with Typescript's compiler.

}

// need to set write to false to get the outputFiles
build.initialOptions.write = false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently we have to disable writing to disk in order to get the output files, so we do that ourselves below.

@subzero10
Copy link
Member Author

An error reported from the example project react-typescript:
image

@subzero10 subzero10 requested review from stympy and joshuap April 18, 2024 17:09
@subzero10 subzero10 added esbuild @honeybadger-io/esbuild-plugin enhancement labels Apr 18, 2024
stympy
stympy previously approved these changes Apr 18, 2024
Copy link
Member

@joshuap joshuap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! I appreciated the initial PR comments/self-review that you did on this PR.

packages/esbuild-plugin/README.md Outdated Show resolved Hide resolved
packages/esbuild-plugin/README.md Outdated Show resolved Hide resolved
@subzero10 subzero10 merged commit 40ea7b4 into master Apr 19, 2024
9 checks passed
@subzero10 subzero10 deleted the esbuild-plugin branch April 19, 2024 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement esbuild @honeybadger-io/esbuild-plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants