« first day (3787 days earlier)      last day (1144 days later) » 

7:53 AM
hey
 
@AnshulJS Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
 
3 hours later…
11:16 AM
@Markus why.. now I'm curious ;3
 
11:36 AM
Hi,@makadev if you are having a free time can you explain the use of
File and Directory Entries API in integration with indexed db and difference between it and file system access API? A help would be much appreciated and my apologies if I am disturbing you. I am having a hard time in browsing through the mdn docs
 
11:50 AM
@RifkyNiyas These are 3-4 different APIs or not? The FS Access API basically only gives you an Open/Save Dialog without the need for <input type="file" />, IndexDB or File/Directory API can be used for storing Blobs (or as Virtual FS). Also it needs to be IndexDB for FF because it doesn't support File/Directory API.
All in all.. bleeding edge stuff I wouldn't touch (except IndexDB). There is also the Quota/Limit problem.. AFAIR IndexDB f.e. doesn't have unlimited Storage.
 
@makadev yah they are. Think I got the first part. does file/directory API is used for saving data just like index db but without limits higher than indexDB?
 
No clue, but since it's a potential security risk when random Apps fill your Disk (typical Denial of Service) I bet there is a limit or at least some sort of permission system where you need to ask the user for access/storage. The MDN Part f.e. says you can mix it with Quota API in Chrome (yay.. another API)
 
Mmm. Now I think I understand
Thank you
Gonna try with indexed db for now since file/directory api is not well supported, when it does and there's a good sources of examples or when i get experience to understand, hoping to use File/directory API
the file/directory api doesnt solve the browser crashing problem when uploading the files right?
 
It should, at least I read that it uses the filesystem to persist the data (so it won't fill up memory). But who knows.. since I never worked with that API I barely know how it works.
If I noticed that correctly you want to make an App for offline/local handling of big amounts of files (Images?). I'd actually go for something else like Electron (or Cordova), Flutter and so on with Native File Access support.
 
12:07 PM
@makadev thats true. I am gonna see if it works in this way else take some time to learn those stuff and modify the app
 
Or at least a virtual filesystem library which handles all the problems. See f.e.: github.com/jvilk/BrowserFS
 
 
1 hour later…
1:21 PM
Non-LAMP stack web development is *really* hard, isn't it?
I've been trying for nearly 5 months now to set up a simple website, using deno on the server side instead of PHP.
It's... anything but intuitive.

A couple of days ago (after months of looking for webhosts which support deno instead of just PHP and Python) I discovered heroku.

Then I discover I should be using the heroku CLI, so I fire up Windows Powershell and I make some progress with that and I download and install deno...

But then I find I should also be using Git (why? no idea) so I then download and install Git...
So I have made some progress, following the instructions on the heroku site itself and following this tutorial: betterprogramming.pub/…
But the app, although now deployed, is still not working and when I run "heroku logs --tail" in PowerShell to even find out why the app crashed, then... PowerShell gives me a huge readout and then also crashes...!
This is all AMAZINGLY difficult.
I'm used to uploading PHP files to a webspace via an FTP Client.
I mean what the damn hell, honestly... why is this all so DIFFICULT?
Nearly 5 months and I still haven't got anything remotely hosted which I can visit using my browser which has deno on the back end.
When I first started using PHP on my back end (late 2009), I had it up and running in 5 MINUTES.
The error I see is:
error: Cannot resolve module "file:///app/stub.ts" from "file:///app/server.ts"
I don't know if that's a Git error or a heroku error
And it's a bit tiresome having to quit PowerShell and start it up again, every time I just want to see an error log...
So... I'm now destroying the app and starting again. I might get there this time.
Does anyone else all find this weird compared to FTP uploading a PHP file?
Or has everyone else been using node.js etc for so long over the last ten years that it just all seems like second nature, now?
 
1:46 PM
@Rounin looks like your app/server.ts imports a app/stubs.ts but can't find it.. that's basically all that error say.. no clue about heroku but if I get it right it simply triggers on git push and deploys the app as described in Procfile right? So first point would be to check if that file exists or not?
Also.. comparing deno with php isn't quite right. PHP has apache-handler / fpm, the hoster typically manages all that so you can upload a file (or run wordpress or whatever). deno seems pretty non-standard/not widely spread so you'll have trouble getting a working setup. Heroku just adds to the mix. Another option would be to get a VPS/VServer/RootServer and run deno yourself.. but that means managing versions and all.
 
Thanks @makadev :D
I've made some more progress (I'v gone back to the start and re-started three times now... hehehe)
Now I've got as far as the CLI telling me that the "Build succeeded" - which sounds really promising and it's definitely the furthest I've got so far.
But... I've got nothing going on in the background on the herokuapp.com website...
Just a blank screen...
 
Did you check with your browsers inspector tool, might be simply a js error?
uhm
actually.. I have no clue what you try to deploy so..
 
I checked with the inspector, yep. There is literally nothing there.
But, you know, at least I've succeeded a little bit further.
I might come back tomorrow and see what more I can do.
Discovering heroku this week is already huge.
and discovering oak this morning is a bonus.
 
2:01 PM
Might be good to check out devcenter.heroku.com/articles/procfile
 
Literally ALL i want to do is write deno instead of PHP
Thanks, I will check that out. :D
Thanks for being there and being supportive. :D
 
looks like it also describes some commands like heroku ps for checking whats going on on your instance
 
