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: add esbuild package #2252

Merged
merged 1 commit into from
Feb 12, 2021

Conversation

mattem
Copy link
Collaborator

@mattem mattem commented Oct 25, 2020

Adds the @bazel/esbuild package, a thin, mildly opinionated wrapper around esbuild. The rule currently just calls the esbuild binary on the command line, further iterations of this could change to call the Go API, add workers and additional features.

Example added to examples/esbuild, along with unit tests under the package dir.

In a previous iteration this PR included a repo rule to fetch the esbuild tool, however this has now been removed and user is expected to provide the binary to the rule via the tool attribute. An example macro is included in the tests dir, and the examples show supporting multi-platforms.

@google-cla google-cla bot added the cla: yes label Oct 25, 2020
@mattem mattem force-pushed the feat/package_esbuild branch 2 times, most recently from 621639c to 1fff5c6 Compare October 31, 2020 14:52
@google-cla
Copy link

google-cla bot commented Nov 13, 2020

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no and removed cla: yes labels Nov 13, 2020
@lukasholzer
Copy link
Collaborator

@googlebot I consent.

@google-cla google-cla bot added cla: yes and removed cla: no labels Nov 13, 2020
@mattem
Copy link
Collaborator Author

mattem commented Nov 29, 2020

Seems there is a difference in path resolution behaviour between MacOS and Ubuntu in esbuild perhaps, will need to dig more into that. It passes on BuildKite though

@mattem mattem force-pushed the feat/package_esbuild branch 2 times, most recently from 20e64e3 to 5664099 Compare December 5, 2020 15:24
@mattem
Copy link
Collaborator Author

mattem commented Dec 8, 2020

@lukasholzer I'm stuck here on the Windows build. Do you have access to a Windows machine to debug? If not I'll try and source something this week.

@lukasholzer
Copy link
Collaborator

@mattem yea have a windows server via remote desktop :D – will give it a try the next days and try to fix it :)

@mattem
Copy link
Collaborator Author

mattem commented Jan 24, 2021

Woo, windows is 🍏 Needs examples and docs 📖

@mattem mattem marked this pull request as ready for review January 24, 2021 19:37
@mattem mattem force-pushed the feat/package_esbuild branch 4 times, most recently from 2448a6d to 2b559d0 Compare January 31, 2021 20:22
@mattem mattem force-pushed the feat/package_esbuild branch 2 times, most recently from 9a85ee2 to 42955b1 Compare January 31, 2021 21:25
examples/esbuild/src/BUILD.bazel Show resolved Hide resolved
packages/esbuild/helpers.bzl Outdated Show resolved Hide resolved
packages/esbuild/esbuild.bzl Show resolved Hide resolved
packages/esbuild/esbuild.bzl Outdated Show resolved Hide resolved
packages/esbuild/esbuild.bzl Show resolved Hide resolved
packages/esbuild/esbuild.bzl Show resolved Hide resolved
packages/esbuild/esbuild.bzl Show resolved Hide resolved
@mattem mattem force-pushed the feat/package_esbuild branch 2 times, most recently from ebf1722 to 4d878bb Compare February 2, 2021 02:13
@mattem
Copy link
Collaborator Author

mattem commented Feb 10, 2021

rebased on stable

@mattem mattem force-pushed the feat/package_esbuild branch 2 times, most recently from a69c04a to 2e98c17 Compare February 11, 2021 21:49

_VERSION = "0.8.34"

def esbuild_dependencies():
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could pass in the version & a dict of platform => SHA as a param (with default values for v0.8.34) so make it easier to use. Then docs could be updated to suggest using this helper.

Copy link
Collaborator

Choose a reason for hiding this comment

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

From your answer above, this would introduce eager loading for users which is not great

packages/esbuild/helpers.bzl Outdated Show resolved Hide resolved
examples/esbuild/WORKSPACE Show resolved Hide resolved
@gregmagolan
Copy link
Collaborator

🌮 very nice

@alexeagle alexeagle merged commit e7e5286 into bazel-contrib:stable Feb 12, 2021
@mattem
Copy link
Collaborator Author

mattem commented Feb 12, 2021

🚀

@mattem mattem deleted the feat/package_esbuild branch February 12, 2021 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants