Comments (13)
I think it would be nice to have a template repo for creating a Zap application, many other backend projects has the same thing.
![vibe](https://private-user-images.githubusercontent.com/51555391/259145754-d0379882-f2dc-42e1-962f-b3f122db656f.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIzMDM0MjcsIm5iZiI6MTcyMjMwMzEyNywicGF0aCI6Ii81MTU1NTM5MS8yNTkxNDU3NTQtZDAzNzk4ODItZjJkYy00MmUxLTk2MmYtYjNmMTIyZGI2NTZmLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzMwVDAxMzIwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk2NDdiN2E4NWU1YTI4YzBjNmYwZGM0NDUzYWMxYzk4NWFkNzVmYTk2MTEzZjY5NmFkOTZjNDI2MzA3NGU1NWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.rAdYDc1lQWRIANgOn4rTFTo__dM-doqsfhuHBYomxx4)
from zap.
Please make a more concrete suggestion. Zig creates the build.zig for you, you only have to paste in 2 lines.
To be honest, I am thinking that if that's too much hassle, one is probably better off trying something else.
DX 🤣: "I want to dev but put ZERO effort into it"
Where would we even put the extra file and how should people looking for "DX" find it? Plus, they'd need the zon file, too. I might be stupid but if I even parse you correctly, what I think you want doesn't sound thought through well.
I value my time, too. Maybe the best way forward is you submit a PR.
from zap.
What do you mean by pushing to main repo branch? That doesn't make sense to me.
To be git-clonable, the "starter project" should be its own repo, e.g.: zigzap/hello
.
I would clean up your template:
- explain what it actually does (e.g. when it runs)
- since it also serves a public folder, this folder should exist and contain at least something.
- it should be made clear that the public folder content takes precedence over the callback (avoid surprises!)
- it should start with only one worker or else people will shoot themselves in the foot trying to share state
- remove the stupid test
- at least mention
zig build run
None of the above is hard. Creating such a starter template probably takes only a few minutes.
The more complicated part is: keeping it up-to-date with zap releases (build.zig.zon). Can that be done easily, ideally in a GH action when rolling a release? I guess the easiest option is to have a daily GH workflow that clones zap master, checks for zon changes in the README of zap, and commits a zon update to the starter. Then a second GH workflow that checks if it still builds with the latest zon update - so I get at least notified when the starter gets broken by a zap release.
Instead of parsing the README, I could also update zap's release workflow to update a json file that can easily be curled from the starter template workflow.
I don't have time ATM but that's what I'm thinking about.
from zap.
for now maybe https://github.com/zigzap/hello-world will do
from zap.
Did you read the README?
There is a build.zig.zon and an example for what to do in your build.zig, after you have run zig init-exe.
I want to close but maybe I don't get your question. If so, please elaborate in full sentences.
from zap.
Yeah yeeah there is man.. but it the reaadme is too much so that might not be cool on dx side.. thats why no worries man ;)
from zap.
hmm.. you got a point but the reason i raised is because of i just told my friend about this means zap for building web servers yeah but i really send the link to this github repo and he was confused to where it starts thats why i guess it needs a prior xp on setting up stuff for local dev and playing around with sys lang makes the hassle little bit less :) .... personally does not have a problem but he was kind of heck confused to start off but yeah what i suggested to paste the code from build.zig or build.zon.zig. .. You are absolutely correct but people get reffered to this might be interested on some mini things that they could narrow there scope like just fork and get to the point.. idk but for me it is fine .
from zap.
Aaaaah, got you! Maybe point your friend further down in the readme: https://github.com/zigzap/zap#getting-started
Further down it shows how to create a zig project and add zap in easy steps.
The only easier alternative I can think of is creating a sample project that others can just fork. Updating that for every release is a bit of extra work. I have one for zig master, so yeah, maybe making an official one and linking to it in a prominent place would help.
from zap.
yep man that is what i am saying... you got me...that would be too nice
from zap.
@renerocksai If you want zap starter template for custom or from scratch projects you can use my template here - https://github.com/Kinfe123/zap-zig-starter
from zap.
@renerocksai shall i contribute this on main branch the above starter ... which can pushed on to branch
from zap.
yeah i am basing my thought based on the templating stuff that mention and yeah it was also thinking syncing up using GH that can checkout to the master ..
from zap.
yeah got you on the clean up .. since i am introducing it to the public i just get the fresh copy of zig init and start adding necessary files to make sure it works but as you said it needs really a clean up that to make sure it actually makes sense
from zap.
Related Issues (20)
- Build error HOT 2
- Deprecated LazyPath breaks with Zig master HOT 1
- Connect database HOT 1
- TLS + Multiple threads will crash the process randomly HOT 2
- Performance result looks wierd for c++ HOT 2
- Zig 0.13 build error HOT 7
- Framework not starting HOT 1
- Cannot build Zap HOT 1
- getHeader is not working HOT 15
- How to implement OpenAPI docs for the backend? HOT 2
- Middleware not respecting Endpoint's `path` setting HOT 3
- TODO: make Router more strict wrt types of handler functions
- Zap won't compile on Microsoft Windows. HOT 2
- Failure to compile facil.io : unable to build C object: clang exited with code 1 HOT 2
- RequestHandler doesn't work with multiple invocations where self is the same type HOT 3
- hot-code reloading or swapping HOT 1
- Segfault after 60 seconds of inactivity HOT 12
- Add examples/tests for getHeaderCommon
- Maximum number of concurrent requests per Zap process HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zap.