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

Add general purpose HTML and JSON rendering package #73

Merged
merged 2 commits into from
Mar 3, 2023

Conversation

sethvargo
Copy link
Contributor

This brings over a bunch of the high-performance and highly-fault-tolerant HTML and JSON rendering from Exposure Notifications, but decouples it from the EN internals. Of note:

  • It does not have a dependency on a specific logger and instead allows providing an onError handler; there are no dependencies besides the stdlib.
  • Reasonable set of built-in functions with the ability to append custom ones.

The package-level comment provides more details and there are some examples of how the package can be used in renderer_test.go.

@sethvargo sethvargo requested a review from a team as a code owner March 3, 2023 03:32
renderer/assets.go Outdated Show resolved Hide resolved
@shankiyani shankiyani self-requested a review March 3, 2023 03:40
@sethvargo sethvargo requested review from drevell and yolocs and removed request for pdewilde and lock14 March 3, 2023 03:43
This brings over a bunch of the high-performance and highly-fault-tolerant HTML and JSON rendering from Exposure Notifications, but decouples it from the EN internals. Of note:

- It does not have a dependency on a specific logger and instead allows providing an `onError` handler; there are no dependencies besides the stdlib.
- Reasonable set of built-in functions with the ability to append custom ones.

The package-level comment provides more details and there are some examples of how the package can be used in renderer_test.go.
@shankiyani
Copy link
Contributor

Thanks for doing this 🙌

@sethvargo
Copy link
Contributor Author

Thanks for doing this 🙌

Yup - I'll write it up to the JVS once I get reviews from other folks. Since it's pretty big, I requested some extra eyes 😄.

renderer/renderer.go Outdated Show resolved Hide resolved
renderer/renderer.go Outdated Show resolved Hide resolved
renderer/renderer.go Outdated Show resolved Hide resolved
@sethvargo sethvargo merged commit 33db67b into main Mar 3, 2023
@sethvargo sethvargo deleted the sethvargo/render branch March 3, 2023 19:32
@pdewilde
Copy link
Contributor

pdewilde commented Mar 3, 2023

How does this compare to https://pkg.go.dev/html/template ?

@sethvargo
Copy link
Contributor Author

@pdewilde it uses that package internally.

sethvargo added a commit to abcxyz/jvs that referenced this pull request Mar 3, 2023
github.com/abcxyz/pkg#73 ported the renderer from this project into pkg. This moves jvs to use the pkg renderer.
sethvargo added a commit to abcxyz/jvs that referenced this pull request Mar 3, 2023
github.com/abcxyz/pkg#73 ported the renderer from this project into pkg. This moves jvs to use the pkg renderer.
sethvargo added a commit to abcxyz/jvs that referenced this pull request Mar 4, 2023
github.com/abcxyz/pkg#73 ported the renderer from this project into pkg. This moves jvs to use the pkg renderer.
sethvargo added a commit to abcxyz/jvs that referenced this pull request Mar 5, 2023
github.com/abcxyz/pkg#73 ported the renderer from this project into pkg. This moves jvs to use the pkg renderer.
sqin2019 pushed a commit to abcxyz/jvs that referenced this pull request Apr 6, 2023
github.com/abcxyz/pkg#73 ported the renderer from this project into pkg. This moves jvs to use the pkg renderer.
sethvargo added a commit that referenced this pull request Jun 13, 2023
* Add general purpose HTML and JSON rendering package

This brings over a bunch of the high-performance and highly-fault-tolerant HTML and JSON rendering from Exposure Notifications, but decouples it from the EN internals. Of note:

- It does not have a dependency on a specific logger and instead allows providing an `onError` handler; there are no dependencies besides the stdlib.
- Reasonable set of built-in functions with the ability to append custom ones.

The package-level comment provides more details and there are some examples of how the package can be used in renderer_test.go.

* Process review feedback
verbanicm pushed a commit to abcxyz/jvs that referenced this pull request Jun 14, 2023
github.com/abcxyz/pkg#73 ported the renderer from this project into pkg. This moves jvs to use the pkg renderer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants