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

Adjust readme: use zig fetch in ## How to use #89

Merged
merged 2 commits into from
Jan 31, 2025

Conversation

42LM
Copy link
Contributor

@42LM 42LM commented Jan 28, 2025

Hey folks,
i finally got the time to check out this project :). First of all thanks alot for doing this <3! I am not super experienced with contributing to open source projects, but i want to dive into helping out in some projects and this fits very fitting.

I am working with protobuf at work, too and plan to contribute more frequently. I just need to get into the project.

Lastly as i was using this project just now and realized the How to use instructions could be simpler ;), so i thought id give something back immediatly. So here are my 2 cents:

Note

Pull Request Description

Small adjustment to the README.md:

  • As an example on how to use the project provide a simpler example using zig fetch
  • Adjust the existing example for adding the module in the build.zig file to have additional information where it belongs and remove the wrap from pub fn build(b: *std.Build) void { for easier copying 😇 (REVERTED).

WDYT?

Enjoy the rest of your weeks everyone 🍿!

Small adjustment to the `README.md`:
* As an example on how to use the project provide a simpler example
  using `zig fetch`
* Adjust the existing example for adding the module in the `build.zig`
  file to have additional information where it belongs and remove the
  wrap from `pub fn build(b: *std.Build) void {` for easier copying.
},
}
```sh
zig fetch --save "git+https://github.com/Arwalk/zig-protobuf#v2.0.0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Amazing <3

```zig
pub fn build(b: *std.Build) !void {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm hesitant to keep this one for context, the snippet "goes inside the build fn"

Copy link
Contributor Author

@42LM 42LM Jan 28, 2025

Choose a reason for hiding this comment

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

No problem :) i will just revert it. I have been overthinking this before, too 😅.

EDIT:
I totally understand where you are coming from @menduz, it is hard to find a good convention for this.

I do not really remember if at first i read it in an article about zig or simply saw it in the zigzap release notes, but i find this to be a good pattern.

So it is either easy to use for people who know the drill and can simply copy and insert, but does not give meaningful context for people who are not that familiar with zig yet

...or it gives additional information to people being not that familiar with the zig build process, but with manually selecting the lines you need to copy over to the build.zig file.

Its the small things haha 🫠

So in the end my conclusion is it is helpful to show pub fn build(b: *std.Build) !void { at this state of zig i guess ;).

Copy link
Owner

Choose a reason for hiding this comment

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

I'm ok with this personally. As stated in #48 we need to make a proper documentation at some point.

@42LM 42LM requested a review from menduz January 30, 2025 18:19
Copy link
Owner

@Arwalk Arwalk left a comment

Choose a reason for hiding this comment

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

Approving, waiting if @menduz has a last opinion to state before merging.

@menduz
Copy link
Collaborator

menduz commented Jan 31, 2025

:shipit:

@Arwalk Arwalk merged commit e25f027 into Arwalk:master Jan 31, 2025
5 checks passed
@42LM 42LM deleted the readme_update_use_zig_fetch branch January 31, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants