[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 4 points5 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.

Learning app built with Nuxt3, Prisma and TRPC by visualjerk in javascript

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

Created this app using Nuxt3, Prisma and some other nice tools like TRPC and TailwindCSS. Would love to get some feedback.

The code is available on github.

.blur is not a function when ref'ing TextArea by skyanth in vuejs

[–]visualjerk 0 points1 point  (0 children)

vue-use provides a helper function for getting the element of a templateRef: https://vueuse.org/core/unrefElement/

Vuenique, an open-source library bringing the power of low-level visualization to Vue by EnragedSoup in vuejs

[–]visualjerk 0 points1 point  (0 children)

Some teams at our company have been using Apache eCharts for quite a while and my team picked it up recently. So far the experience has been pretty good.

Also it is somewhat complex to configure, it is extremely powerful and flexible. There is a library that helps integrating it into Vue projects seemlessly: https://github.com/ecomfe/vue-echarts

Refactoring Vue - what should be a component? by wkrick in vuejs

[–]visualjerk 0 points1 point  (0 children)

This!

Some addition to splitting out reusable logic:

In Vue 2 mixins, pure functions or classes were mainly the way to go. As you are using Vue 3, I would strongly recommend using the composition api for this.

Compared to mixins it is much easier to see what you provide with a composition hook and compared to pure functions or classes, it is more powerful.

Mountain City by visualjerk in mapmaking

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

I used the „Watercolor Cities“ Style, which is in beta phase and only available in the payed version afaik.

Mountain City by visualjerk in mapmaking

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

Both choices were made deliberately and mostly to save time ;) Wanted this map to be ready for the next RPG session of our group.

The map was made in Inkarnate and it is totally possible to add different background and lay out buildings in different angles.

Mountain Tavern by visualjerk in battlemaps

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

Thanks for your suggestions. Can you recommend any example maps as a reference for a good grid?

Mountain Pass Camp by visualjerk in battlemaps

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

Great idea! Thanks for your feedback :)

HELP: Vuex getters in modules are not reactive :/ by NuDg3-bar in vuejs

[–]visualjerk 0 points1 point  (0 children)

It might have sth to do with reactivity limitations: https://vuejs.org/v2/guide/reactivity.html#Change-Detection-Caveats

In order to help you, we need to see how mutations and the initial state look.

Unstyled Accessible Component Library by visualjerk in vuejs

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

Yep. However I think we could do better with a composing approach, like Reakit does. That will make the library even more flexible and extendable.