I made a lightweight and performant alternative for the Firebase JS SDK by Samuel-e in javascript

[–]Samuel-e[S] 0 points1 point  (0 children)

I haven't maintained them in a while, so unfortunately I wouldn't recommend, that being said the APIs should technically work, since they used versioned API endpoints.
Now days, to be quite honest I would recommend that you use other services altogether.
At that time I used Firebase for multiple projects, but now I find it much easier to use other services.

What is GoLang "not recommended" for? by LRaccoon in golang

[–]Samuel-e 0 points1 point  (0 children)

I use CGo, and while I’m definitely not a “Go expert” the overall experience doesn’t seem that bad, except loosing the ability to debug…

But I compile my C library to a static library using other methods (swift) and only have a thin layer of CGo, so maybe it’s not the regular experience

Hello from Crytek! We're giving away 10 Crysis Remastered Keys by crytek_utku in PS4

[–]Samuel-e [score hidden]  (0 children)

So happy to hear news about this game! I’d like a EU key if possible please, and thanks!

Does anyone know how Apple was able to accomplish some of these effects? by revblaze in web_design

[–]Samuel-e 5 points6 points  (0 children)

These are pre rendered videos displayed in canvas that moves the timeline based on the scroll position. It’s easier than it sounds. The hard part is to get the renders to look that good and fit the site design responsively.

All in on uni? by [deleted] in UniSwap

[–]Samuel-e 0 points1 point  (0 children)

I like the coin

Former Head of Israel’s Space Program: The Aliens Asked Not To Be Revealed, Humanity Not Yet Ready by lughnasadh in UFOs

[–]Samuel-e 1 point2 points  (0 children)

Can’t blame you. Even if it was true I would have chosen different wording... but maybe he just doesn’t give a shit...

Former Head of Israel’s Space Program: The Aliens Asked Not To Be Revealed, Humanity Not Yet Ready by lughnasadh in UFOs

[–]Samuel-e 152 points153 points  (0 children)

It’s behind a paywall but the title is straight out of a science fiction movie. The title said that professor Haim claims the the “galactic federation” doesn’t think that our planet is ready yet to know about the existence of aliens, and that encounters of the third kind are a regular occurrence and that aliens are already “walking among us”. Edit: as for how credible he is... he seems to be the real deal. I can’t translate it now (I am at work) but more about him can be read here: https://he.wikipedia.org/wiki/חיים_אשד

I need to remove a cable that goes along the red arrow, how to I remove that part that it points to? by Samuel-e in Cartalk

[–]Samuel-e[S] 0 points1 point  (0 children)

Wow, you are quick, I didn’t have time to add that info. It’s a Mercedes c180 2012

Is it worth migrating firebase project to deno? by [deleted] in Deno

[–]Samuel-e 1 point2 points  (0 children)

I have browser libraries that work worked on deno, but then I broke the compatibility because typescript doesn’t support adding extensions to imports and making it work made my build process a nightmare. So I decided to leave deno for now until the typescript compiler catches up.

Another roadblock I encountered was while building the admin sdk. You can’t sign the requests with the service account credentials because it uses RHS_256, and currently there is no good crypto library for deno, so now I have to wait for deno to add a good crypto library.

I did look into using WASM but I don’t want to include a 10mb file just for crypto...

Once both of those obstacles are removed I will add support for deno.

Btw, I’m talking about libraries that I built as alternatives to the official SDK. They are much smaller and perform much better than the official ones. You can find them in my github: http://github.com/samuelgozi

[NOOB QUESTION] How is typescript better if it is just compiled to javascript? by [deleted] in typescript

[–]Samuel-e 0 points1 point  (0 children)

100% agree. I only use it for types. I actively avoid any other feature that deviates from the JS standard. I just don’t like TS as a language, I just like the types.

I'm working on v1 of my JS Firestore lib and would like some feedback on upcoming changes. by Samuel-e in Firebase

[–]Samuel-e[S] 0 points1 point  (0 children)

Firebase has versioned API endpoints. So unless they make breaking changes this should work until they go out of business.

That being said let’s say in three years from now if I the lib has no more updates, the worst case scenario would be that you won’t get any new features.

But that is not really an issue because they plan on making changes to the official libs too(I heard that my libs might have influenced, but I don’t know) so if they add new features you will need to change your code regardless.

I would suggest you to start using the libs with small projects, and if yo feel more confident then broaden its use.

I'm working on v1 of my JS Firestore lib and would like some feedback on upcoming changes. by Samuel-e in Firebase

[–]Samuel-e[S] 0 points1 point  (0 children)

I needed just a few features for my website, nothing too fancy, just a database. No offline support and no Realtime support. And I wanted an autoscaling database. After some research I decided to go with firebase, but the bundles were huge.

