Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
prom candy
Dec 16, 2005

Only I may dance
I think a lot of javascript bashing is pretty silly but it does kind of suck that in the span of half an hour we all just got recommended four different third party libraries for dealing with Date/Time functions.

Adbot
ADBOT LOVES YOU

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

prom candy posted:

I think a lot of javascript bashing is pretty silly but it does kind of suck that in the span of half an hour we all just got recommended four different third party libraries for dealing with Date/Time functions.

Counterpoint: Dates and times are awful in all languages.

prom candy
Dec 16, 2005

Only I may dance
True but at least we can converge on one set of awful tools

Capri Sun Tzu
Oct 24, 2017

by Reene

Munkeymon posted:

Mutability weirdness. https://www.npmjs.com/package/js-joda is the better one IIRC
Can you go into a little more detail? I've got a few projects using moment that I might look at switching over.

Ahz
Jun 17, 2001
PUT MY CART BACK? I'M BETTER THAN THAT AND YOU! WHERE IS MY BUTLER?!

Capri Sun Tzu posted:

Can you go into a little more detail? I've got a few projects using moment that I might look at switching over.

I would use moment again if I had to, but I would be a lot more strict in how I use it considering it's pretty easy to get tripped up by functions which modify in-place vs return which moment likes to have.

I would avoid moment if I could avoid using any time date lib at all.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Capri Sun Tzu posted:

Can you go into a little more detail? I've got a few projects using moment that I might look at switching over.

Does https://momentjs.com/docs/#/manipulating/utc-offset/ mutate the original? Can you be sure without setting up an example and scrutinizing everything in the debugger? Can you tell I've been there and done that :v:

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
I use moment, but the other thing I do is aggressively avoid ever touching the transport format until the absolute last moment (hah), so most of what’s travelling around my app are ISO format strings until I need to format them for human consumption or calculate against them. Feels like a reasonable policy at least.

Wouldn’t mind trying out a proper immutable date library.

geeves
Sep 16, 2004

Munkeymon posted:

Mutability weirdness. https://www.npmjs.com/package/js-joda is the better one IIRC

