|
Tei posted:Can you make the mouse change to arrow on-hover? I don't quite see how what you want is logically possible: if you move the cursor over the image, you are by definition hovering, so code:
|
# ? Mar 21, 2019 13:37 |
|
|
# ? May 16, 2024 14:57 |
|
Interesting enough the arrow is show when I click the mouse on my iphone. I guess safari is emulating the onhover with a tap.
|
# ? Mar 21, 2019 13:50 |
|
Tei posted:Interesting enough the arrow is show when I click the mouse on my iphone. Yep. Elements with a :hover on them get that state with the first tap so all the CSS based menus work on phones.
|
# ? Mar 21, 2019 14:06 |
|
I'm working on a site that's going to be built with React on the front end driven by MongoDB on the back, but I need some basic CMS functionality (ie. creating/modifying posts, flexible custom fields on those posts, user/account functionality). I'll also likely be using NodeBB for comments on posts – I'd like to offer threading, bookmarking, etc. and haven't found many CMS options that include that sort of functionality out of the box. I'm curious if anyone has a suggestion for the CMS portion? Keystone seems like an option, but I know little about it.
|
# ? Mar 21, 2019 16:21 |
|
kedo posted:I'm working on a site that's going to be built with React on the front end driven by MongoDB on the back, but I need some basic CMS functionality (ie. creating/modifying posts, flexible custom fields on those posts, user/account functionality). I'll also likely be using NodeBB for comments on posts – I'd like to offer threading, bookmarking, etc. and haven't found many CMS options that include that sort of functionality out of the box. What languages would you be comfortable using for the CMS?
|
# ? Mar 21, 2019 16:44 |
|
I'm trying to do as much of it in JS as possible because I'm treating this as a learning opportunity. Right now I use JS purely on the front end, so I'm curious how it feels to use it on the backend as well. PHP would also be fine as the vast majority of my work deals with PHP and WordPress, but I'm trying to move away from that here, if I can.
|
# ? Mar 21, 2019 16:57 |
|
I'm building a React app that I'm currently running locally with a Node server. It's just for learning purposes, so it will never be deployed anywhere. The trouble is that I'm trying to get some data from an open API, but the browser blocks it because no 'Access-Control-Allow-Origin' header is present on the requested resource. I'm guessing this is to block browsers to get the data? Would I be able to access it from some sort of back-end? If so, can I simulate it on my machine?
|
# ? Mar 21, 2019 22:10 |
|
uncle blog posted:I'm building a React app that I'm currently running locally with a Node server. It's just for learning purposes, so it will never be deployed anywhere. The trouble is that I'm trying to get some data from an open API, but the browser blocks it because no 'Access-Control-Allow-Origin' header is present on the requested resource. I'm guessing this is to block browsers to get the data? Would I be able to access it from some sort of back-end? If so, can I simulate it on my machine? Is the blocking happening at your API or the public API you're using? If it's your API, start here: https://expressjs.com/en/resources/middleware/cors.html If it's not, unless I'm misunderstanding, it sounds like a bad API.
|
# ? Mar 21, 2019 23:13 |
|
You could probably use some local proxy to get around the CORS thing, but I don't have any specifics suggestions at hand
|
# ? Mar 21, 2019 23:16 |
|
It's on a public API. So this is not common? I managed to get around it using a proxy, but this feels like cheating. Edit: I can get the data with a CURL request in Terminal, but not with the fetch command in Node.js.
|
# ? Mar 21, 2019 23:22 |
|
CORS is a basic security feature of the browser. Check out the MDN page for a better description than I could give.
|
# ? Mar 21, 2019 23:26 |
|
I understand what it is, and that the API needs headers to allow cross origin requests (like mine are). I just don't understand if this is common on public API's, and if so, how am I supposed to access it?
|
# ? Mar 21, 2019 23:44 |
|
If it's an api that you're supposed to use from your backend instead of directly calling from the user's browser, then they're not going to make it callable from browsers. You'll need to structure your app so that your server makes the calls, and exposes its own api to your React app with the results.
|
# ? Mar 22, 2019 01:40 |
|
Thanks guys. Learned a bunch of new stuff, and even made it work in the end.
|
# ? Mar 22, 2019 15:33 |
|
So after a week of issues I'm off windows and back on my Mac again. I really want Windows dev to work for me and maybe I'm going about it in the wrong way (trying to bring over all my workflows from MacOS) but I was just running into issue after issue: 1. Couldn't find a terminal emulator that did everything I wanted: render utf8/powerline fonts, worked nicely with tmux incl. mouse mode. Tried Hyper, Ubuntu.exe, cmder. 2. zsh kept hanging after command execution. Not all the time, usually ctrl-c a couple times worked, but not always. 3. Ran into issues a couple times where webpack-dev-server would just stop responding at all. Restarting it didn't fix, the only thing that worked was running it again on a new port. So it was like there was a ghost process. 4. Docker seemed to have file permission errors. When I would connect to the app running my Rails server it wasn't outputting anything (normally rails server is noisy as hell) and would frequently not write anything to the log folder. Now and then it would just refuse to start and say it couldn't see the log folder. I dunno if I should give up on running WSL and try installing node etc. directly to Windows. I need Docker to work but the permissions issues might've also been related to being installed/mounted through a windows drive that's also on WSL? It sounds like there's a bunch of you in this thread who have long term web dev experience on Windows, any suggestions?
|
# ? Mar 22, 2019 19:01 |
|
prom candy posted:So after a week of issues I'm off windows and back on my Mac again. I really want Windows dev to work for me and maybe I'm going about it in the wrong way (trying to bring over all my workflows from MacOS) but I was just running into issue after issue: You could use a VM (Virtual Box or VMware) and a shared folder. You could also automate setup and tear down of the VM with Vagrant if you need to have a VM configuration shared.
|
# ? Mar 22, 2019 19:12 |
|
I like things from Windows. At least from Windows 2000, not sure about modern versions. The use of space, snappiness of Windows 2000, the pragmatic rendering of fonts. Windows XP and later versions diluted that by a lot, so I am not sure if is the same OS. They have evolved the OS to be a consumer OS, good to launch Office and do some minor menial work. The average windows user never open a 1MB text file. Is not optimized for us, web developers, more like optimized away from us, to a different set of users. Is okay if you don't find Windows work for your dev time.
|
# ? Mar 22, 2019 19:23 |
|
I've played around with Virtual Machines before, I think at that point I'd rather dual boot to Linux (but I also don't really want to do that because I've never been able to consistently run and enjoy Linux.) I ran Vagrant on my Mac for a while and the shared filesystem thing was a constant source of headaches. Appreciate the suggestion though.
|
# ? Mar 22, 2019 19:35 |
|
bigmandan posted:You could use a VM (Virtual Box or VMware) and a shared folder. You could also automate setup and tear down of the VM with Vagrant if you need to have a VM configuration shared. Docker should work with Virtual Box on Windows with maybe a little configuration legwork. IIRC it worked no problem with HyperV, but a lot of containers didn't or something like that? It's been a few years since I tried. Never tried it with WSL, but it wouldn't surprise me much if the subsystem didn't have great access to virtualization features. e: oh you meant for a desktop dev environment nevermind
|
# ? Mar 22, 2019 19:35 |
|
Use docker for Windows, not Linux docker in wsl
|
# ? Mar 22, 2019 19:42 |
|
prom candy posted:I've played around with Virtual Machines before, I think at that point I'd rather dual boot to Linux (but I also don't really want to do that because I've never been able to consistently run and enjoy Linux.) I ran Vagrant on my Mac for a while and the shared filesystem thing was a constant source of headaches. Appreciate the suggestion though. Majority of the headaches for shared folders in Windows can be eliminated with a few tweaks: - Make sure you can create symlinks - "VBoxManage.exe setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1" - Make sure the user that runs virtual box is allowed to make links (use secpol.msc and look for 'Create symbolic links' under 'User Right's assignment') - Modify LMHOSTS file to speed up access code:
I've been using Virtual Box with shared folders for quite a long time now and with the tweaks above I've rarely run into issues. Disk access can still be a tad sluggish sometimes but not an issue for my dev workflow. I hear the VMware shared folder drivers is faster, but not enough for me to shell out the money for a workstation license.
|
# ? Mar 22, 2019 19:55 |
|
This post is over a year old now but it goes into some detail about how far Windows is coming along. https://char.gd/blog/2017/how-to-set-up-the-perfect-modern-dev-environment-on-windows I'm starting to get more and more interested in switching. Macbooks have been getting absurd in their price to performance ratios, and Windows machines are getting pretty good by comparison. Also the operating system is languishing on mac, it seems like they've developed nothing but iOS for a decade. Sooner or later they're probably going to replace macOS with iOS.
|
# ? Mar 22, 2019 22:59 |
|
prom candy posted:So after a week of issues I'm off windows and back on my Mac again. I really want Windows dev to work for me and maybe I'm going about it in the wrong way (trying to bring over all my workflows from MacOS) but I was just running into issue after issue: I use mouse in tmux and use powerline fonts in cmdr. I didn't do anything special for this other than follow the cmdr wiki to install the powerline stuff, so I don't know how to help you on this. prom candy posted:2. zsh kept hanging after command execution. Not all the time, usually ctrl-c a couple times worked, but not always. I guess this was in WSL? I can't say anything about zsh, but I don't have any problem with this in bash/WSL. prom candy posted:3. Ran into issues a couple times where webpack-dev-server would just stop responding at all. Restarting it didn't fix, the only thing that worked was running it again on a new port. So it was like there was a ghost process. I haven't encountered this. prom candy posted:4. Docker seemed to have file permission errors. When I would connect to the app running my Rails server it wasn't outputting anything (normally rails server is noisy as hell) and would frequently not write anything to the log folder. Now and then it would just refuse to start and say it couldn't see the log folder. Yeah, this isn't normal. prom candy posted:I dunno if I should give up on running WSL and try installing node etc. directly to Windows. I need Docker to work but the permissions issues might've also been related to being installed/mounted through a windows drive that's also on WSL? It sounds like there's a bunch of you in this thread who have long term web dev experience on Windows, any suggestions? Yes, my suggestion is don't use WSL unless you really need it for something (for one thing, WSL is slower than not-WSL for different tasks. It's getting better as they keep working on it...). To do web dev work on Windows you have to just install the stuff. Install node the windows way, install docker the windows way, etc. Another thing is that you should get used to powershell. It's pretty good (and also bad...like all shells).
|
# ? Mar 23, 2019 20:43 |
|
Thanks for all the suggestions. I think some of the issues must just be from copying my dotfiles repo that I've only ever used on Mac and probably causing poo poo not to work so I think I might blow that away and try installing windows packages like you said instead of trying to do everything in WSL land. What's your typical workflow Thermopyle? When do you use Powershell and when do you use bash?
|
# ? Mar 25, 2019 14:21 |
|
prom candy posted:Thanks for all the suggestions. I think some of the issues must just be from copying my dotfiles repo that I've only ever used on Mac and probably causing poo poo not to work so I think I might blow that away and try installing windows packages like you said instead of trying to do everything in WSL land. What's your typical workflow Thermopyle? When do you use Powershell and when do you use bash?
Bash/WSL doesn't really enter into my typical workflow. I only use it when I come across something like a bash script that I want to run. Basically, it all works just like it did when I was running Ubuntu instead of Windows except I use powershell instead of bash.
|
# ? Mar 25, 2019 17:27 |
|
The only time I'm using bash in windows is when I need to manually run certbot, practically everything else I need is from node or python and runs just fine in windows.
|
# ? Mar 25, 2019 17:44 |
|
Okay cool, I'm going to give that set up a try when I have some more time to mess around with it. Thanks and sorry for hijacking the thread all weekend
|
# ? Mar 25, 2019 17:58 |
|
I’m looking to play around with making static sites in Node; is there any package in particular that stands out? I tried some stuff with Metalsmith which doesn’t seem very robust but it looks easy to hack and customize, which I like. I also recently learned about Eleventy, but I haven’t tried yet. I don’t want to use React or any other framework like that.
|
# ? Mar 29, 2019 23:51 |
|
Gatsby is super popular, but uses React. Maybe Hugo? https://gohugo.io/
|
# ? Mar 29, 2019 23:55 |
|
Why not just html if it's static. If it's semi static what about rendering out some mustache using restify or express.
|
# ? Mar 30, 2019 03:29 |
|
So I ended up trying out Tailwind on a simple little app we were extracting from our main project. No idea how well it would scale on a huge product but man does it ever make building components fast. Not having to jump back and forth between CSS and markup, or come up with a name for every stupid little element that needs some styling is really nice.
|
# ? Apr 1, 2019 15:04 |
|
every day is a constant struggle to resist spending hours rewriting/reorganizing stuff while I should be working on new features. today I am reorganizing all of my styled components directory and import/export structure how about you.
|
# ? Apr 1, 2019 20:25 |
|
My company calls for 25% refactor time so while we're writing new features, we keep in mind the code that annoys us most and that gets queued for refactoring next. Good way to balance feature work and tech debt. We're refactoring our main React app file which reached almost 500 lines. Got it down to 60 lines and have a nice tree structure of its dependencies nested underneath it. Feels good.
|
# ? Apr 1, 2019 23:10 |
|
huhu posted:My company calls for 25% refactor time so while we're writing new features, we keep in mind the code that annoys us most and that gets queued for refactoring next. Good way to balance feature work and tech debt. Oh, that sounds like heaven. I've been advocating for a similar proportion of time spent where I work but it's never going to happen. The list of stuff customers are asking for is too long.
|
# ? Apr 1, 2019 23:21 |
|
yeah that's a great policy to have in place. modern JS frontends can get really long and ugly really fast, especially React as it doesn't really prescribe any best practices or code structure. even if you have the whole thing mapped out before writing any code it still is likely you will encounter decisions about structure not initially thought of. I moved a context provider today to its own thing instead of living in a parent component for example and its already helped by eliminating an unmounted component memory leak bug. constantly refactoring stuff does have its perks, I'm lucky in that I can use my time however so long as deadlines are met so I have lots of time to do so.
|
# ? Apr 1, 2019 23:29 |
|
Our only QA guy quit, so I spent today fixing end-to-end tests. As if I know what I'm doing
|
# ? Apr 1, 2019 23:32 |
|
One source of horrible code is when you ask somebody to write something complex that is over his head. And he/she still manage somehow to complete it. Since the code was written by somebody that literally had no idea what he/she was doing, the result is ugly and convulated, hard to follow, hard to fix, hard to maintain. Many good programmers have this skill, we have this skill, we can write anything people can ask us, but the result qualities vary. Then I have seen the oposite, people that flat out reject to write something that the can't write. Is almost a better skill looking back. Except the people that say no, normally ends moving away to other things. huhu posted:My company calls for 25% refactor time so while we're writing new features, we keep in mind the code that annoys us most and that gets queued for refactoring next. Good way to balance feature work and tech debt. :-O
|
# ? Apr 2, 2019 00:59 |
|
Something about refactoring other people's code is a horrible experience compared to refactoring your own code which is bliss and I could spend all day doing it forever.
|
# ? Apr 2, 2019 10:37 |
|
Good code is modular and made to be refactored while bad code depends on globally mutable magic strings
|
# ? Apr 2, 2019 11:40 |
|
|
# ? May 16, 2024 14:57 |
|
Nolgthorn posted:Something about refactoring other people's code is a horrible experience And it also sucks to have to write a justification for the refactor. Making (say) code more testable is an easy sell, but fixing up horrid "cosmetic" issues like bad variable names can really rankle people.
|
# ? Apr 2, 2019 16:12 |