Back
akshay kadam (a2k)
Load previous page…

Checkout there.pm. Its Electron & ~68MB.
Source: github.com/therepm/there-desk…
I think I have made my point 😂

Are there some resources on optimizing Electron build size? I remember I first saw electron builds at ~50MB when trying out webtorrent but I wasn't able to reach that size myself.

Try & build a Hello World app. Its like ~40-45MB which I don't remember but I built it. Some of my simple examples can be found here, here & here & I think it was very less in size.

I made a short blog a year or so ago about reducing size. If you know React/Preact I have a ready made boilerplate with Webpack Support I just created.

If you're getting a size like Pugson says then you're obviously doing something wrong with your code. You can find a nice list of resources at awesome-electron & if you don't know anything about Electron & as the docs suck then get started here.

If you still don't get the size reduced take a look at VSCode & Atom, its like 70MB with so much stuff.

Also, take a look at Electron Builder & if you still aren't getting any size reduction then show me the code. I'll take a look.

Oh okk. I don't think it will help for what I am trying to do. What you are saying is like running code on a site which is dynamic. I think I have to make a different server for payment processing & I can send AJAX requests from the Gatsby site. I'll build a prototype to test this idea. It makes sense.

Wow thanks man. I hope it works. But I need some server for processing Payments, right?

I read it & it means I can have an API which will result in requests/response cycle.

But my use case is I have an /apps route containing all my apps. Lets suppose I have a MarkdownViewer.dmg that I want to show only after Payment is done.

If I make this Client only with Gatsby it will show the url at which MarkdownViewer.dmg is stored in HTML which will cause people to download without paying. From what you are saying will this work with Gatsby ?

And mind you I have seen big companies like Egghead doing it. I found that security issue when they stored all their videos URLs in Redux & I was easily able to download it without a lot of security knowledge.

What I'm referring to is just about the routing (part static, part dynamic). I think that who can access which route doesn't have anything to do with Gatsby – you should handle that yourself.

Oh okk. I don't think it will help for what I am trying to do. What you are saying is like running code on a site which is dynamic. I think I have to make a different server for payment processing & I can send AJAX requests from the Gatsby site. I'll build a prototype to test this idea. It makes sense.

Well I have worked with Socket.io & its really not that difficult. It uses IPC (Inter Process Communication) & the API is very easy to use.
I made a simple chatroom 2 years ago. Code is Open Source & you can find it at github.com/deadcoder0904/chat… & the demo can be found on chatroom-0904.herokuapp.com

Obviously Isaac is right nobody will use your site if you want to keep your users refreshing. If its just Text chat use Socket.io & if its Video Chat then use P2P. Made that too but its closed source & its difficult to make it working. So I guess you should only use Text Chat for now.

You could watch these videos if its any help Net Ninja & Traversy Media

thanks Akshay! Yeha, I've already watched Net Ninja and Traversy :)

I'll try to make it first. I'm overthinking a lot. If it crashes, then I might change the process or I'll ping you then for advice. For now, I'll be making my /blog route a static page running Gatsby & /apps will contain all my apps. The problem is I don't want to buy 100 domains if I make that many one-of apps. So I'm making one /apps route which will incorporate all my apps each serving a different dynamic page. Lets see how this goes.

Yeah the problem is even if I still serve the static page it will crash my server if traffic is large. Bcz I will be using a server on my domain & from there it will serve a static & a dynamic page but still I need a server. And as Jesper said, it will affect the server but let's see I'm gonna make that shit first. Overthinking is bad & its my favourite habit 😂

Nope I actually made apps with it. Hello World is ~45MB or so. Bdw you should check VSCode size. Its 65MB for MAC & less for Windows & Linux & its a full blown editor.

Thanks didn't knew that. Follow up question. Won't my server get loaded with all my HN traffic on the static page because in turn it runs on an Express Server ?

I setup Express Server & have 2 routes /static & /dynamic & my /static route just serves static pages but it would still crash my server down if many people visit on my site (/static route), right ?

What I want is if many people are on my /blog page it shouldn't affect my server because all my pages are static & it should only get affected if lot of people are on my /apps page.

Your server IS affected. But static routes can be cached, and traffic to a server cache can be freaking huge before it affects you. Also, you can get cloud flare or some other external service to handle that cache, and they can handle Super Bowl amounts of traffic.

Even with HN traffic, you'll be lucky to get shot down. I've run my product (www.blankpage.io) on the smallest Heroku dynamo running Expressjs and I've never been shot down. Despite being first on product hunt etc.

I'll try to make it first. I'm overthinking a lot. If it crashes, then I might change the process or I'll ping you then for advice. For now, I'll be making my /blog route a static page running Gatsby & /apps will contain all my apps. The problem is I don't want to buy 100 domains if I make that many one-of apps. So I'm making one /apps route which will incorporate all my apps each serving a different dynamic page. Lets see how this goes.

Will it work for subdomains too? Like blog.a2k.com or will it only work for a2k.com/blog ?

Subdomains and subdirectories are very different things. A subdomain (blog.a2k.com) doesn't need to be on the same server as the root domain (a2k.com). Whereas a subdirectory does. This means that if you're serving something different from a subdomain, it's a lot easier to set up. BUT, subdomains count as separate domains for SEO. So blog.a2k.com is as useful for a2k.com ranking as random2k.com would be.

Thanks didn't knew that. Follow up question. Won't my server get loaded with all my HN traffic on the static page because in turn it runs on an Express Server ?

I setup Express Server & have 2 routes /static & /dynamic & my /static route just serves static pages but it would still crash my server down if many people visit on my site (/static route), right ?

What I want is if many people are on my /blog page it shouldn't affect my server because all my pages are static & it should only get affected if lot of people are on my /apps page.

Your server IS affected. But static routes can be cached, and traffic to a server cache can be freaking huge before it affects you. Also, you can get cloud flare or some other external service to handle that cache, and they can handle Super Bowl amounts of traffic.

Even with HN traffic, you'll be lucky to get shot down. I've run my product (www.blankpage.io) on the smallest Heroku dynamo running Expressjs and I've never been shot down. Despite being first on product hunt etc.

I'll try to make it first. I'm overthinking a lot. If it crashes, then I might change the process or I'll ping you then for advice. For now, I'll be making my /blog route a static page running Gatsby & /apps will contain all my apps. The problem is I don't want to buy 100 domains if I make that many one-of apps. So I'm making one /apps route which will incorporate all my apps each serving a different dynamic page. Lets see how this goes.

There is one problem though. Not a lot of APIs & lower level stuff like Electron provides. Read it somewhere.

I did try to get started with it but the nwjs binary is itself 180 MB (on mac). Looking at the docs for packaging an NW project, it seems to suggest that I will have to bundle the nwjs executable (180mb) with the project too. I don't see how it is going to be 6-7 MBs that way. Am I missing something?

Personally I don't know how to do it. But yes it is 6-7MBs. There is a video by Egghead but it is paid so if you already have a subscription you can watch it. You can check the companies using NWJS here which will give you an idea about size but it is less than Electron. Messenger which uses NWJS is 1.5MB. Checkout awesome-nwjs that might help you. I never used it so can't say about that.

Home
Search
Messages
Notifications
More