I wish PowerShell would stop crashing. I can't be bothered to start it up again, so I'm going to leave it and go and play Tomb Raider from 1996 on DOSBox.
Thanks for all your help!
 
hf lol
 
:D
 
2:07 PM
btw, if you have a recent Windows you could also try WSL and use the linux heroku cli, might not crash (as much)
and for your heroku deno app: ms314006.github.io/deploy-your-deno-apps-to-heroku looks pretty simple, maybe you need to set correct net/port mapping as shown in that hello world?
aaanywayy.. gaming sounds great.. guess I'll start something up too + coffee.. laters
 
 
2 hours later…
4:28 PM
Hi, I think I might have solved the crashing issue of browser. I mean I might have. Here is a gist to my code gist.github.com/MohammadRifky/be70e121550d010c6c2f5abe17c1fa4a
I started using file system access api and the browser doesn't crash as soon as the files are uploaded like before... I was able to iterate upto the last image in the folder (6000+) and make a file object like that of in filelist
When I am trying to scan the text through the tesseract.js it was fine for one single file but when i tried for that in 6000 ones the browser just scanned few images and ended up showing aw....snap error
Any recommended way to solve it? Should I be using any data structures or algorithms for this purpose? I am afraid I have zero knowledge in that :(
 
 
1 hour later…
5:45 PM
@RifkyNiyas Dunno.. I'd say "check memory usage" but if I see that right tesseract.js uses an emscripten ported library as wasm, which should have a fixed memory model but maybe it's leaking somewhere else. Anyway, if it's chrome this might help: superuser.com/questions/607563/…
 
 
1 hour later…
6:48 PM
You can get surprisingly far on free tier google cloud by increasing the swap space.
 
7:11 PM
That's actuallly good to know JBis
 
@BiOS Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
Great poin
 
 
1 hour later…
8:20 PM
@makadev online?
 
@Markus ye
 
ok... so I have a github project. it's private now but I can make it public
 
makes sense
 
what makes sense?
 
8:36 PM
const ui = content.variables.map((t) => Test(t)) will be executed always
and as props for dashboard lead to a rerender
i guess
 
mm, and if I run the callback, well then the callback function doesn't change yes?
and also if running ui-no-callback-but-works the const Ui = (...)... only gets executed when on startup?
 
@Markus it has another input
afair function components behave much like pure components, if the input (props) not change, it is not executed at all
the other part comes from the diff algorithm
meaning if content.variables changes, they should all rerender
 
ahaa
 
and const arrayCopy = content.variables.map(item => item); Ui(arrayCopy); always changes the input^^
 
but... is there a difference if I create a const arrayCopy, of if I just input the map as argument?
 
8:48 PM
that shouldn't be a difference
 
I really don't see the difference between ui and ui-no-callback...
 
you mean the one with and without useCallback?
 
no, in the switch (in creator)
 
are we talking about the same? return () => Ui(content.variables); versus const ui = content.variables.map((t) => Test(t)); return () => Ui(ui);?
 
yes (but return () => Dashboard(...) in the end)
const ui = content.variables.map((t) => Test(t)); return () => Dashboard(ui); vs return () => Dashboard(content.variables.map((t) => Test(t))); I would expect to be the same thing... but apparently not.
 
9:00 PM
thats not what you have there
 
well I just tested it and it works if I have the later version.
 
btw. why do you write it all in function style and not JSX?
 
like <Dashboard params={params}/> or similar?
 
ye
 
Because I'm a noob (at js) so I didn't really know how :)
I don't really know how to write the const Dashboard = ... in that case
 
9:06 PM
const Dashboard({ui}) => <div>{ui}</div>;
and then you can use it in JSX: <Dashboard ui={...} />
 
I worked with react like two years ago, but then we wrote everything in classes :)
 
ye, ReactJS 16.x was a pretty big change with the stabilization of function components and hooks and stuff
took me a while too to switch from classes.. but you'll get used to it very fast since it's much shorter and so on..
 
Yes I think it's rather nice actually, but it seems like I don't understand exactly what I'm doing :)
But! I guess that you haven't started the project?
because... let's say that we understand why it works with the two latter solutions. The worst thing is that you can see that I have removed parts from the recip. well if I add them, then I have one solution per route. but none of them work!
 
I'm still searching the reactjs documentation.. but I can't find it anymore
they had a matrix once with comparision between React.Component, React.PureComponent and function component
that was actually pretty helpful for me, coming from classes
 
if I remove the ui then both the other two works... so it really doesn't like the const thing!
 
9:21 PM
do react-devtools still exists?
might be a way to inspect exactly what is going on
 
never used..
not true... I apparently have it installed :)
 
well.. it's not really useful except for seeing what components are currently rendered and how deep your component tree currently is (+ passed props)
 
9:59 PM
so basically what I have concluded is that const a = () => 1; return test(a); is not the same as return test(() => 1); I don't get why though...
 
it looks wrong.. too^^
 
which one?
 
I mean that conclusion, it's semantically the same statement
 
exactly what I thought. Maybe it's babel that does something strange...
 
magic, karma, alignment of planets?
or better said, I doubt that babel does something different for those two, it would break much more code
 
10:14 PM
mm, had a look at the code, and babel doesn't seem to do anything...
well well...
thanks for showing interest, now it's time for something else.
 
ye, for me too
cya^
 
10:32 PM
Has anyone heard of or used strapi.io?
 

« first day (3787 days earlier)      last day (1144 days later) »