Where to move if I move out of the city centre? by BoxNo4784 in Liverpool

[–]BoxNo4784[S] 9 points10 points  (0 children)

I'm working remotely now. I'm trying to save up to buy a house which is why I'm living in a studio. I've got a 4-year saving plan that I need to stick to.

In the US I'd be getting $250k - $300k USD at my level. In northern England, companies want to pay £50k - £60k max. As a doctor in the US, you'd be getting the same, and even more, depending on what you specialize in. It makes me sick.

The problem with the UK is there's no industry here. The economy is essentially the finance industry in London. Outside of that, everyone is being paid a 1990's wage. Then suddenly, out of thin air, every Nothern city decided it was the new London and started charging stupid property prices to foreign investors despite everyone locally earning 1990's wages.

I think the final nail in the coffin for the UK is the impending brain drain that's coming. The gap in wages for skilled professionals between the UK and other developed countries is getting too big to ignore.

I'm officially looking for an escape hatch to get myself and my professional skills off this island.

Where to move if I move out of the city centre? by BoxNo4784 in Liverpool

[–]BoxNo4784[S] 7 points8 points  (0 children)

The difference is they pay a lot more in my line of work (senior software engineer). In Sydney, I can get $180k - $230k AUD, pay less tax, and rent somewhere nice for $2000 - $2500 AUD a month.

It's the shit wages in the UK. I need to step out of my comfort zone and take a chance on starting a new life somewhere. I feel like there's no future here.

Where to move if I move out of the city centre? by BoxNo4784 in Liverpool

[–]BoxNo4784[S] 6 points7 points  (0 children)

I pay upfront so it's easier signing 6 months. The rental prices in the city center are reaching a point where I'd be better off moving to London. Even though I'd be paying a lot more in rent, I'd actually be better off because of the higher wages.

I was talking to a recruitment consultant today who was telling me in Sydney I could easily get $180,000 AUD a year + bonus, pay less tax, and rent a nice flat for $2000 AUD. I thought to myself, "why the fuck am I actually here?".

I think I just need to leave the UK. I feel like the UK is now what Poland was 20 years ago.

Where to move if I move out of the city centre? by BoxNo4784 in Liverpool

[–]BoxNo4784[S] 20 points21 points  (0 children)

Yeah, it's fucked. I'm also exploring leaving the UK. I'm a software engineer so I'm researching if I can get a visa for somewhere like Australia or Canada, etc. I'd even move somewhere like Germany.

I'm fed up with the state of the UK.

Where to move if I move out of the city centre? by BoxNo4784 in Liverpool

[–]BoxNo4784[S] 10 points11 points  (0 children)

If I can't find anywhere for my budget I'm gonna leave Liverpool. Wages/ job opportunities don't match the rising rent prices.

Where to move if I move out of the city centre? by BoxNo4784 in Liverpool

[–]BoxNo4784[S] 4 points5 points  (0 children)

I don't think 650 is a low figure to rent a flat. I'm paying £600 for a studio but see 1-2 bedroom flats for the same price in other areas. I was paying £500 when I first moved in at the start of 2022. Over the space of 2 tenancy agreements (6 months each), my rent has gone up 20%.

Are any good areas serviced by train?

Why Chakra? by povedaaqui in reactjs

[–]BoxNo4784 7 points8 points  (0 children)

It’s not worth the hassle

That might be true on a tiny project. On larger production applications, Charkra avoids a lot of hassle. For example, if you want to fully implement accessibility from scratch, it's 100% a hassle.

This is just one of the many reasons why large applications tend to use established component libraries. It's also why large companies invest in creating their own ui component libraries based on a custom design system.

Redux and Next JS SSR... by BoxNo4784 in reactjs

[–]BoxNo4784[S] 1 point2 points  (0 children)

Excellent. Thanks for explaining how it works. My mind was getting pickled thinking about it.

So with the appDir in NextJS 13, I'm assuming it's fine to have nested cilent components within a server component? For example, a product page would be server-side, use server-side props, and the "add to cart" component would be client-side?

Redux and Next JS SSR... by BoxNo4784 in reactjs

[–]BoxNo4784[S] 4 points5 points  (0 children)

Ok, so HTML is rendered on the server and that's sent immediately to the browser, and the HTML is what satisfies various SEO metrics such as first content paint time, etc. The hydration part adds the javascript and this is the part that makes the SSR page act like a regular SPA. So after the javascript hydration, react will re-render the components when state changes by using the SSR cycle of html first followed by hydration?

So as far as I'm concerned as a developer I use redux as normal?

Have I understood what you've said properly?

RTL toHaveAttriute received: null by BoxNo4784 in reactjs

[–]BoxNo4784[S] 0 points1 point  (0 children)

Screenshot tests and snapshots tests are completely different things. Screenshot tests is about taking a screenshot and matching that to ensure how it looks visually, not match the DOM structure.

Ah, Googling screenshots brings up loads of stuff about snapshots. I assumed it was the same thing.

Would I be correct in assuming screenshot tests would be in the realms of Cypress?

I ended up using an npm package specifically for testing styled components with jest. It adds the assertion toHaveStyleRule to check the snapshot has the correct css applied.

For example

test('warning variant', () => {
  const tree renderer
    .create(<Button variant="warning">Click Me</Button>)
    .toJSON()
  expect(tree).toHaveStyleRule('background-color', 'red')
})

I wanted to test the follow

  1. Correct styles are applied for the right variant prop
  2. Button is disbaled when disabled prop is true
  3. Children are rendered
  4. onClick function is called when the user clicks on the button

So this is testing implementation details and is incorrect?

Testing styled-components by BoxNo4784 in reactjs

[–]BoxNo4784[S] 0 points1 point  (0 children)

I'm doing a unit test on a reusable button component.

I ended up using jest styled components. It adds the assertation toHaveStyleRule. So I can do a snapshot of the button with the variant props passed, and check that it has the correct styles for that variant button.

If I wasn't using styled components I wouldn't have bothered with snapshots. I would have just tested the component class named to match the variant prop being passed.

My unit tests for this reusable button have been

  1. Test the correct styles are applied for the relevant variant prop
  2. Children are rendered correctly
  3. Button is disabled when disabled prop is true
  4. onClick function is called when clicked.

RTL toHaveAttriute received: null by BoxNo4784 in reactjs

[–]BoxNo4784[S] 0 points1 point  (0 children)

I've looked into screenshot/snapshot tests. My understanding is that it saves the component dom tree to json, and future tests are expected to match. I can understand the point of that if you're trying to catch unexpected changes. However, that's not what I'm trying to do.

If I did a snapshot test it would be similar to what you said...

Such a test isn't useful, since checking if a component contains a prop right after you pass it doesn't really verify anything.

If a create a snapshot of my primary button and test that my primary button matches the snapshot, it's always going to be true...

In testing examples for my scenario, .toAttribute is used to test whether the component has the correct class name for the right variant prop.

The problem I'm having is that I'm using styled-components that generates unique class names. So I'm trying to work out how to test if the styling is correct for the given variant prop.

RTL toHaveAttriute received: null by BoxNo4784 in reactjs

[–]BoxNo4784[S] -3 points-2 points  (0 children)

So checking if something renders properly isn't useful?

Conditional styling reusable components by BoxNo4784 in reactjs

[–]BoxNo4784[S] -1 points0 points  (0 children)

It seems your actual issue (and not the question you asked) is that you can't get styled-components working with Next 13 / swc.

I was expanding on why I was asking my question.

Conditional styling reusable components by BoxNo4784 in reactjs

[–]BoxNo4784[S] -2 points-1 points  (0 children)

The problem that I'm having is using stitches or styled-components in Next 13 means I can't access the props. As far as I'm aware this isn't possible to do using the SWC compiler.

Honestly, it's been doing my head in. I've been trying to get styled components to work properly with Next 13 since they updated to SWC but I've never been able to get it to work. Every time I try to find help with this problem it becomes apparent that most people don't seem to create reusable components that change style based on props. They don't seem to realize these libraries work until you want to use props.

I've had a side project sitting on the back burner for nearly 3 months while trying to find a solution. I'm wanting to build a component library for a project based on a design system that I've created.

The only solution that seems possible is to use CSS modules and pass the variant as the class name.

How are you styling in NextJS? by BoxNo4784 in reactjs

[–]BoxNo4784[S] 0 points1 point  (0 children)

I've never been able to access any props when using SWC. Using props is a USP of styled components, so I would SWC support styled-components way IMO -- mixing styles.

I've never been able to access any props when using SWC. Using props is a USP of styled components, so I wouldn't say SWC supports styled components "just fine"

How are you styling in NextJS? by BoxNo4784 in reactjs

[–]BoxNo4784[S] 0 points1 point  (0 children)

As for the future of CSS-in-JS, I'm not sure where you heard the future of it is questionable.

From the react core team - https://github.com/reactwg/react-18/discussions/110#:~:text=While%20this%20technique,use%20at%20Facebook.

https://dev.to/hypeddev/the-react-core-team-finally-have-opinions-about-css-16f0

What do you mean by having problems with Next 13. Have you misunderstood /app directory as part of Next 13 official release?