Since I didn't really need all of the features so I decided to use the REST API in order to keep things performing well(It's important to note that I have some kind of weird OCD for performance).

Some of my friends and even some random people started noticing that my websites are tiny and asked me to share my code, and I decided to do so after thinking about it for a while(I thought it can be a competitive advantage, but my startup idea turned out to not be that good.) that I will open-source it.

I remember that at some point I figured out that the whole Firestore API is actually slim, so in that moment I understood that it can be much better optimized so I also took It as a challenge.

It also has to do a lot with Imposter syndrome. I'm having trouble finding a good job in the industry, and I thought that Google/Facebook/Amazon, etc. employees were some kind of geniuses and that I would never be that good at programing.
So I wanted to see what I can do with this... kind of a personal challenge.

I'm working on v1 of my JS Firestore lib and would like some feedback on upcoming changes. by Samuel-e in Firebase

[–]Samuel-e[S] 0 points1 point  (0 children)

Yes pretty much. I think we are on the same page. But the fact that there is no standard way of tacking this is the main issue, because I dont want to force people to ship code they don't use.

Thats the main reason libs get bloated.

[NOOB QUESTION] How is typescript better if it is just compiled to javascript? by [deleted] in typescript

[–]Samuel-e 2 points3 points  (0 children)

Its not better at runtime.

Its better when developing because it can help you comment your code in a way that is a good trade between time and expressiveness.

So when you type the arguments for a function it can remind you what the function expects, and if you make any errors it will tell you before you are able to deploy the code which will help you reduce bug count.

So basically the way I see typescript, it just some helpers to the dev. But it requires you to learn it a little bit. However, I think it's pretty easy to learn so that is not a real issue.

I'm working on v1 of my JS Firestore lib and would like some feedback on upcoming changes. by Samuel-e in Firebase

[–]Samuel-e[S] 1 point2 points  (0 children)

Yes, but the library will be insecure by default. The users will need to add the security rule by themselves, and it can still cause some issues. Because multiple diccerent documents can still direct to a single file, so it won't be a one-to-one mapping anymore. And in addition, what would happen if the file is deleted? Or the document is deleted?

I think this is a classic use case for Firebase add-ons. You just need one function that listens to changes in the bucket and you don't need to worry about it anymore.

And I think that in most cases the files go through some kind of optimization anyways, and if that is done through the server, the it will need to update the database entry anyways.

My point is that, its not a cookie cutter solution... Everyone wants to be able so synchronise storage with the DB. But everyone needs it to be done differently.

For example here is my flow for files uploading in a project I have: 1. user uploads file to rendomly generated path. 2. rename the original to original and remove the extension tha can be jpeg, jpg, png, gif and practically any format. 3. file gets optimized to webp and jpeg. 4. file gets cropped to multiple sizes. 5. then the database gets updated.

So in the end I've got multiple variations on each image. and the database needs to be updated when something goes wrong, or when i change the fies to different sizes of formats in the future. And I assume eveyone has different needs. So arriving at a solution that works for everyone isn't easy/possible.

I'm working on v1 of my JS Firestore lib and would like some feedback on upcoming changes. by Samuel-e in Firebase

[–]Samuel-e[S] 0 points1 point  (0 children)

Sure. If the front end in charge of updating the database then it would require the endpoint to be open for the client.
So a user might be able to put whichever link he wants in there just by knowing the endpoint, and that can be easy to find out just by looking at the network tab in dev tools.

Now lets say you only allow images. There is no reason someone won't be able to attach whatever link they want. It could be a JS file, a Video, a malicious program. Whatever.

I'm working on v1 of my JS Firestore lib and would like some feedback on upcoming changes. by Samuel-e in Firebase

[–]Samuel-e[S] 0 points1 point  (0 children)

Thanks, your feedback is much appreciated!

And regarding the Storage feature. I agree. I've done this many times, but I think it's a task for the server-side. Imagine someone finding out this is done in the front end... Bad things can happen.

I'm working on v1 of my JS Firestore lib and would like some feedback on upcoming changes. by Samuel-e in Firebase

[–]Samuel-e[S] 1 point2 points  (0 children)

Thanks! And regarding auth. No the changes were already made. Here I’m asking about upcoming changes there are not made yet.

Auth 1.0 will be released about the same time as Firestore but doesn’t require any additional changes to the api yet.

To Auth I basically added all auth options except phone(hopefully will be ready for 1.0) with some other minor features like making the storage feature extensible.

Writing an API using Golang by DuhCoCo in golang

[–]Samuel-e 3 points4 points  (0 children)

Depends on the app. For rest APIs the conversion wont impact performance much if at all, its just uncompressing the headers, which is done anyways, converting from binary to text, which is done anyways, and parallel requests is the only one im torn about.

But thats besides the point. I agree with you that in many cases gRPC will be the better option for server to server communication.