New around here? Register your SA Forums Account here!

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
Corla Plankun
May 8, 2007

improve the lives of everyone
i feel like a lot of webdev problems could be avoided if they just accepted that worse browsers deserve worse experiences

Adbot
ADBOT LOVES YOU

Aramoro
Jun 1, 2012




Just make it a spinner, it's done when it's done.

Shaggar
Apr 26, 2006

Corla Plankun posted:

i feel like a lot of webdev problems could be avoided if they just accepted that worse browsers deserve worse experiences

the most popular browsers are the worst so you have to be ok w/ limiting ur reach

Shaggar
Apr 26, 2006
but the problem really isn't browsers, its entirely that js is trash by and for trash people

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Aramoro posted:

Just make it a spinner, it's done when it's done.

it has been a spinner for 5 years, i wanted to give the user a progress indicator for the initial load, because how hard can it be?

turns out, web """""development"""""'s gonna web """""develop"""""

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Corla Plankun posted:

just check for chrome and divide progress by two & jump to 100% when done if it exists

now we're talking

Shaggar posted:

but the problem really isn't browsers, its entirely that js is trash by and for trash people

shaggar was right

Aramoro
Jun 1, 2012




Corla Plankun posted:

just check for chrome and divide progress by two & jump to 100% when done if it exists

Workout the response compression ratio and add it as a header to the response and use that to scale the progress bar. Now you're webdeving.

gonadic io
Feb 16, 2011

>>=

Aramoro posted:

Workout the response compression ratio and add it as a header to the response and use that to scale the progress bar. Now you're webdeving.

Yeah I was going to say, have the server send the uncompressed size in a header. Or just remove all compression lol

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
probably the easiest "fix" would be to precompress all our files, calculate the average compression ratio and then if(isChome) bytesReceived = bytesReceived * chomeRatio. the progress bar would probably only be off by a few percent. and would give a reasonable approximation of the remaining loading time :thunk:

akadajet
Sep 14, 2003

Wheany posted:

it has been a spinner for 5 years, i wanted to give the user a progress indicator for the initial load, because how hard can it be?

turns out, web """""development"""""'s gonna web """""develop"""""

turns out wheany is whiny

Plorkyeran
Mar 21, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

CRIP EATIN BREAD posted:

yeah but you get flexibility then. all you need to do is just write your own utility to wrap all that for you and boom, it works just like before.

seems pretty straightforward to me.

what if i told you that it's possible to make a flexible api without making common basic use-cases garbage

Bloody
Mar 3, 2013

jk

Bloody fucked around with this message at 18:13 on May 14, 2019

Zlodo
Nov 24, 2006

Wheany posted:

probably the easiest "fix" would be to precompress all our files, calculate the average compression ratio and then if(isChome) bytesReceived = bytesReceived * chomeRatio. the progress bar would probably only be off by a few percent. and would give a reasonable approximation of the remaining loading time :thunk:

lol that with all the frameworks and inept crap that webdevs poo poo out every week the problem of displaying an accurate loading bar isn't solved

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Plorkyeran posted:

what if i told you that it's possible to make a flexible api without making common basic use-cases garbage

there's no good API written in javascript so you're not losing anything on that front.

Corla Plankun
May 8, 2007

improve the lives of everyone

Aramoro posted:

Workout the response compression ratio and add it as a header to the response and use that to scale the progress bar. Now you're webdeving.

train a deepdense CNN to predict the file size based on stock market and meteorological data and inject it into the page with tensorflow.js

CPColin
Sep 9, 2003

Big ol' smile.

CRIP EATIN BREAD posted:

there's no good API written in javascript so you're not losing anything on that front.

I dunno, parts of the DOM API work okay:

JavaScript code:
document.querySelectorAll("td.userid-28956").forEach(post => post.parentNode.parentNode.parentNode.removeChild(post.parentNode.parentNode))

Bloody
Mar 3, 2013

im the parentNode

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.

CPColin posted:

I dunno, parts of the DOM API work okay:

JavaScript code:
document.querySelectorAll("td.userid-28956").forEach(post => post.parentNode.parentNode.parentNode.removeChild(post.parentNode.parentNode))

:lol:

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
post.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode

Plorkyeran
Mar 21, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

CRIP EATIN BREAD posted:

there's no good API written in javascript so you're not losing anything on that front.

the thing which that pile of garbage for fetch() is replacing is the following: xhr.onprogress = (e) => console.log(`${e.loaded / e.total * 100.0}% done`)

xmlhttprequest on the whole is not great but that's a pretty reasonable and good way to expose download progress. forcing you to implement a general-purpose stream transformer just to get progress information is not.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Plorkyeran posted:

the thing which that pile of garbage for fetch() is replacing is the following: xhr.onprogress = (e) => console.log(`${e.loaded / e.total * 100.0}% done`)

xmlhttprequest on the whole is not great but that's a pretty reasonable and good way to expose download progress. forcing you to implement a general-purpose stream transformer just to get progress information is not.