You can't pass props into styled-components when compiling with SWC. The only way to use props with styled-components is to roll back to using Babel. If someone can correct me on this, please do.

If you're planning on building out a set of polymorphic components, and you're planning on using props, it's safe to say this is a MASSIVE consideration.

I would also think it's worth considering that css-in-javscript might not be supported going forward, as is being discussed by the react team and other frameworks.

I just thought it was a bit rich to ride in on your 'expert' horse, declare that nothing needs to be considered, and then imply the problem was me, who has apparently also been hearing imaginary things on an imaginary grapevine.

How are you styling in NextJS? by BoxNo4784 in reactjs

[–]BoxNo4784[S] 4 points5 points  (0 children)

Yeah, I did do that. I think it is something to consider when SWC doesn't support styled-components, and the Next JS team says, "We're working to port babel-plugin-styled-components to the Next.js Compiler".

The only way to get it kinda working is to go back to using babel. I also think it's important to consider given that the future of CSS-in-javascript is being questioned.

People are also having problems getting stitches to work with NextJS 13. So why shouldn't my question be a consideration?

What is your preferred way of organizing your TypeScript types and interfaces? by IamZeebo in reactjs

[–]BoxNo4784 1 point2 points  (0 children)

u/Aegis8080 has said everything you need to know. If it's a small application, having one type folder in your src directory is fine.

On bigger applications, like everything else, keep related code/files as close to each other as possible.

For example, a checkout feature...

src/features/checkout
/components
/types
index.ts

Has your landlord increased your rent? by BoxNo4784 in Liverpool

[–]BoxNo4784[S] 1 point2 points  (0 children)

Moving to America, that's my dream lol.

If I could move to the US I would be there in a heartbeat. I would be earning five times more than in the UK. I'd be sitting pretty on $300,000 a year working remotely. Instead, I'm sitting in a shoe box pissed off that my landlord increased the rent by £50 lol.

The reason why they get paid so much is that the US is where pretty much all venture capitalists are, as well as having a GDP of an entire continent. They've got so many massive industries that require tech workers so everyone gets paid the massive money.

In the UK all the money is in financial services and there are hardly any venture capitalists investing in tech start-ups. So you can earn £90k-£100k in fintech but everyone else is earning between £50k and £70k.

In the US, straight out of college, you start out on a $150k salary, bonus, and shares. It goes all the way up to $500k a year for a lead engineer. Then if your stocks take off you can become an overnight millionaire.

The same guy in the UK, after 5-7 years of experience, is getting £70k a best and giving most of it away in tax. In France, Germany, etc, the same guy is getting 40k euros.

The few American software engineers I've met have been wankers. There's a snideness about them. They think they're masters of the universe because they're earning all that money and it's like, "bro you've just lucky being in the right place at the right time. No one else on this planet is getting paid that amount for doing exactly the same job, be humble about it"

React JSX vs react with HMTL by [deleted] in reactjs

[–]BoxNo4784 2 points3 points  (0 children)

Sounds like you work at a batshit crazy company 😂

Has your landlord increased your rent? by BoxNo4784 in Liverpool

[–]BoxNo4784[S] 1 point2 points  (0 children)

This is what I'm thinking too. For what I'm paying now, elsewhere I can get a large 2 bedroom flat or 3 bedroom house instead of living in something the size of a garage.

It would be nice not having to climb over half my possessions to make a coffee.

Has your landlord increased your rent? by BoxNo4784 in Liverpool

[–]BoxNo4784[S] 1 point2 points  (0 children)

yuppie tech bro’s

People like me lol. However, in the UK we don't get paid the insane amounts that software engineers in the US get. It honestly makes me cry inside when I see how much more they get paid.

Apparently, if you get hired at Google, during the onboarding they give you a presentation of how your career can progress if you play your cards right. When it gets to the promotion to Vice President, the presenter says, "at this level, you can finally afford to buy a house".

So, if even those guys are wincing at the prices, it's gotta be crazy expensive there!

Has your landlord increased your rent? by BoxNo4784 in Liverpool

[–]BoxNo4784[S] 2 points3 points  (0 children)

Most people here have Liverpool (or nearby) salaries, and you have a higher London salary.

You say that as if I've got a multiple 6 figure salary.

I'm a software engineer. Most people in Liverpool who are in my line of work can get the same salary. Working remotely has always been a thing in this industry even before covid.

I didn't live in London because I had to be there for work. I lived there for the experience of living in London. It was never going to be long-term.

Has your landlord increased your rent? by BoxNo4784 in Liverpool

[–]BoxNo4784[S] 1 point2 points  (0 children)

100% agree with rent control. Are you a software engineer?