khalidabuhakmeh, to javascript
@khalidabuhakmeh@mastodon.social avatar

Folks who do development with a frontend framework (, , ), is your frontend code part of the solution, or have you split the backend and frontend into separate isolated folders?

I have thoughts, but would love to hear what your thoughts are. Boosts are appreciated.

schizanon, (edited ) to webdev
@schizanon@mas.to avatar

If there was an element that changes it's content when users interact with other elements on the page, what name would it have?

PLEASE NOTE: I am not suggesting that this element needs to exist; I am only asking what it would be called. I'm building a CustomElement, I just want it to have a name that makes sense.

Vote and suggest others in replies. Please boost for reach!

judicodes, to react

Frontend Devs, where are we currently standing in the debate React vs. Vue.js? Or is something entirely different already taking over (SolidJS, Ember.js, Svelte, ...)?

For years, it seemed like React was almost the only way to go. Now I feel like the winds are changing and other frameworks/libraries are gaining traction.
What do you all think?

#frontend #softwaredevelopment #coding #react #vuejs

thomastospace, to vuejs
@thomastospace@phpc.social avatar

Recently I started on a #Vuejs project at my new job. I've only worked with #Angular before.

One thing I didn't like it first, turned out to be an unexpected strength. In Angular, each component has a separate template, typescript & sass file. In Vue.js this is all inside a single file! Ugly and hard to use I thought.

Instead, it's a blessing. When a component reaches 100-150 lines, it already feels like a large component. Any larger? Time to split it up. It helps keep code clean.

janriemer, to rust

Urgh, #Rust + #WASM + #Vue is such a dream stack! ✨ 💖

Stay tuned for some magic in the next few days... 🤞

#RustLang #VueJS #WebAssembly #Transpiler(:awesome:)

wogan, to Laravel

I'm sure these have been done to death already, but I'm thinking about doing an end-to-end project build (maybe, cloning Twitter) using , , and - and then documenting the entire thing on YouTube.

I'm almost positive that there are already video series out there doing this exact thing, so I'm trying to work out what would make my approach to it any more unique.

leanpub, to Laravel
@leanpub@mastodon.social avatar

Laravel 5.4 For Beginners by Bill Keck is on sale on Leanpub! Its suggested price is $29.95; get it for $11.96 with this coupon: https://leanpub.com/sh/fqNULXp3 #Laravel #Vuejs #Php

scy, to vuejs
@scy@chaos.social avatar

A #VueJS template with

<p>{{ "Some text." }}</p>

Sure, it works, but … folks, please!

kfdm, to django
@kfdm@social.tsun.co avatar

Working with #django and #vuejs I'm using custom tokens so that VueJS and Django tokens don't conflict, but I also have a need to escape to ensure users can't get my VueJS delimiters anywhere.
Is there a place I can hook in to add my own, additional escape code 🤔, or am I doomed to have to add {{value|myescape}} everywhere a value is used 😢

schizanon, to javascript
@schizanon@mas.to avatar

The longer you have #calckey open the more memory it uses. It will always crash eventually. I blame #vue #vueJS #webDev #javaScript #memoryLeak

pb4000, to webdev

Starting on a rewrite of an internal tool for a client, but trying to decide on which stack to use. The previous developer is versed in Vue/express and is able to help me out if I went that route. However, I've gotten a taste of sveltekit and love it because I can combine the frontend and API pretty seamlessly. Its problems are twofold though:

  1. The previous dev would be significantly less help
  2. Sveltekit is very new, meaning it is constantly changing and has a smaller, though more invested ecosystem (libraries, community, etc.)

I'm leaning towards Vue/Express right now, but I'm still not sure..

#webdev #freelance #vuejs #expressjs #sveltekit

Jbasoo, to programming
@Jbasoo@mastodon.social avatar

I went to book a flight with Wizz Air last night and the absolute shocking web performance made me feel better about my own work.

It takes ~30s to process the #JS and render the search, literally the primary function of the site. I like the DX of #VueJS but is this kind of performance really worth it?!

secusaurus, to Laravel

I've got a sprint ahead with the goal to implement on backend with frontend (and another third party app on .NET). The single factor (using with ) exists already (three years in production).
I do not like to use too many dependencies, but obviously doing it all by myself can be a high security risk as well.
However, all "plugins" I found for Laravel usually use their own frontend (blades) as well which I cannot use here.

Any ideas/input/experience on
a) the first steps for migration 1FA -> 2FA
b) using TOTP (which might be less pain for development) or rather FIDO2 (which I'd prefer but do I need to rebuild the whole authentification process?)

Especially mentioning @valorin here, but appreciate any vujes / developer as well ;-)

Thanks for sharing your thoughts already!

partizan, to vuejs

#vuejs #typescript

I'm trying to use generic type with vue composition API, and getting an error.

import { ref } from "vue";

function useContext&lt;T extends BaseContext&gt;(v: T) {  
 const context = ref&lt;T | null&gt;(null)  
 context.value = v  
 return {context}  
}

interface BaseContext {}  
src/main.ts:5:3 - error TS2322: Type 'T' is not assignable to type 'UnwrapRef&lt;T&gt; | null'.  

Is this a bug, or am i doing something wrong?

joe, (edited ) to javascript

Earlier this week, we started looking at React and I figured that for today’s post, we should take a look at the https://react.dev/reference/react/useEffect and https://react.dev/reference/react/useMemo React Hooks. Hooks are functions that let you “hook into” React state and lifecycle features from function components. In yesterday’s post, we used https://codepen.io/steinbring/pen/GRLoGob/959ce699f499a7756cf6528eb3923f75. That is another React Hook. The useState Hook allows us to track state in a function component (not unlike how we used Pinia or Vuex with Vue.js).

The useEffect React hook lets you perform side effects in functional components, such as fetching data, subscribing to a service, or manually changing the DOM. It can be configured to run after every render or only when certain values change, by specifying dependencies in its second argument array. The useMemo React hook memoizes expensive calculations in your component, preventing them from being recomputed on every render unless specified dependencies change. This optimization technique can significantly improve performance in resource-intensive applications by caching computed values.

Let’s take a look at a quick useEffect, first. For the first demo, we will use useEffect and useState to tell the user what the current time is.

See the Pen by Joe Steinbring (@steinbring)
on CodePen.

Let’s walk through what we have going on here. The App() function is returning JSX containing <p>The current time is {currentTime}</p> and currentTime is defined by setCurrentTime. The code block useEffect(() => {}); executes whenever the state changes and can be used to do something like fetching data or talking to an authentication service. It also fires when the page first renders. So, what does that empty dependency array (,[]) do in useEffect(() => {},[]);? It makes sure that useEffect only runs one time instead of running whenever the state changes.

We can get a little crazier from here by incorporating the setInterval() method.

See the Pen by Joe Steinbring (@steinbring)
on CodePen.

In this example, it still runs useEffect(() => {},[]); only once (instead of whenever the state changes) but it uses setInterval() inside of useEffect to refresh the state once every 1000 milliseconds.

Let’s take a look at another example.

See the Pen by Joe Steinbring (@steinbring)
on CodePen.

In this one, we have three form elements: a number picker for “digits of pi”, a color picker for changing the background, and a read-only textarea field that shows the value of π to the precision specified in the “digits of pi” input. With no dependency array on useEffect(() => {});, whenever either “Digits of Pi” or the color picker change, useEffect is triggered. If you open the console and make a change, you can see how it is triggered once when you change the background color and twice when you change the digits of pi. Why? It does that because when you change the number of digits, it also changes the value of pi and you get one execution per state change.

So, how can we cut down on the number of executions? That is where useMemo() comes in. Let’s take a look at how it works.

See the Pen by Joe Steinbring (@steinbring)
on CodePen.

In this revision, instead of piValue having a state, it is “memoized” and the value of the variable only changes if the value of digits changes. In this version, we are also adding a dependency array to useEffect() so that it only executes if the value of color changes. Alternatively, you could also just have two . Let’s take a look at that.

See the Pen by Joe Steinbring (@steinbring)
on CodePen.

If you throw open your console and change the two input values, you will see that it is no longer triggering useEffect() twice when changing the number of digits.

Have any questions, comments, etc? Feel free to drop a comment, below.

https://jws.news/2024/exploring-useeffect-and-usememo-in-react/

#JavaScript #JSX #React #ReactHooks #VueJs

ewen, to python French
@ewen@mastodon.fedi.bzh avatar
Poslovitch, to accessibility French
@Poslovitch@wikis.world avatar

Bonjour les expert·es en #Accessibilité #accessibility #web : est-ce que vous avez des outils libres qui permettent d'avoir des rapports sur la conformité d'un site aux différents critères d'accessibilité ?

Plus particulièrement, pour un site qui est une "appli" #VueJS

janriemer, to programming
nextcloud, to php
@nextcloud@mastodon.xyz avatar

Interested in developing with Nextcloud? 💙 We develop with and , so whether you're frontend, backend or full-stack this tutorial helps you set up your locally running development environment via 🐳: https://dev.to/daphnemuller/developing-with-nextcloud-part-1-setting-up-for-development-677

joe, to javascript

In last week’s post, I said, “That is because you can not pass an array directly into a web component”. I said that I might take a moment at some point to talk about how you could do that. Well, today is the day we are doing that.

Let’s start with a basic Lit example.

See the Pen by Joe Steinbring (@steinbring)
on CodePen.

You will notice that the ArrayList class has an items property that is an array type. Lit won’t let you do something like <array-list items = ['Item 1', 'Item 2', 'Item 3']></array-list> but it is fine with you passing it in using javascript. That means that myList.items = ['Item 1', 'Item 2', 'Item 3']; does the job, fine.

So, how can we do that with a Vue.js array?

See the Pen by Joe Steinbring (@steinbring)
on CodePen.

It is the same thing except you need to set the value of the list in an onMounted() lifecycle hook.

What about if we want to do it with React?

See the Pen by Joe Steinbring (@steinbring)
on CodePen.

With React, you just set the value in a useEffect() React hook.

https://jws.news/2024/how-to-pass-an-array-as-a-property-into-a-web-component/

#JavaScript #Lit #React #VueJs #WebComponents

box464, to javascript
@box464@mastodon.social avatar

about computed functions and refactored a bit of code.

Mastodon filters are complete - my little won't have a notification or account profile feed, so those aren't going to be added. Needs a bit of testing.

Also, I used for the first time as a development partner...and...I found it extremely helpful while learning something new.

I get that it's not 100% accurate but it's a constant, calm partner that doesn't get annoyed with all my questions. 😄

tiberiuichim, to react

So now, it's no longer , no longer or but . Do we jump on this hype train, or wait for the next one?

symfonystation, to drupal
@symfonystation@phpc.social avatar

The Composable Now event prior to DrupalCon Lille is very interesting. There are a variety of solutions. #Drupal #NextJS #VueJs Hosted by amazee.io

hms, to Nantes French
@hms@alentours.cc avatar

Les données de "temps réel" d'attente aux stations de transport en commun de sont (entre autres données) dispos en open data. De mon côté,
1/j'avais besoin d'une idée de projet pour me servir de base pour apprendre (et aussi par la même occasion) et
2/ J'en avais marre de poireauter 20 minutes pour un tram alors que je venais de galoper après le dernier.

J'ai donc bidouillé une petite appli en bien plus de temps (et en beaucoup moins bien) que requis par quelqu'un qui maitrise la techno.

Mais au final, c'est ici https://tantan.hms.bzh/

L'idée est qu'on a accès au temps d'attente pour une station, une ligne, dans une direction, sans avoir à être à l'arrêt. La source est a priori la même que celle utilisée pour afficher sur les panneaux aux stations, ça n'est donc pas dispo pour tout les arrêts. Je ne sais pas si c'est utile à quelqu'un d'autre qu'à moi mais si jamais, je suis preneur de retours.

nhoizey, to javascript French
@nhoizey@mamot.fr avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • cisconetworking
  • magazineikmin
  • thenastyranch
  • InstantRegret
  • tacticalgear
  • Youngstown
  • khanakhh
  • slotface
  • ngwrru68w68
  • rosin
  • ethstaker
  • kavyap
  • DreamBathrooms
  • anitta
  • mdbf
  • everett
  • Durango
  • cubers
  • vwfavf
  • osvaldo12
  • GTA5RPClips
  • Leos
  • normalnudes
  • modclub
  • tester
  • provamag3
  • JUstTest
  • All magazines