Cheen posted:Isn't passport supposed to be creating a cookie for me? I have serializeUser and deserializeUser on my backend, and I know that serializeUser is getting called when I login. Usually you'd ensure persistence of login via a session. Passport does do this automatically, but you need to configure it to play nice with whatever other frameworks you've got messing with the session. See step 3 here: http://www.passportjs.org/docs/configure/
|
|
# ¿ Apr 14, 2019 21:33 |
|
|
# ¿ May 15, 2024 11:32 |
Nakedyoghurt posted:I'm trying to create a webscraper that fetches my hand history from a poker web app, using the selenium module with python. I'm passing js code to the selenium module to execute, but im getting kind of stuck. I don't see any event handlers on either of those elements so it seems to me that whatever javascript is causing mouse clicks to trigger date changes is hidden somewhere else. Maybe have a look in their script code?
|
|
# ¿ May 3, 2019 09:22 |
ulmont posted:What is the current hotness in IDE for javascript? I've been bumbling through on my toy projects with emacs and the chrome console, but I think at some point I may want to upgrade a bit. Vscode.
|
|
# ¿ May 7, 2019 17:39 |
I'd suggest assessing the outcome of your different ideas using something like http://jsben.ch/ and then coming back to check if someone has a better idea than your best one, rather than frontloading the question like this. You should know by now that your way of doing things is always going to be weird to the rest of us so it's unlikely we'll have something ready off the shelf for you.
|
|
# ¿ May 20, 2019 09:48 |
LifeLynx posted:That might not work because this is in a mapped array with sometimes dozens of images, and that won't work unless each has its own unique useState, right? Jsfiddle or glitch.io are common places to put demo code, or github.io if you want it more associated with you.
|
|
# ¿ May 28, 2019 22:12 |
Ola posted:I'm new to development, and I've got a job making a web app this summer (it might be mobile apps, but think it'll be web so far) and have some framework questions. Basically, do I need any? The user will be entering some data, some simple calculation from a static model will be output on the screen and saved to local storage, with the option of saving to JSON or Excel. So far I've figured I need to import some CSS templates since I suck at CSS, and an Excel library. Otherwise I think I can write everything myself, but should I? One relevant reason I can think of is it's nice to have a framework to namecheck on my CV. To be honest, the answer to this question is: do you want to learn a framework? If not, vanilla JS should get you there no problem. CV-wise, to be honest I would be more likely to hire someone who's skeptical of frameworks and has taken the time to figure out what actual JS can do than someone with a buzzword CV, but that's just me.
|
|
# ¿ Jun 5, 2019 08:23 |
Alternatively, just use separate repos for your submodules and then use yarn/npm link to do symlinked development without having to push all the time?
|
|
# ¿ Jul 18, 2019 17:26 |
charray
|
|
# ¿ Sep 25, 2019 11:12 |
Cheen posted:I'm tackling as my next ticket a refactor of an angular component. It's pretty big, over 1,000 lines, 60 variables are being stored, and a number of functions that I think I could refactor or remove. I'm considering strategies for how to go about this- I've never done a refactor like this before. Is there any reading that anyone would recommend or tips n' tricks for handling this? Move everything that's not directly acting on gui elements into services that you unit test, and then go you can hog wild with refactoring without worrying about breaking poo poo.
|
|
# ¿ Nov 26, 2019 17:29 |
Boris Galerkin posted:Thanks for the advice. No, yarn is superior last i checked. Also I've never heard of a nodejs installation that doesn't come with npm, interesting.
|
|
# ¿ Jan 26, 2020 09:58 |
There's always the option of just using the node-turn part as regular JS? Create your own wrapper interface with some any type overrides if you want to isolate that part from your typed code. I may be missing something though, I'm only getting started with this stuff myself.
|
|
# ¿ Apr 16, 2020 11:46 |
Look into webpack.
|
|
# ¿ Jun 21, 2020 12:22 |
The Fool posted:I don’t have a lot to add to this conversation except that React functional components + hooks + typescript is super pleasant to work with Amen. I love it.
|
|
# ¿ Jun 27, 2020 18:24 |
Sous Videodrome posted:I know this thread is dead, but I wrote a beginner tutorial. It walks you through creating a simple express server that adds meme text to images. The tutorial also shows how to host the app on heroku Very nice work. I feel like you pass a bit too quickly over some concepts like async/await which can be confusing, but it's a great jumping-off point for people to go learn about such things from. It reads a bit like something written by someone who's gotten far enough into a subject that they've forgotten what was initally difficult for them, if you see what I mean. Somehow discussion of javascript is more diffuse across other threads rather than concentrated here (and mostly consists of disparaging / complaining, often justifiably).
|
|
# ¿ Aug 11, 2020 10:51 |
Boz0r posted:I'm trying to use Microsoft Authentication Library to get an Azure token from a web resource written in typescript in Dynamics 365. These web resources are just embedded js files, and I'm not a javascript dev, so I don't know how to pack an npm package into a single js file. Also, when I copy the *.d.ts files to my project the import paths in those files are wrong. Are you writing your own nodejs application, or are you trying to bundle a web application? Typically if you're copying files around by hand you're doing something unusual, npm or yarn are used to manage dependencies on external code. If you then import from those dependencies it should also automatically grab any type definitions. If you want to bundle a web application into a single js file, the most common approach is to use webpack.
|
|
# ¿ Aug 25, 2020 10:28 |
I ain't helping with no bitcoin
|
|
# ¿ Aug 27, 2020 14:52 |
Roadie posted:node-postgres is dead easy to use for a Node server.
|
|
# ¿ Nov 2, 2020 15:31 |
redreader posted:You're going to laugh and laugh, but I just reversed a string in javascript and it was exactly the same as typescript. So lol, phew. Time to do some more basic-rear end exercises but that's the #1 interview screening question in my experience. Typescript is literally a superset of ES6. They only added type stuff. Don't worry about it. Use babel to transpile to whatever javascript version your platform supports and you're good.
|
|
# ¿ Dec 7, 2020 00:21 |
Chas McGill posted:Any recommendations for a react rich text editor that can export to markdown? Currently looking at Draftail. We've been happy enough with this one https://github.com/jpuri/react-draft-wysiwyg. Looks like both are built on top of draftjs either way.
|
|
# ¿ Jan 12, 2021 16:08 |
LifeLynx posted:Alright, here it is: https://codepen.io/LyfeLynx/pen/ExgdmoM I think it's perfectly functional, but I'd definitely prefer coding and writing a different style where for example the images are not already hardcoded in the html but added from data in code, and where there's fewer globals. I definitely would rather be taking the head off the list of images and adding it to the tail rather than doing index math for example.
|
|
# ¿ Jan 13, 2021 15:17 |
Empress Brosephine posted:is there anyway to access the Dom and do javascript css manipulation with Express/Node? That's frontend js stuff, unless you do all your rendering server side in which case you'd send the state of the page back to the server for every action and get fresh html. Probably more complicated for a small use case than just having some frontend js
|
|
# ¿ Jan 18, 2021 13:16 |
Our approach is: end to end/integration tests against api endpoints, and untested thin handler functions that take the relevant data off requests and pass them to the actual logic functions which are unit tested, and return data which are then put on the responses again by the thin function. Basically mocking requests is making your life more difficult in order to test mostly other people's code (express or whatever) Osmosisch fucked around with this message at 13:14 on Mar 2, 2021 |
|
# ¿ Mar 2, 2021 13:01 |
Dancer posted:Hi goons. It depends a bit on context, but I think the case might be that there actually are dependencies that your useEffect should be relying on. If it's a completely stateless fetch, the current implementation is fine, but it's not all that necessary to fetch it in the component every time, and you might as well provide it from a context higher up. Either way, I found this discussion on the linter rule pretty helpful when thinking about such things: https://github.com/facebook/react/issues/14920#issuecomment-471070149
|
|
# ¿ Mar 16, 2021 16:27 |
Lumpy posted:I don't find it a pain at all. Again, could you provide a specific example of something that is giving you troubles? It's hard to help someone who is railing against vagaries. This follows my experience as well, for what it's worth. Context and hooks + pure components work very well for us.
|
|
# ¿ Apr 6, 2021 14:17 |
So for your layout example, you're saying that's the children need to notify the parent of their rendered size? What's wrong with having them just call a setter provided from the parent context? You can wrap that in a debouncer that aggregates calls if you want to minimize rerenders. Rendered size is a weird part of application state that I'd not really considered part of actual informative state before, interesting.
|
|
# ¿ Apr 6, 2021 14:42 |
Empress Brosephine posted:Yeah weather is an array within an array so that should work. Tbh I would just map over it because that means at some point you're going to run into multiple weather's, so something like' Yeah, just remember to set a key on each li. In general, you can't just plonk any old object into a react jsx with curlies, it needs to be a primitive or an element itself.
|
|
# ¿ Apr 15, 2021 12:46 |
Sab669 posted:Hey dumb question - I just started a job yesterday that uses Angular, which I've never even so much as looked at before yesterday. I'm following along with the shopping cart tutorial on angular.io and on a previous step they had me add:
|
|
# ¿ Jul 7, 2021 13:42 |
Combat Pretzel posted:Regarding React... or rather running a development server. Not sure about the webpack dev server part, but on a live deployment you just make it so each backend route (outside of whatever custom API routes you have) serves the same SPA bundle, and have the react router handle the rest.
|
|
# ¿ Jul 7, 2021 19:04 |
Saoshyant posted:Anyone familiar with Angular? I was trying to help a student working with it and, boy howdy, am I not experienced with this framework enough to figure out what we are doing wrong here. ngOnInit is only ever called once according to the docs. It looks like you're trying to respond to the routing data changing? I'm not quite clear what your desired behaviour is exactly. Please provide a bit more detail about the app structure, and what changes/actions you expect to propagate. Maybe have a look here: https://ultimatecourses.com/blog/exploring-angular-lifecycle-hooks-onchanges
|
|
# ¿ Aug 3, 2021 15:30 |
LifeLynx posted:Alright, I'm trying to do this the React way and not seeing a good way to do it. In the non-React world, I've done things like this: Maybe throw up a fiddle/codepen with the minimal attempt you describe above? In general setting classes and other properties via react isn't an issue, and the hook listed in the package you linked should do what you want.
|
|
# ¿ Aug 5, 2021 16:57 |
Sequelize is by far the most popular ORM, but I'd advise against using it, and instead use a nice query builder like knex so you have control and don't need to learn yet another ORM plus its pitfalls.
|
|
# ¿ Aug 26, 2021 18:41 |
LifeLynx posted:I've been teaching myself Next + Sanity.io, and I'm stuck in a similar place I was last time I tried to work with a data set. I don't know next or sanity, but this code block is missing a return statement, or should not have curly braces around the span.
|
|
# ¿ Aug 29, 2021 20:02 |
Combat Pretzel posted:Help me understand the default theme of Material UI. Is it intentional that none of the components have any padding/margin/spacing by default? You can specify your layout and any padding/spacing with Grid components. If that's overkill, take a look at the spacing properties: https://material-ui.com/system/spacing/
|
|
# ¿ Sep 16, 2021 10:52 |
Kwolok posted:Unfortunately an API is too slow for how frequently we need these calculations done. The front end must be incredibly responsive. If you need a very responsive UI that also does a lot of complex calculations I have to say a python/JS combo is not where I would have gone, but instead opted for something native.
|
|
# ¿ Jan 12, 2022 09:51 |
gbut posted:Speaking of http/2/3, is anyone following the latest Firefox fiasco? Apparently telemetrics are interfering with its http/3 implementation, so you need to disable one or another to get a functioning browser. I was wondering what was going on and blamed it on my ISP the last few days. gently caress so that's what's going on, thanks. Was driving me crazy. Looks like it wasn't telemetrics per se actually https://bugzilla.mozilla.org/show_bug.cgi?id=1749908#c21 Osmosisch fucked around with this message at 15:07 on Jan 13, 2022 |
|
# ¿ Jan 13, 2022 15:03 |
gbut posted:Yeah, seems like telemertics might have just triggered the issue. loving Mozilla. Now I have to look for another browser. Eh, one morning of weird issues until they fixed their poo poo is not sufficient to switch to one of the even more evil browsers.
|
|
# ¿ Jan 14, 2022 00:13 |
echinopsis posted:ok so I am a baby, Just use while(true) if you're just getting the hang of things. Or put a stop condition like pressing escape in the while condition.
|
|
# ¿ Jun 5, 2022 11:49 |
Agreeing that following your progress has been fun! You could look into hosting on glitch, they have a lot of features for free pet projects like this one, up to and including dbs/logins as I understand it. Time to rack up some more notoriety.
|
|
# ¿ Jun 16, 2022 20:56 |
I'm also happy to hop on and help, though I'm on CET. Plenty of time this weekend, or most evenings my time.
|
|
# ¿ Jul 1, 2022 10:56 |
|
|
# ¿ May 15, 2024 11:32 |
Sab669 posted:I wasn't really sure how to define just like an array of arrays, or an array of generic objects. JavaScript code:
|
|
# ¿ Aug 5, 2022 12:01 |