|
Well I've got my domain pointing at a react server I have running on my laptop. Hard part's over! I'll probably be back to ask all sorts of stupid questions over the next few months. Thanks, goons
|
# ? Aug 28, 2019 12:48 |
|
|
# ? Jun 11, 2024 00:59 |
|
Rex-Goliath posted:Well I've got my domain pointing at a react server I have running on my laptop. Hard part's over! I'll probably be back to ask all sorts of stupid questions over the next few months. Thanks, goons This is so very very wrong and hurts me deep inside
|
# ? Aug 28, 2019 15:47 |
|
What the running on my laptop part or the hard part's over part? Those were intentional
|
# ? Aug 28, 2019 15:55 |
|
The running on your laptop part
|
# ? Aug 28, 2019 16:01 |
|
Yeah I travel for work so it's all I have at the moment. I just wanted to see it working for the gratification. I plan on building an actual server when I finally get home next month.
|
# ? Aug 28, 2019 16:06 |
|
Rex-Goliath posted:Yeah I travel for work so it's all I have at the moment. I just wanted to see it working for the gratification. I plan on building an actual server when I finally get home next month. Mostly no one does this anymore. If you're wanting to serve it so other people can use it, you should use one of the many free or very cheap services to host it for you. I see from your previous posts that you have some sort of backend to your app, so maybe a VPS would work well for you. I like Digital Ocean where you can get a server for $5/month. There's also things like EC2, or Azure, or whatever the hell Google is doing nowadays.
|
# ? Aug 28, 2019 16:38 |
|
Also both AWS and Azure have significant free trial programs.
|
# ? Aug 28, 2019 16:43 |
|
Oh yeah I know those exist I more want to do it as a hobby. I guess doing it on AWS would be good experience as well though. I just want to physically own the machine, I guess.
|
# ? Aug 28, 2019 17:08 |
|
New to react. I'm working with a third party's scheduler\calendar control in react. They provide a way to use a custom template, but I can't figure out how to get the data there that I want. basically, at the top level I have an array, then the third party component -> their template. This particular template is just the header for the day(simple cell displaying the date) and only receives 1 prop, the date. I want to customize it to show the count from my array also. I'm guessing I could tag and find it with jquery, or make an api call back to the server to get the data from there, but that all sounds very wrong. What am I looking for here?
|
# ? Aug 28, 2019 17:59 |
|
Don't try to modify react dom with jquery. What is the component you are using?
|
# ? Aug 28, 2019 18:02 |
|
The Fool posted:Don't try to modify react dom with jquery. devextreme Scheduler, datecelltemplate specifically https://js.devexpress.com/Documentation/ApiReference/UI_Widgets/dxScheduler/Configuration/#dateCellTemplate
|
# ? Aug 28, 2019 18:09 |
|
From what I understand of the documentation, dateCellTemplate is just a function that returns whatever markup you want. You specify your function as a prop to the View component, then you can return whatever data you want. Here is a codesandbox: https://codesandbox.io/s/customize-individual-views-devextreme-scheduler-rg7dd?fontsize=14 modified from this demo: https://js.devexpress.com/Demos/WidgetsGallery/Demo/Scheduler/CustomizeIndividualViews/React/Light/ relevant changes: code:
|
# ? Aug 28, 2019 19:15 |
|
The Fool posted:From what I understand of the documentation, dateCellTemplate is just a function that returns whatever markup you want. My problem is pull date from elsewhere in the app. Like, for example, let's say I wanted to show the total number of appointments on that day in the header.
|
# ? Aug 28, 2019 19:34 |
|
bobua posted:My problem is pull date from elsewhere in the app. Like, for example, let's say I wanted to show the total number of appointments on that day in the header. That is going to depend a lot on how your app is structured, there a few options: React Context: https://reactjs.org/docs/context.html Redux: https://react-redux.js.org/ just do an import: import { data } from './data.js'
|
# ? Aug 28, 2019 19:45 |
|
The Fool posted:That is going to depend a lot on how your app is structured, there a few options: Okay, an import won't work I assume because it isn't just fixed data. I was avoiding redux\context because this is my first react journey and everything just starts with 'learn react before you add redux, you can probably do what you want without it.' Is this literally a time when something like redux\context are necessary, barring actually modifying the third party library?
|
# ? Aug 28, 2019 20:37 |
|
Rex-Goliath posted:Oh yeah I know those exist I more want to do it as a hobby. I guess doing it on AWS would be good experience as well though. I just want to physically own the machine, I guess. I too hung on quite long about having dedicated machines because it's how I did things damnit. But then I tried out running my wife's blog on EC2 and my crappy site on S3 and Cloudfront: https://www.bayphillips.com/blog/goodbye-to-dedicated-server-hosting/ It's exactly what I need.
|
# ? Aug 28, 2019 20:55 |
|
bobua posted:Okay, an import won't work I assume because it isn't just fixed data. Where is your scheduler component located? It may be possible to put your datecelltemplate function in that parent component, then your array can be a prop of the parent. e: code:
The Fool fucked around with this message at 21:28 on Aug 28, 2019 |
# ? Aug 28, 2019 21:07 |
|
I appreciate your help, but I am still missing something...code:
|
# ? Aug 28, 2019 21:54 |
|
Nested component code. That ain't good. Can you post your full component, including where and how the DateCellTemplate is getting used (probably some sort of map function)? Also use hooks. Class components suck!!!!!!!!!!!
|
# ? Aug 28, 2019 22:08 |
|
Ruggan posted:Nested component code. That ain't good. Can you post your full component, including where and how the DateCellTemplate is getting used (probably some sort of map function)? I'm just copying and pasting for tests, this is all getting deleted once I understand it. The rest of the component is pretty much just this code:
|
# ? Aug 28, 2019 22:15 |
|
It's still pretty unclear where a bunch of things are coming from (dataCell, data, views) and whatever Scheduler may be doing with the DateCellTemplate that you passed. You should probably rip DateCellTemplate out into its own functional component and take only `text` and `test` as props. You can then create an instance of DateCellTemplate in your component and pass it the appropriate data. If you can post a more full example (or a codesandbox) including the other child components you're referencing, I can probably help more, but as it currently stands the code you posted has way too many unknowns to help you much further.
|
# ? Aug 28, 2019 22:27 |
|
bobua posted:The template is rendered 7 times since I'm in week view, and the console shows undefined(7 times) for the state and props variable shown, with or without the bind commented out. Don't use bind with arrow functions. bobua posted:I'm just copying and pasting for tests, this is all getting deleted once I understand it. First issue that jumps out at me, that scheduler prop should be: dateCellRender={this.DateCellTemplate} Ruggan posted:You should probably rip DateCellTemplate out into its own functional component and take only `text` and `test` as props. You can then create an instance of DateCellTemplate in your component and pass it the appropriate data. DateCellTemplate isn't a component, it's a function that returns markup and is registered as a callback in the scheduler component. The schedule component calls it when rendering each days cell. bobua, I linked a working codesandbox earlier, maybe fork it and tweak what you need to get your own stuff to work? Here's the link again: https://codesandbox.io/embed/customize-individual-views-devextreme-scheduler-rg7dd Ruggan posted:Nested component code. That ain't good. Can you post your full component, including where and how the DateCellTemplate is getting used (probably some sort of map function)? I agree, but the examples I pulled from devExtreme are all class based, so I just stayed with it. The Fool fucked around with this message at 22:33 on Aug 28, 2019 |
# ? Aug 28, 2019 22:27 |
|
The Fool posted:DateCellTemplate isn't a component, it's a function that returns markup and is registered as a callback in the scheduler component. It's basically a function component, though, isn't it? I mean sure, technically it's a callback function but it doesn't do anything to the parent. You could rewrite it as this: code:
|
# ? Aug 28, 2019 22:45 |
|
Ruggan posted:Very possible I'm missing something - let me know if I am. It's passed as a prop in the scheduler component, ie: code:
|
# ? Aug 28, 2019 22:55 |
|
But you know what IS passed. And you know it needs to return a node. So you build a function component that takes those inputs and returns a node.
|
# ? Aug 28, 2019 23:36 |
|
Where in the world did you find datecellRender instead of datecellcomponent? Google got almost nada, except this https://js.devexpress.com/Demos/WidgetsGallery/Demo/Scheduler/CustomizeIndividualViews/React/SoftBlue/ I can't find anything on what the difference is also... I was using props.selecteddate and state.selecteddate to test. I had stopped passing them down from the parent so they really were undefined. It's working now!
|
# ? Aug 28, 2019 23:42 |
|
If the child component is expecting to call dateCellRender as a function you can't just pass in a function component: https://codesandbox.io/s/sad-wilbur-qq8ju You can build a little inline function that returns your function component and maps the arguments to props though: https://codesandbox.io/s/upbeat-khayyam-lezfi dataCellRender is basically a render prop (as far as I can tell from skimming this discussion)
|
# ? Aug 29, 2019 00:15 |
|
prom candy posted:Svelte is really interesting but there can't be much of a job market or community for it yet, can there? definitely not, if someone's looking to get a job then React is the way to go. Vue is pretty popular in some places too so that could be an option. Svelte is probably too ahead of its time and entering at exactly the wrong time to gain any share of the front-end market tbh. that and their marketing has been weirdly hostile. like ok sure vIrTuAl DoM iS pUrE oVeRhEaD ok you're much smarter than me I believe you...now give me an actual reason to use your framework? the tutorial they put out with v3 is a good start, it's beginner-friendly. I havent made anything more than tiny toy projects with Svelte but at some point I'll try something more complex.
|
# ? Aug 29, 2019 00:17 |
|
prom candy posted:You can build a little inline function that returns your function component and maps the arguments to props though: https://codesandbox.io/s/upbeat-khayyam-lezfi Ah got it. That distinction makes sense to me. I was calling those two things the same thing. Thanks for clarifying.
|
# ? Aug 29, 2019 00:31 |
|
This new Angular job I was applying for seemed nice and promising until I got a technical test in my email with a loving link to Codility so gently caress that noise.
|
# ? Aug 30, 2019 19:14 |
|
I’ve never had to mess with Codility before. So do most companies send home whiteboard bullshit now or is it still majority during the actual interview? I finally decided to get a job and I’m just dreading this annoying part. I kind of miss interviews outside of tech where you just kind of talked about yourself and discussed poo poo lol
|
# ? Aug 30, 2019 23:07 |
|
My company does not do online code tests, but we're also not a new-agey internet based service company.
|
# ? Aug 31, 2019 00:09 |
|
Ape Fist posted:This new Angular job I was applying for seemed nice and promising until I got a technical test in my email with a loving link to Codility so gently caress that noise. So we can say that the test accomplished its purpose.
|
# ? Aug 31, 2019 01:09 |
|
Volguus posted:So we can say that the test accomplished its purpose. Uhh if you only want to hire front end javascript programmers who cheat on their interview, codility is a great resource.
|
# ? Aug 31, 2019 05:32 |
|
Volguus posted:So we can say that the test accomplished its purpose. As above said, you can just cheat the gently caress out of it. Also, it's barely representative of actual day to day rigmarole of FED on 2019, and by barely representative I mean literally not representative at all.
|
# ? Aug 31, 2019 06:10 |
|
I don't interview a lot of people but when I do I get them to run me through code they've written and explain it to me (requirements, decisions they made, challenges, things they'd do differently, etc) and then I just chat with them about coding and the industry for an hour or so. So far out of 5 or 6 people I never hired anyone who was significantly worse at coding than I expected. Also selected for people I enjoyed talking to.
|
# ? Aug 31, 2019 12:16 |
|
Ruggan posted:I had a few hours to play with this. Took me a little while to remember exactly how D3 worked, but this ended up being pretty easy to do. A bit late, but nice! Don't forget to try out an arc transition (because now with useEffect() you can without having to deal with some third party animation/transition library/otherwise trick the virtual DOM). Mike Bostock has a nice example on arc transitioning here, with some additional useful links: http://bl.ocks.org/mbostock/5100636.
|
# ? Aug 31, 2019 16:05 |
|
Getting this error from trying to build an ejected create react appcode:
Edit: I know ejecting is frowned upon but this is a porting/upgrading attempt and there are some build configs we need to carry over Edit 2: Went digging and found that some files are doing poo poo like import 'style-loader!css-loader!rc-slider/assets/index.css'; dupersaurus fucked around with this message at 15:42 on Sep 3, 2019 |
# ? Sep 3, 2019 15:10 |
|
Now I'm stranded on upgrading webpack 2 to 4. How the modules are being put together has changed -- given the same config it outputs two different files -- which breaks how we've been using the output, and I can't find any information about how to fix it. The basic idea: code:
code:
code:
Searching the web I've come across the umd fix code:
Anyone have any insight?
|
# ? Sep 4, 2019 20:49 |
|
|
# ? Jun 11, 2024 00:59 |
|
I ported my ejected app back into a fresh CRA v3 install because I figured that would be easier than trying to upgrade webpack myself. I'm not going to eject again (craco lets you override configs without ejecting) Basically I think I made a fresh CRA app and then moved my src folder in, and then tinkered with it until it worked
|
# ? Sep 5, 2019 04:36 |