« first day (4283 days earlier)      last day (657 days later) » 

7:03 AM
this.dataColumns.columns
    ? (this.theDataColumns = this.dataColumns)
    : (this.theDataColumns = this.defaultColumns);
FFS, I posted this because I hate it. I was just about to comment how this should have been a normal if
Also, naming is supreme theDataColumns
And then I look at the code again and...let me just post the entire block because it's ridiculous
this.dataColumns.columns
	? (this.theDataColumns = this.dataColumns)
	: (this.theDataColumns = this.defaultColumns);
if (this.dataSourceQueryParameters.size === 0 && this.referenceType && this.referenceUid)
	this.theDataSourceQueryParameters = this.queryParameters;
else this.theDataSourceQueryParameters = this.dataSourceQueryParameters;

this.theBatchDeleteParameters = this.batchDeleteParameters;
if (this.useQueryParametersAsBatchDeleteParameters) this.theBatchDeleteParameters = this.queryParameters;
 
@VLAZ šŸ˜‚ naming is supreme
 
@HarunaOseni Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
So, there are three different ways to either take some values or use defaults
 
8:01 AM
Is it just me or is there a proliferation of reactjs newbies that seem to know nothing about javascript, let alone react :p
 
@JaromandaX Just React getting more popular. jQuery had the same problem before.
But yes, it's quite annoying. "How do I loop in react" or "how do I sort array in react". Surely upcoming soon "Add a number to another number in React"
 
@VLAZ good point - seems more peeps are jumping straight to reactjs without knowing a thing about the JS part
 
Or knowing much if anything about programming.
 
@VLAZ yeah ... common for jquery
@VLAZ they read somewhere that you can make money using a reactjs app that is "the next best thing"
 
Yeah. A friend of mine complained about this. He needed to hire a frontend dev and was interviewing people. The codebase they had is React but the job ad didn't require that, specifically (basically any framework but preferred to be React). Two separate people showed up with 1+ year React experience in their CV. At the interview they said they just got some quick course in React and one didn't even have 1 year frontend experience.
I'm meaning to pick up React...uh, at some point. It's on my backlog.
However, it doesn't seem that complex. The questions I see posted on SO are solvable with just JS knowledge. And maybe a quick look in the docs.
Well, a lot of them, at least.
 
8:28 AM
When I calculate 0.1 + 0.2, why does it not result in 0.3.. in React?
 
I'm pretty sure I've seen that question. Well, not exactly but essentially the same "why does React show me strange result" or something similar is how it was asked.
 
eww
 
There is also a bunch of questions that have no actual React code at all but are tagged with React. "Why doesn't my if work" and it's just something like if (x == 1 || 2) for example. Or whatever. It's just plain JS.
Went to find an example. The second most recently posted question tagged React: Create a string from array of operators and operands
Also has for good measure. It's just some JS code that produces a string. Presumably for SQL...
The only good thing about this is that the answers don't just go "use React". Unlike how it was with jQuery where somebody asks a basic question and gets maybe three answers using jQuery and jQuery isn't even needed.
 
@VLAZ ye, it's gotten better over the last years tho. I've often seen questions where there are anwsers for both jQuery and VanillaJS for most things.
 
Yep. jQuery is slowly sliding away from popularity. Which isn't a bad thing.
 
9:21 AM
@VLAZ I skipped react went straight to vue and haven't looked back :p
 
9:32 AM
@VLAZ I used to work with coders that loved jQuery ... even using jQuery.each when array.forEach was available on anything newer than IE8 (this was 10 years ago)- one page I converted $.each to [].forEach went from taking over 3 seconds to load to loading instantly
 
Currently working with Vue at work. I like it a lot. It's a neat idea. I used with Knockout in the past and I immediately recognised most stuff in Vue from KO but done better.
I'm still interested in React due to the one-directional data flow it does. I think that's also a neat idea.
 
 
4 hours later…
1:37 PM
are sidebars nowadays "bad" ?
I hardly see them used anymore in modern websites. however whenver I think of something I immediatelly create one.
IE for a webapp to modify router settings, I use the sidebar for nearly all navigation, and I have a hard time thinking of using top bar - on mobile the width wouldn't work out right?
 
are you talking about a dynamic sidebar, that can be expanded/opened at left?
or just a left pane?
 
well would be dynamic given the screen dimensions
 
I still see that here and there yes. It depends of website
but ... I believe the problem is that people is not aware of its availability. I've experienced people asking for directions in a CRM and got lost at "click on side menu X" because it's hidden as a side pane. Over time, we removed it ...

Another reason: apparently it makes mobile web dev more difficult - according to the front-end dev I 've worked with
 
1:58 PM
hmm but how would you then hide the many menus like package information panels etc.
Should I no longer follow the principle that everything should be findable through the menus (sidebars+topbars) and make certain views only available by clicking into a menu and then clicking things like "advanced .... even more advanced"?
I see quite a few sites doing that nowadays, but it actually gives me as a semi active user more annoyances: "I knew that page is visible somewhere, I just can't find the page anymore".
there are alow practical problems: should sidebars scroll with the text or stay on top? Especially in desktop layout where sidebars don't overlap but rather push the text. Scrolling just the text sometimes feels kind of claustrophobic. But scrolling the sidebar with the text leaves a weird empty column
 
2:20 PM
@paul23 the main navigation is visible, children are expansible
and ... a search tool on top that searches through it
matches are shown, with extra detail, non-matches grayed out / hidden.
A thing I liked from JIRA or ClickUp is a feature to have the sidebar collapsible, changing the text menu's to an icon based one.
This concept only works if you don't have submenu I think.
not so super into web design :)
 
