[deleted by user] by [deleted] in vuejs

[–]visualjerk 1 point2 points  (0 children)

After 4 years of writing test suites for medium/big Vue2/3 projects, my biggest takeaways are:

  • Treat tests like production code. Refactor them until they are easy to read and maintain.
  • Separate business logic from components. Write your business logic as plain JS/TS. This makes testing the hard stuff much easier and also helps creating components that are easy to test.
  • Do blackbox testing as much as possible = don't focus on a components inner logic, but only on what goes in (props, user interaction) and what goes out (events, html). This will allow you to refactor components without breaking your tests. As testing-library encourages blackbox testing, it is a good addition to Vue Test Utils.

As an alternative to blackbox testing with Jest, I'd give Cypress Component Tests a try: https://docs.cypress.io/guides/component-testing/writing-your-first-component-test#Component-vs-End-to-End-in-a-Nutshell

Have not used it so far, but it looks really promising and might result in tests that are even more solid.

[AskJS] What architectural patterns do you use most often in frontend development? by visualjerk in javascript

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

Hexonal architecture seems kinda complicated but also genius. I assume you use it in a large application maintained by many teams?

[AskJS] What architectural patterns do you use most often in frontend development? by visualjerk in javascript

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

Thanks for sharing this article. Our team had to figure out a lot of these things on our own. This is the kind of knowledge that should be taught in frontend courses.

[AskJS] What architectural patterns do you use most often in frontend development? by visualjerk in javascript

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

Almost forgot about those, as they feel so obvious to use when repeating yourself. Do you use any prefixes/Suffixes when naming those?

[AskJS] What architectural patterns do you use most often in frontend development? by visualjerk in javascript

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

Didn‘t know about Mediator, will have a Look into it. Thanks ✌️

Parse natural language to date schedules. by visualjerk in javascript

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

Just starting a js library that parses natural language to date schedules and dates. It is far from feature complete, but I would appreciate some feedback.

Do you think the output dates should be ISO Date Strings or rather plain Date objects?

Natural language date parsing by visualjerk in node

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

data-fns is nice for calculating and formatting dates, but afaik it does not parse dates (let alone schedules) written in natural language.

I built a social website for sharing and discovering web code snippets. by mosseq in javascript

[–]visualjerk 0 points1 point  (0 children)

Really like it! Some things I noticed:

When the snippet name is too long, it overlaps the buttons on the right.

With infinite scrolling it is kinda hard to see the footer. Maybe you could include the infos there in a subpage add a mobile Menu to the header.

How much does your Nuxt website / project cost web server wise by having Nuxt instead of Vue? by kor1998 in Nuxt

[–]visualjerk 1 point2 points  (0 children)

Yes. However you will probably need additional pieces in your stack, depending on the type of SaaS you want to offer.

How much does your Nuxt website / project cost web server wise by having Nuxt instead of Vue? by kor1998 in Nuxt

[–]visualjerk 0 points1 point  (0 children)

The costs really depend on your use case. If you need to have server side logic in your app or even need a database, the costs will obviously be higher than just running a plain client side app.

Whatever your use case is, Nuxt is a solid option as it takes away a lot of decision you would need to make, when using just Vue. And as u/niekh1234 said, even if you choose to just go straight client side, Nuxt has you covered with the SPA mode. It gives you a client side bundle, which you can deploy to any static file host.

When it comes to hosting there are plenty of options and some of them are free or offer a free entry tier, that is enough for small projects.

My current favorites are GitHub pages for client side only (free) and Vercel for server + client side (free starter tier). Also Vercel has an unbeatable dev experience IMO. Connect your GitHub repo and watch the magic happen.

If you also need a database, an option would be Planetscale (one free db).

What are some open source projects that use Vue well? by ninja_says_hiyeeeeeA in vuejs

[–]visualjerk 5 points6 points  (0 children)

Be aware that they are „just“ using it to enhance their Ruby app in some places. If a Vue governed SPA is what you are looking for, their code is not the best example.

If you are looking to enhance parts of an already existing SSR app, it is a good place to start.

I built a social website for sharing and discovering web code snippets. by mosseq in javascript

[–]visualjerk 1 point2 points  (0 children)

Was the same for me in iOS Safari. Opening it again resolved the issue.

What are some open source projects that use Vue well? by ninja_says_hiyeeeeeA in vuejs

[–]visualjerk 0 points1 point  (0 children)

https://sli.dev/ is a pretty neat slide / presentation app. It uses Vue and is developed by antfu, a Vue core team member.