« first day (3708 days earlier)      last day (1465 days later) » 

00:09
@JBis really late to that party and maybe not relevant.. But what (and most importantly: where) do you mean tracking? Tracking has a different goal on automated systems like a backend or on UI systems like frontend.
@paul23 I meant on the backend. Do you have custom error classes or a single error class or what?
In our old application -which is sails and is based (and kept that way) on common js without import or modern features- we use a general try...catch:
also while you're here (and I may have asked you this), I've been reading up on ORMs and have seen quite a few people saying what you have said, however I'm also seeing some people say that Objection with knex is the perfect match because you get the benefits of an ORM (which is just barely an ORM, more of slight abstraction of knex) with the ability to query with knex directly when ORMs get in the way. Have you used objection + knex? What do you think?
    try{
      //code
        } catch (err) {
      return serverError(res, err);
    }

function serverReturnError(res: ResponseTy,  err: ErrorTy): void {
  if (err.name === 'ForbiddenError') {
    return res.forbidden({message: "Not enough rights", name: "Forbidden"});
  } else if (err.name === 'UsageError') {
    if (err.code === 'E_UNIQUE') {
      return res.status(409).json({
        name: err.code,
        message: err.message,
        details: {...err.detail, removed: !!err.detail.removed}
@paul23 ah, ok. Looks like a custom error with some extra stuff. Thanks!
00:16
In our new projects we use a similar "filthy" error handler function however it is hidden behind a middleware.
So not every route has to add try...catch clauses. But in the ned it's just custom stuff since we decide on "dumb" backend and have intelligent SPA frontend. Thus the frontend needs just the error code to decript and do something. (The logging is kept this way since it interacts with docker-logs and docker makes the console log already permanent)
We've tried automated libraries but those sometimes bleed internal information (like actual incremental id on db instead of a key-that-acts-as-id for user ids, which then could be used as vulnerability. To prevent this we decided not to use automation).
@paul23 this was one of my concerns
For a personal project I might consider a library - also to "learn" it and thus I could vouch for its safety later when I learned the internal workings a bit more.
"Have you used objection + knex? What do you think?" - yes I have, it's just a "when you need it you'll know it".
@paul23 there's definitely a question of who's responsibility it should be to generate the error messages. You can go with a code and have the frontend generate it (as you have), or just send the backend message and show it to the user. I kinda feel it makes more sense with error codes and have frontend generate error as the text is a "presentation" of the error
Big hint is: upserts with graph-upsert. Or fetching-with-graph. (Graph describes joins, but other than orm objection decides to make the graph/joins at each call).
@paul23 the graph stuff looked pretty cool
00:27
it is, once your join-statements get messy I'd look into objection. It does have some setup requirements by having to describe (reusable) graphs though.
The built in validation feature also looked like it MAY be useful
And to be frank: with knex alone join statements often get faster messy than with native sql....
Haven't looked into that at all yet.
Mostly since, again, we used objects as an add-on for knex. Yet for validation it only makes sense if you use it almost everywhere.
I just feel like, without a basic ORM I'm recreating the object mapping. With a bunch of many to many's it gets quite annoying.
@JBis sure. But that's the idea: you only create the "many to manys" that are actually used in code. Objection really works if you resist the urge to recreate everything, and use "YAGNI".
gtg but thanks for the help. Starting large project soon, want to make sure I plan it properly.
00:34
This allows you to create not only "many-to-many" relations but also "many-to-many-to-many" etc. Where you fully describe a graph with more than one depth of indirection for the fetch/insert (IE: update field "whatever" in an event, from an organization from the current logged in user).
In a traditional ORM this would be "too much" to describe and they hence typically limit you to one layer of indirection with the object description. (Otherwise the type-interference would explode exponentially)
01:05
 
1 hour later…
02:05
posted on December 10, 2020 by Krishna Govind

Hi everyone! We've just released Chrome Beta 88 (88.0.4324.38/39) for Android: it's now available on Google Play. You can see a partial list of the changes in the Git log. For details on new features, check out the Chromium blog, and for details on web platform updates, check here. If you find a new issue, please let us know by filing a bug. Krishna Govind Google Chrome

 
5 hours later…
06:59
@Shahid Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
@Shahid 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.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
@Shahid Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
This is the code and i also want to get form data in this function
07:37
Hello folks, have a quick question to react users. can I use in jsx <span/> as self closing tag?
07:53
Why wouldn't you (and you could easily test it?)
Sam
Sam
08:47
I'm using Apexcharts to render a graph and have implemented the selection callback function: apexcharts.com/docs/options/chart/events Is it possible to check for mouseup inside this function? As I only want to execute code in this function should this be the case. Simple event listener is not applicable here as I get the following error: Unable to preventDefault inside passive event listener invocation.
09:17
@KevinB Depending on use-case, something like Object.assign(document.createElement("span"), { textContent: "Dolce & Gabbana" }).innerHTML can be used instead. " and ' don’t always need to be converted to &quot; and &apos;. Can’t really find an easy way to do something similar with attribute escaping, where &quot; becomes relevant…
09:51
@user4642212 Maybe ((elem, value) => (elem.setAttribute("data-attr", value), elem))(document.createElement("span"), "Dolce & Gabana").outerHTML.replace(/^.*?"(.*)".*?$/su, "$1").
 
5 hours later…
15:12
Oops
stackoverflow had a stack overflow
lol
15:34
im looking for a jquey function to remove the value of a dom element
I tryed remove() which does delete the element
The value of a dom element?
you mean the value of an <input>?
the text value jes
$('.selector').val(null)
@Cerbrus thanks
15:56
🚽
16:41
@paul23 Yes. I think in Objection you would need to create a separate entity.
@Cerbrus ew, why does that work
crappy jquery
Eh, why not?
Pretty much the same as doing .val('')
In the source they do
if (val == null) {
            val = "";
hmm. Looks like that works in vanilla js too.
Because if you got the val of the input after setting it to null it would be an empty string so I kinda feel like you should pass an empty string to clear it. Doesn't really matter tho.
Until you find the libraries that cast null to "null" 😂
Meh
You should be checking for empty strings / null, any way
16:48
I generally do
@BenFortune lol. Reminds me of an API i had to work with yesterday. For a boolean value the API accepts true/false but returns 1/0 but the docs say it returns 1/"" (empty string)
hi! how can i make the word "Header" (in header.js file) in the middle? codesandbox.io/s/zhkc8
@user36339 flex my guy
hmm... ok, thanks!
17:07
is there a way to insert a function with paramters to jquery done callback ?
what parameters?
I want to add a callback function to $.post using .done()
done only takes the not invoced function as a parameter
question is how to inser a function to done which takes arguments
played a little bit of it last night, seems cool, though i feel like using the hacking parts of the game fluidly in combat will be difficult if not impossible, because it's all realtime, no pausing, so while you're trying to, say, cause an npc to drop a grenade or whatnot, they and their buddies are coming at you. works great from stealth tho
 
5 hours later…
22:48
posted on December 10, 2020 by Prudhvikumar Bommana

The Dev channel has been updated to 89.0.4350.4 for Mac and Linux platforms, Windows(coming soon). A partial list of changes is available in the log. Interested in switching release channels? Find out how. If you find a new issue, please let us know by filing a bug. The community help forum is also a great place to reach out for help or learn about common issues. Google Chrome  Prudhvik


« first day (3708 days earlier)      last day (1465 days later) »