@paul23 in my experience, these days menus are done mostly as a topbar with "dropdowns" for relatively wide viewports and are switched to hamburger menus with media queries when the width gets small enough. Sidebars, on the other hand, are a rare sight, yeah (who would've known, though, that Chrome will put bookmarks in a sidebar view recently, though?)
 
"hamburger menu"?
gotcha google that
TIL these icons have names
 
@KarelG I was really confused the first time I saw the name because not only did I not know what it referred to, I found it in an article posted on the 1st of April that jokingly said that hamburger menus are being replaced with pizza menus. Only it wasn't the 1st of April when I stumbled upon that - it was months after.
And the article said something like "Everybody knows the hamburger menu". And I sit there with a blank stare.
 
I managed to have smartcrop.js paste.ofcode.org/HBEEyxMpQf3URPrCaA4X7w working, but it cropped a 2042px by 1443px to 23px by 17px. I'm I missing something?
 
2:36 PM
sounds like you're passing the wrong parameters to smartcrop
 
Look, Captain Obvious is there!
 
@KarelG huh, the first time I heard the name, I was "oh, so that's how those horizontal lines are called!" too :)
 
@simanacci are you sure it's caused by smartcrop? According to the doc you're using it right. Me thinks the problem is what you're doing with the output
 
<img id="profile-photo" src="https://test.s3.amazonaws.com/profile_photo/680b258f01204e8184c2b8a8d2bc8df5.jpg" alt="Photo" style="width: 23px; height: 17px;">
I've added values from this result.
 
2:53 PM
Hmm, looks like the code itself is, indeed, correct, at least according to the docs
 
3:07 PM
I'm out - have a nice weekend everyone
 
o/
 
In the past, MockJax was a brilliant little library: It'd intercept AJAX requests, so you'd define an which path you want to fake and MockJax would transparently (for the page code) handle that request and return a mock response. I was very fond of it. However, it only works with jQuery. Is there anything similar that works with Axios, by any chance?
I'm looking to be able to implement the all the logic that requires some remote data without having the remote endpoint up yet. And then later just disable the mocking when the endpoint is there.
 
3:52 PM
Why I am trapper in infinite loop
  // Check if user is logged in and set user data to persist state between page reloads
  useEffect(() => {
    const unlisten = auth.onAuthStateChanged((user) => {
      if (user) {
        dispatch(setUser(user));
      }
    });
    return () => {
      unlisten();
    };
  }, []);
Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.
 
4:10 PM
something you are doing inside the function is causing the function to be retriggered
 
Yes, I found what's the issue
 
 
2 hours later…
6:07 PM
Do you have experience with Firebase 9 ?
import { initializeApp } from "firebase";
import { getAuth } from "firebase/auth";
import { getFirestore } from "firebase/firestore";

const firebaseConfig = {
  apiKey: process.env.REACT_APP_FIREBASE_API_KEY,
  authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN,
  projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID,
  storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET,
  messagingSenderId: process.env.REACT_APP_FIREBASE_MESSAGING_SENDER_ID,
  appId: process.env.REACT_APP_FIREBASE_APP_ID,
 
9? didn't know it had versions that mattered
 
I am trying
Compiled with problems:X

ERROR in ./src/firebase.js 16:12-25

export 'initializeApp' (imported as 'initializeApp') was not found in 'firebase' (possible exports: default)


ERROR in ./src/firebase.js 18:20-27

export 'getAuth' (imported as 'getAuth') was not found in 'firebase/auth' (module has no exports)


ERROR in ./src/firebase.js 20:18-30

export 'getFirestore' (imported as 'getFirestore') was not found in 'firebase/firestore' (module has no exports)
yes, it's very different from version 8
 
i'd hazard a guess that the version isn't relevant to those kinds of errors
All three of your imports are failing
 
Yes
because of version 9
imports are not good
 
did you pull that from docs somewhere?
 
Are you sure you're running version 9?
 
Oh shit
Sorry
"firebase": "^8.10.1",
 
šŸ˜
 
but I will update
Maybe will be funny, but I am using Git Copilot for adding a new document to database collection
And that's the reason why it's not working :D
export const createLocation = (location) => {
  return async (dispatch) => {
    try {
      // Create a new location in the database
      await db.collection("locations").add(location);
      dispatch(
        showNotification({
          message: "Location has been successfully created",
          type: "success",
        })
      );
    } catch (error) {
      dispatch(
        showNotification({
          message: error.message,
          type: "error",
        })
      );
    }
  };
};
`_firebase__WEBPACK_IMPORTED_MODULE_2__.db.collection is not a function
`
I am learning firebase and I am not sure how to add a new document
 
7:17 PM
Say is there anywhere a list I can read up on on different ways user authentication and session managment is "modernly" done (e.g. on a single page app using an app token with a session key stored in local storage instead of using cookies or something (something I just came up with on the spot as an example that isnt "use a cookie")
 
well
there's multiple pieces
and you can mix-and match many of them
where to store the token, is a piece
the format of the token, is another
how it's passed around is one
how it is obtained
 
7:32 PM
Uhm that was really just a draw out of an imaginary hat about how this specific case is done without cookies
Thats why I want to know more about the principles yet if I google the topic I do not really find stuff that reads statisfyingly without also making big advertisement for some kind of framework solution
 
7:50 PM
One question
why url value from .env file returns undefined every time ?
REACT_APP_FIREBASE_DATABASE_URL
 
8:01 PM
I don't understand
Why it's not supported
 
 
4 hours later…
11:46 PM
 

« first day (4283 days earlier)      last day (657 days later) »