but i mean, you implement a wrapper once, that does the work for you, and you can use it.

you don't have to copy/paste the implementation every time, and the flexibility lets library authors put their own stuff together.

i guess you're coming from the world where every little trivial thing is supplied in one of 10,000 dependencies in your node_modules but you'll be shocked to learn you can implement some of this stuff yourself!

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.
I agree that a stream transformation seems relatively complicated for getting response progress
I agree that you'll probably write that once and reuse it with low if indeed any effort.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

CRIP EATIN BREAD posted:

but i mean, you implement a wrapper once, that does the work for you, and you can use it.

you don't have to copy/paste the implementation every time, and the flexibility lets library authors put their own stuff together.

i guess you're coming from the world where every little trivial thing is supplied in one of 10,000 dependencies in your node_modules but you'll be shocked to learn you can implement some of this stuff yourself!

yeah that’s true a really good counterpoint to “maybe this api should actually be useful” is “just work around it what are you a baby”

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
okay, so i implemented the stream processor.

it loving measures progress in uncompressed bytes holy loving poo poo :suicide:

Plorkyeran
Mar 21, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

CRIP EATIN BREAD posted:

but i mean, you implement a wrapper once, that does the work for you, and you can use it.

you don't have to copy/paste the implementation every time, and the flexibility lets library authors put their own stuff together.

i guess you're coming from the world where every little trivial thing is supplied in one of 10,000 dependencies in your node_modules but you'll be shocked to learn you can implement some of this stuff yourself!

or instead of making literally every person who ever uses a lovely api have to write a wrapper to make it vaguely acceptable, you could just make an api that isn't poo poo to begin with

gonadic io
Feb 16, 2011

>>=

Wheany posted:

okay, so i implemented the stream processor.

it loving measures progress in uncompressed bytes holy loving poo poo :suicide:

loving l m a o

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
also, i was doing this for the bootstrap script, which loads the actual (several megabytes uncompressed) application script files. currently it just creates script tags and lets them load in the background while the browser shows a spinner using a css animation.

i wanted to use the browser's native functions so that the script remains as lean as possible

HoboMan
Nov 4, 2010

speaking of webdev crosspost from cjs thread:
cjs: could hear very friendly, soft-spoken, and well mannered co-worker forced to work on webdev lament quitely in the next cube over "hell! i've gone to hell! why won't you work you piece of poo poo?"

Shaggar
Apr 26, 2006

Wheany posted:

okay, so i implemented the stream processor.

it loving measures progress in uncompressed bytes holy loving poo poo :suicide:

I betchu fetch is implemented w/ xhr

redleader
Aug 18, 2005

Engage according to operational parameters
lol if you trust any webdevs to correctly reimplement anything on top of a low level stream api

HoboMan
Nov 4, 2010

redleader posted:

lol if you trust any devs to correctly reimplement anything

ftfy

redleader
Aug 18, 2005

Engage according to operational parameters

Wheany posted:

okay, so i implemented the stream processor.

it loving measures progress in uncompressed bytes holy loving poo poo :suicide:

at least you can now submit a bug report that might get fixed since there's no backcompat issues because no one uses fetch

HoboMan
Nov 4, 2010

does anyone know what im supposed to do if i still want to display my component in angular despite not reciving data for my bindings?

Aramoro
Jun 1, 2012




HoboMan posted:

does anyone know what im supposed to do if i still want to display my component in angular despite not reciving data for my bindings?

I'm not sure what you mean. Like you want a blank component to show up despite having no data or the data not loaded yet?

Shaggar
Apr 26, 2006
idk about angular specifically, but generally for that kind of thing you use an empty model and then fill the model when the data arrives. as the model is updated with data the bindings should refresh the UI.

HoboMan
Nov 4, 2010

Aramoro posted:

I'm not sure what you mean. Like you want a blank component to show up despite having no data or the data not loaded yet?

yeah

currently it's crashing on the bindings if there is no input but i would like the input to be optional

i previously had the html for it wrapped in <div *ngIf="myData"></div>
but my component is an editable form and i would like have filling out a new form just be calling it with no data

HoboMan fucked around with this message at 20:39 on May 14, 2019

Bloody
Mar 3, 2013

is resharper/dotcover a pos or is it just just loving with me today

Bloody
Mar 3, 2013

like i want to cover my unit tests to see what poo poo is just completely untouched so i mash "cover unit tests" in the resharper test runner and the tests run and pass and then no coverage data shows up anywhere

Shaggar
Apr 26, 2006
i stopped using resharper after vs 2015 came out cause it was too much of a pain in the rear end and they refused to fix really annoying things that it did to break intellisense and code completion

Adbot
ADBOT LOVES YOU

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
gradle is loving piss trash garbage for rear end in a top hat fuckwads

and i'm an rear end in a top hat fuckwad this week :unsmigghh:

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