Besides immutability, JSJoda is also nice if you work with Java/Scala/Kotlin as its implementation matches Joda Time (it's being written by the same author) which became Java's official java.time package as of Java 8.

There's still a lot to be completed with JSJoda, however it is still a great library.

Honest Thief
Jan 11, 2009
I'm looking to make a switch from Chrome to FFox as my default working browse, anyone got some list of really useful extensions for frontend work? Cookie editors, or maybe some DOM change inspectors and auditors?

What's a good way to log/audit and see async or deferred scripts in action? I want to test an hypothesis where I load a Preact bundle after the initial DOM is loaded, with a placeholder for the eventual component to latch onto, and see the performance differences.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
Posting in appreciation of js-joda. It's got a few, what feels like, weird ways of going about things if you're trying to calculate a specific date or time. But it is infinitely clearer in practice than a similar solution provided by moment.

Moment does internationalisation though.

lordfrikk
Mar 11, 2010

Oh, say it ain't fuckin' so,
you stupid fuck!
I haven't really paid attention to front-end development since 2010 or so and getting back into it now is pretty mind-blowing. Just trying to set up webpack to do more than basic stuff reminds me really strongly of modding a Bethesda game, spending two days trying to get all the crap working together and zero time of actually playing the game. Setting up webpack to serve your css is like a few seconds of googling plus writing code but I still haven't figured out how to make it do transformation from Sass AND not inject it directly into the bundle. I think their official docs are pretty poo poo because even though they have sections on individual loaders a lot of times it's hard to understand exactly what is the specific loader doing.

Anyway, I work as a tech writer/information developer we got buttload of C/C++ files with doc blocks plus some texts written in Markdown which right now need to get commited to git, compiled by running a job in Jenkins and then depending on the purpose for example commited to git of our website and ran through another Jenkins job. While the pipeline could definitely be improved and is something I already brought up, I just wanted to do away with compiling the files that contain most of the text, that is the markdowns.

My proof of concept is a very basic SPA that just loads a JSON file telling the app of the different versions of our docs in different directories. Each of those has another JSON file that has the table of contents with filenames. I use that to build the sidebar menu and the files are just loaded directly via JavaScript and injected into a page.

Tell me if I'm completely dumb.

Knifegrab
Jul 30, 2014

Gadzooks! I'm terrified of this little child who is going to stab me with a knife. I must wrest the knife away from his control and therefore gain the upperhand.
I am a complete idiot when it comes to responsive design. Like I know how to leverage bootstraps grid system but beyond that I am helpless. Does anyone have any go-to bog-standard responsive design stuff I can look into. I am thinking about making a family friend a website for their business but I don't want it to suck dick and while I consider myself pretty good at layout/style/design I am still poo poo at responsiveness.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense

lordfrikk posted:

My proof of concept is a very basic SPA that just loads a JSON file telling the app of the different versions of our docs in different directories. Each of those has another JSON file that has the table of contents with filenames. I use that to build the sidebar menu and the files are just loaded directly via JavaScript and injected into a page.

Tell me if I'm completely dumb.

You're doing everything the modern way. Which is to serve a static page that loads what it needs via JSON and then dynamically builds the DOM live on the client side. It sounds like you're on the right track if you're a hipster.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
I'm at a weird time in my life where I cannot decide between having lots of spinners for all the different things that load everywhere. Or whether there should be one single spinner somewhere always at the same place on the page. Then just have a value that counts up and down the number of different things that are loading to decide whether the spinner should be spinning.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

Nolgthorn posted:

I'm at a weird time in my life where I cannot decide between having lots of spinners for all the different things that load everywhere. Or whether there should be one single spinner somewhere always at the same place on the page. Then just have a value that counts up and down the number of different things that are loading to decide whether the spinner should be spinning.
Does any particular thing take far longer than others to load?

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Nolgthorn posted:

I'm at a weird time in my life where I cannot decide between having lots of spinners for all the different things that load everywhere. Or whether there should be one single spinner somewhere always at the same place on the page. Then just have a value that counts up and down the number of different things that are loading to decide whether the spinner should be spinning.

The latter would annoy me. Why can't I see and interact with the chunks that are loaded and ready?

Doom Mathematic
Sep 2, 2008

Nolgthorn posted:

a value that counts up and down the number of different things that are loading

I think you may have just reinvented the loading bar?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Knifegrab posted:

I am a complete idiot when it comes to responsive design. Like I know how to leverage bootstraps grid system but beyond that I am helpless. Does anyone have any go-to bog-standard responsive design stuff I can look into. I am thinking about making a family friend a website for their business but I don't want it to suck dick and while I consider myself pretty good at layout/style/design I am still poo poo at responsiveness.

Make your window 320px wide and add your content. Make it look good. Then, make your window wider and wider until things look stupid. There’s your first breakpoint. Add css in media queries until it stops looking stupid. Now make your window wider and wider, and if it looks stupid again, decide if you want another breakpoint or just a max width. Congratulations, you are a responsive wizard!

Honest Thief
Jan 11, 2009
Don't forget to add specific media queries for elements that don't line up properly, the "it's only this time" rule, and then have a cascade of unmanageable css files

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense

Doom Mathematic posted:

I think you may have just reinvented the loading bar?

I like the idea of websites using a permanent loading bar across the top of the page, that empties when there are things to load. I also think web browsers should do a similar thing or replace the need for on-page spinners/loading bars altogether.

Embrace the modern skinny jeans web, Chrome.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Nolgthorn posted:

I like the idea of websites using a permanent loading bar across the top of the page, that empties when there are things to load. I also think web browsers should do a similar thing or replace the need for on-page spinners/loading bars altogether.

Embrace the modern skinny jeans web, Chrome.

I'm not searching for it now, but UX studies have shown those page top loading bars are confusing for users for some reason.


A single spinner located somewhere on the page indicating that something somewhere on the page is also confusing for the user. Proximity to whatever content is loading is important.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Thermopyle posted:

I'm not searching for it now, but UX studies have shown those page top loading bars are confusing for users for some reason.

Probably because the browser has a universal 'this thing is loading' indicator already? It's like when a design includes a back button in the page. Why? What the gently caress is that supposed to do that isn't already done for us?

quote:

A single spinner located somewhere on the page indicating that something somewhere on the page is also confusing for the user. Proximity to whatever content is loading is important.

This is also important for accessibility. The indicator has to be as close as possible to or inside the thing you just interacted with to cause it to appear.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
As we move further into the realm of static pages that download dynamic content after they load, the loading indicator in the browser has become somewhat irrelevant. Even just loading js/css assets is gone now, as those are often loaded dynamically too.

We're one step away from images being loaded the same way video is... or maybe a script downloads it, displays after it loads.

duz
Jul 11, 2005

Come on Ilhan, lets go bag us a shitpost


Munkeymon posted:

It's like when a design includes a back button in the page. Why? What the gently caress is that supposed to do that isn't already done for us?

The answer I get every time I ask in response to the request to add one is that users aren't used to clicking on anything not on the web site. Which is stupid and of dubious truthfulness. Then they ask that the cancel button the page function a reset button since now there's a back button.


Nolgthorn posted:

We're one step away from images being loaded the same way video is... or maybe a script downloads it, displays after it loads.

Isn't that basically what infinite scrolling sites like Pintrest do?

Black Is Black
Jan 6, 2007

My team has been up to some sneaky stuff in our company and we ended up with an open-source React component library. I'd love to get some feedback on it or even some Github stars if you like it:

https://mineral-ui.com

https://github.com/mineral-ui/mineral-ui

-Anders
Feb 1, 2007

Denmark. Wait, what?
I'm starting to learn some JavaScript with NodeJS right now, and when I'm good with the backend stuff I'm going to move on to some frontend framework/library.
So which do I go with? I'm looking between Vue, Angular and React. Vue seems like the simplest to get going with, but I dunno? What do you lot think?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

-Anders posted:

I'm starting to learn some JavaScript with NodeJS right now, and when I'm good with the backend stuff I'm going to move on to some frontend framework/library.
So which do I go with? I'm looking between Vue, Angular and React. Vue seems like the simplest to get going with, but I dunno? What do you lot think?

We lot tend to recommend one of those three. Personally I love React + Redux for state management, but any of the three are solid.

But pick React.

canoshiz
Nov 6, 2005

THANK GOD FOR THE SMOKE MACHINE!
Vue is probably the easiest to pick up, React is the most currently marketable, and Angular is fairly well established.

I'd also go with React.

dupersaurus
Aug 1, 2012

Futurism was an art movement where dudes were all 'CARS ARE COOL AND THE PAST IS FOR CHUMPS. LET'S DRAW SOME CARS.'
I've had some fun with Aurelia. But I'm also making myself learn React...

Cirofren
Jun 13, 2005


Pillbug
If job listings are anything to go buy, you want React.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!
It's me, I'm the idiot using Angular :(

prom candy
Dec 16, 2005

Only I may dance

Black Is Black posted:

My team has been up to some sneaky stuff in our company and we ended up with an open-source React component library. I'd love to get some feedback on it or even some Github stars if you like it:

https://mineral-ui.com

https://github.com/mineral-ui/mineral-ui

Why'd you guys decide to do this, and what sets it apart from other component libraries? We have good in-house designers at my agency but I'd really love to start new projects from some kind of common component library instead of having to build buttons from scratch every time we start a new project. "Hey designer, what do you want for the focus state on this button" is a conversation I'm kind of tired of having.

Edit: Follow up question for the thread: what tools do you use to collaborate with your designers? Do they write any code? How do you get them thinking in a component/interactive mindset if they design using tools like Sketch?

Ruggan
Feb 20, 2007
WHAT THAT SMELL LIKE?!


prom candy posted:

Why'd you guys decide to do this, and what sets it apart from other component libraries? We have good in-house designers at my agency but I'd really love to start new projects from some kind of common component library instead of having to build buttons from scratch every time we start a new project. "Hey designer, what do you want for the focus state on this button" is a conversation I'm kind of tired of having.

Edit: Follow up question for the thread: what tools do you use to collaborate with your designers? Do they write any code? How do you get them thinking in a component/interactive mindset if they design using tools like Sketch?

In my development, I like to take the approach of throwing poo poo at a canvas and seeing what sticks. I don’t even think most of my coworkers know what a focus state is.

disclaimer: my core job function is warehousing data and analytics

-Anders
Feb 1, 2007

Denmark. Wait, what?
Thanks for the advice on frameworks. Sounds like react is the way to go. Udemy was having a sale so I purchased a few courses on there, for all the three major frameworks so I can read up on whatever I need. :3:

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

-Anders posted:

Thanks for the advice on frameworks. Sounds like react is the way to go. Udemy was having a sale so I purchased a few courses on there, for all the three major frameworks so I can read up on whatever I need. :3:

Definitely get a solid understanding of Javascript (ES6) first though. Don't just dive into a framework immediately. That will make you a developer with bad habits.

-Anders
Feb 1, 2007

Denmark. Wait, what?

Grump posted:

Definitely get a solid understanding of Javascript (ES6) first though. Don't just dive into a framework immediately. That will make you a developer with bad habits.

Oh don't worry, this is for later. I just wanted to pick up some training courses while they were on sale for the holidays. :)

So far I'm pretty good with stuff like getting stuff in/out with JSON, using arrow functions for anonymous functions. Later today I'll have a go at async/await, just following along a pretty good course. It's primarily aimed at node.js, but all the entirely basic stuff like what functions are for and conditionals I know from earlier so that's a breeze so far.

-Anders fucked around with this message at 12:25 on Dec 8, 2017

Ruggan
Feb 20, 2007
WHAT THAT SMELL LIKE?!


-Anders posted:

Oh don't worry, this is for later. I just wanted to pick up some training courses while they were on sale for the holidays. :)

So far I'm pretty good with stuff like getting stuff in/out with JSON, using arrow functions for anonymous functions. Later today I'll have a go at async/await, just following along a pretty good course. It's primarily aimed at node.js, but all the entirely basic stuff like what functions are for and conditionals I know from earlier so that's a breeze so far.

One thing I’ve found very helpful was to mess with arrays and object hashes, because while the contents can be the same, manipulating them effectively requires different treatment. Then, once you feel the pain of doing it correctly, introduce functions from lodash which solve these problems entirely.

Screeps is pretty good for this, actually. I never really got into it, but I did walk away with better programming skills, even from a brief stint.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

prom candy posted:

Edit: Follow up question for the thread: what tools do you use to collaborate with your designers? Do they write any code? How do you get them thinking in a component/interactive mindset if they design using tools like Sketch?
We use the aforementioned Sketch as well as Zeplin
They don't write code, with the exception of modifying CSS via Stylus. That helps them play around with global changes before even giving it to us in Dev.
Getting into the component mindset I think was largely from a push from the UX team here. Start with basic things like h1 then up to button, eventually going to custom elements. Maybe letting them know it'll be more consistent from a brand standpoint will help? Has there been any particular pushback?
Sketch has "libraries" so it is possible to do components in Sketch.

Pollyanna
Mar 5, 2005

Milk's on them.


The designer/product owner I work with - same person - uses Zeplin and sometimes gives me Sketch files, but doesn't give me any actual hard numbers - she expects me to extrapolate it from the designs themselves, and then comes back with a list of (tweaks i.e. pixels and font sizes) to be made after I put the PR up (or the equivalent of a PR in our case). Tickets inevitably take longer to complete as a result :shepface:

I don't know what the proper way to work with a non-technical designer is for a web developer who touches CSS, Javascript, and numbers. If only Zeplin/Sketch had the sizes, fonts, etc. embedded in them - but then wouldn't it just be CSS?

Adbot
ADBOT LOVES YOU

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

Pollyanna posted:

The designer/product owner I work with - same person - uses Zeplin and sometimes gives me Sketch files, but doesn't give me any actual hard numbers - she expects me to extrapolate it from the designs themselves, and then comes back with a list of (tweaks i.e. pixels and font sizes) to be made after I put the PR up (or the equivalent of a PR in our case). Tickets inevitably take longer to complete as a result :shepface:

I don't know what the proper way to work with a non-technical designer is for a web developer who touches CSS, Javascript, and numbers. If only Zeplin/Sketch had the sizes, fonts, etc. embedded in them - but then wouldn't it just be CSS?
If it's inefficient, tell her that you need more documentation and specs before you start, since you always run into this situation of tickets afterwards. Is this something that a Style Guide would help with? (i.e. all <p> are this color, size, margin, etc). When you get the tickets in, maybe ask "Why" it needs to be that way. Not in a manner of questioning her design, but maybe if you figure out her "Why" you can figure out reusable patterns? Those reusable patterns benefit you both.

The designer/product owner being the same person seems like its own issue...

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply