These are chat archives for exceptionless/Discuss

12th
Nov 2015
Frank Ebersoll
@frankebersoll
Nov 12 2015 15:48
hey guys
Blake Niemyjski
@niemyjski
Nov 12 2015 15:48
hey
Frank Ebersoll
@frankebersoll
Nov 12 2015 15:49
how are you doing
Blake Niemyjski
@niemyjski
Nov 12 2015 15:50
pretty good slightly tired
wishing I would get my current task done
Frank Ebersoll
@frankebersoll
Nov 12 2015 15:50
same here
Blake Niemyjski
@niemyjski
Nov 12 2015 15:50
you?
Frank Ebersoll
@frankebersoll
Nov 12 2015 15:50
what's your current task?
we're preparing for a test at customer site, and suddenly they start testing in the integration room and find errors that could have been found many sprints ago
Blake Niemyjski
@niemyjski
Nov 12 2015 15:51
merging in foundatio repos to make it easier to do advanced caching, facets etc.
thought it would take a lot shorter than what it’s taking
:(
Frank Ebersoll
@frankebersoll
Nov 12 2015 15:52
okay! didn't look into foundatio yet. would it also make sense to use in desktop apps?
or is it a server framework
Blake Niemyjski
@niemyjski
Nov 12 2015 15:53
yeah it’s generic and could be used anywhere
Frank Ebersoll
@frankebersoll
Nov 12 2015 15:53
i was hoping that you had some work for me on the javascript side. DuplicateChecker seems to be done, so what would be the next step?
Blake Niemyjski
@niemyjski
Nov 12 2015 15:57
great job man
two questions, what happens if there isn’t any stack trace just an error message? Think we should de dup that? I’m leaning towards maybe not?
Frank Ebersoll
@frankebersoll
Nov 12 2015 15:58
currently, we only use the stack trace
Blake Niemyjski
@niemyjski
Nov 12 2015 15:58
I suppose there are browser specific hashcodes but then we have to have seperate code for node and browser which would suck.
in .net?
Frank Ebersoll
@frankebersoll
Nov 12 2015 15:58
in .net - iirc - we don't calculate the hash ourselves
we just use .GetHashCode() as it's implemented on Object
Blake Niemyjski
@niemyjski
Nov 12 2015 15:59
I don’t think we calculate the hash based on message right now in .net
yeah
Frank Ebersoll
@frankebersoll
Nov 12 2015 15:59
yes, so we get reference equality in fact
Blake Niemyjski
@niemyjski
Nov 12 2015 15:59
kk
Frank Ebersoll
@frankebersoll
Nov 12 2015 15:59
this might not be what we like it to do
Blake Niemyjski
@niemyjski
Nov 12 2015 16:00
I think what we have is great. when we update the .net duplicate checker we can update the js but it seems to do everything we do now :) :+1:
Frank Ebersoll
@frankebersoll
Nov 12 2015 16:00
in js, we use the stack trace
Blake Niemyjski
@niemyjski
Nov 12 2015 16:00
yerah
we hash all the inner stack traces and break if any of those match
Frank Ebersoll
@frankebersoll
Nov 12 2015 16:02
no :-)
where did you override GetHashCode?
this would need to override GetHashCode and equality members
Blake Niemyjski
@niemyjski
Nov 12 2015 16:03
not sure on that one but we have tests for it
Frank Ebersoll
@frankebersoll
Nov 12 2015 16:03
then your tests are wrong
(i read the code)
Blake Niemyjski
@niemyjski
Nov 12 2015 16:04
yeah
Frank Ebersoll
@frankebersoll
Nov 12 2015 16:04
:-P
Blake Niemyjski
@niemyjski
Nov 12 2015 16:04
:)
overriding the gethashcode and equals is a PITA
Frank Ebersoll
@frankebersoll
Nov 12 2015 16:04
no, it isn't
Blake Niemyjski
@niemyjski
Nov 12 2015 16:04
it is to keep it in sync anytime something changes
Frank Ebersoll
@frankebersoll
Nov 12 2015 16:04
did you ever use resharper for it?
Blake Niemyjski
@niemyjski
Nov 12 2015 16:04
negative
didn’t know they would generate it
Frank Ebersoll
@frankebersoll
Nov 12 2015 16:05
"generate equality members"
Blake Niemyjski
@niemyjski
Nov 12 2015 16:06
hmm
learned something new
I think that it’s a great start for deduplicating, we can always make it smarter in the future as we find cases.
Guess the things that would be nice would be use isolated storage , but I seriously am wondering about the performance of it
it’s generally slow and we could be beating the bejesus out of it
Frank Ebersoll
@frankebersoll
Nov 12 2015 16:12
ehm, i have no experience with it. just looked into the api a bit
Blake Niemyjski
@niemyjski
Nov 12 2015 19:20
ok
Frank Ebersoll
@frankebersoll
Nov 12 2015 19:23
just pushed some refactorings
i don't know how you think about it
mainly, I removed lots of import statements, which didn't anything to the generated .js files
and I added typescript-formatter to easily reformat all code files, which makes diffing easier
Blake Niemyjski
@niemyjski
Nov 12 2015 19:25
I had all those imports in the main .ts files cause if something doesn’t reference it under the hood it won’t be included
and you might want to inject one of our implementations
Frank Ebersoll
@frankebersoll
Nov 12 2015 19:25
yes, i also thought about this. but somehow, it didn't affect anything besides the .map files
Blake Niemyjski
@niemyjski
Nov 12 2015 19:25
yeah
Frank Ebersoll
@frankebersoll
Nov 12 2015 19:26
don't know
Blake Niemyjski
@niemyjski
Nov 12 2015 19:26
that was main conserns is you won’t know about it unless you check over the dist folder commits
Frank Ebersoll
@frankebersoll
Nov 12 2015 19:26
yes, but then you will always forget to add something in the imports
so, i think if we add any components that we don't use in the root ts files, we should re-export them
that makes it explicit
typescript can do something like this: export { * } from 'whatever'
don't know if tsproject supports it. i give it a try
Blake Niemyjski
@niemyjski
Nov 12 2015 19:29
okay
yeah that’s a good compromise :)
Frank Ebersoll
@frankebersoll
Nov 12 2015 19:32
about code style: typescript seems to propose adding a whitespace behind colons
a: number seems to be preferred in comparison to a:number
Blake Niemyjski
@niemyjski
Nov 12 2015 19:32
yeah I like that too
that lint thing didn’t like it if I remember
what do you like?
I think I’ve kinda stuck to a:number and methods are (): type
Frank Ebersoll
@frankebersoll
Nov 12 2015 19:33
it does now. and gulp format runs typescript-formatter which auto-formats it
Blake Niemyjski
@niemyjski
Nov 12 2015 19:33
but should be consistent
nice
awesome didn’t even know that existed
Frank Ebersoll
@frankebersoll
Nov 12 2015 19:33
funny thing is, it doesn't do a thing. it just uses the typescript module, which itself has support for reformatting
haven't added the task to the main build, because it takes some time.
Blake Niemyjski
@niemyjski
Nov 12 2015 19:35
how long?
maybe it should only be a seperate task if you run it on a build server and it changes stuff might be hard to get latest without a hard reset
but that’s the build servers job
Frank Ebersoll
@frankebersoll
Nov 12 2015 19:36
takes about a minute and should be done before merging back to main
Blake Niemyjski
@niemyjski
Nov 12 2015 19:37
dang
Frank Ebersoll
@frankebersoll
Nov 12 2015 19:37
build server could only run it to verify it
or can they commit?
Blake Niemyjski
@niemyjski
Nov 12 2015 19:37
maybe just have it as a seperate gulp task to do the formatting and we can do it when we feel like it needs it?
Frank Ebersoll
@frankebersoll
Nov 12 2015 19:38
that's how it is now.
and Alt+Shift+F in vscode uses the same reformatter, so i can also use that
just tried it... i added Blah.ts, rebuild, no changes in generated code
added import { Blah } from './plugins/Blah'- build error, because tslint checks for unused imports now
changed it to export * from './plugins/Blah' - adds it to output files as expected
i also figured we could group many types together in single files, so we don't have to import every single file
either by putting them in one file, or adding a file that re-exports commonly needed types
there has to be something better than adding 10 import statements
Blake Niemyjski
@niemyjski
Nov 12 2015 19:52
yeah
that’s awesome
:)
<3
Frank Ebersoll
@frankebersoll
Nov 12 2015 19:53
woah, i didn't expect that
Blake Niemyjski
@niemyjski
Nov 12 2015 19:54
haha
those things make me happy inside hehe
love great tooling experience
good to see others do too :)
Frank Ebersoll
@frankebersoll
Nov 12 2015 19:55
next thing, i'd like to put all magic strings somewhere
there are way too many
Blake Niemyjski
@niemyjski
Nov 12 2015 19:55
you mean @error ?
Frank Ebersoll
@frankebersoll
Nov 12 2015 19:55
for example
can't they be constants in some module that defines the types that use them?
Blake Niemyjski
@niemyjski
Nov 12 2015 19:56
they could
this would clean up the typescript code. I’m just worried about the js size
I tried a ton of things to get it as small as possible
Frank Ebersoll
@frankebersoll
Nov 12 2015 19:57
did you put //optimization for minifier yourself, or was that a tool?
i give it a try and compare the sizes.
Blake Niemyjski
@niemyjski
Nov 12 2015 19:59
I did that
cause uglify isn’t that good
like for example
exceptionless.config.blah.xyz = asfsadf exceptionless.config.blah.abc =asfasdfas
if I was a minfier I’d do
var a = exceptionless.config.blah;a.xyz =asdfadsf;a.abc=qwr
but it doesn’t do it
which is most of the things I did
to help save on it
Frank Ebersoll
@frankebersoll
Nov 12 2015 20:08
okay. i will see if putting all those strings in one location helps further, otherwise i undo it
what do you think about var exceptionless = require('exceptionless').ExceptionlessClient.default?
currently, exceptionless is like a namespace and contains all classes.
and it initializes some global stuff.
somewhere further up, you linked to somebody blogging about why require().foo was bad practice
i don't know if that applies to our case, and i like that it resembles how it works in .NET
Blake Niemyjski
@niemyjski
Nov 12 2015 20:35
ok
yeah
I think it does apply
I need to reead it but they said it was bad and you should use the require and then on a separate line do the declaration
Frank Ebersoll
@frankebersoll
Nov 12 2015 20:52
i think it was about cycles in module loading
it can happen that not all exports are initialized when accessing a module
Blake Niemyjski
@niemyjski
Nov 12 2015 20:54
so dshould we update examples to promote it?
Frank Ebersoll
@frankebersoll
Nov 12 2015 20:57
it won't be needed if we don't use any modules that use exceptionless
Frank Ebersoll
@frankebersoll
Nov 12 2015 21:02
i thought about getting rid of it altogether :-)
i'd rather have var exceptionless = require('exceptionless');
and have it implement the default client's methods directly
we could still have a property to give access to exported types and stuff
but it would make it less verbose and more intuitive.
Blake Niemyjski
@niemyjski
Nov 12 2015 21:07
yeah
I’d like that a lot too
I wanted to do that
but then I wondered how you’d new up a new exceptionless client

var exceptionless = require(‘exceptionless’); //exceptionlessclient.default??

how would I do var exceptionless2 = new ExceptionlessClient();

Frank Ebersoll
@frankebersoll
Nov 12 2015 21:23
what about var exceptionless2 = new exceptionless()?
it could be both our default client and a constructor
Blake Niemyjski
@niemyjski
Nov 12 2015 21:24
yeah, that’s why I didn’t like it
cause you might have an app with two different exceptionless clients
Frank Ebersoll
@frankebersoll
Nov 12 2015 21:24
well, it's javascript :-)
Blake Niemyjski
@niemyjski
Nov 12 2015 21:24
hehe
Frank Ebersoll
@frankebersoll
Nov 12 2015 21:25
i don't know. it would require some mental effort.
it should probably be downwards compatible
but we don't have to use only classes. just trying to make some of our classes into internal modules, so they aren't being exported. that may save many bytes.
i don't know, just trying.
everything that is being exported needs to keep its name
but our public api isn't that big
we have the plugins that should stay extensible, and we have the client api
everything else could be internal, so the uglifier would have more possibilities to cut away with names
Blake Niemyjski
@niemyjski
Nov 12 2015 21:33
it’s worth a try
yeah
I agree
but anything injectable you may want to swap out
or extend
like we could internalize the default implementations but what if you want to overwrite something on it?
Frank Ebersoll
@frankebersoll
Nov 12 2015 21:34
yeah. that would compromise it.
just trying to do this with EventBuilder, and it sucks big time.
Blake Niemyjski
@niemyjski
Nov 12 2015 21:35
yeah
Frank Ebersoll
@frankebersoll
Nov 12 2015 21:35
it has a cyclic dependency with ExceptionlessClient, and if you use internal modules, this immediately leads to pain.
i swapped it out with an interface, which i had to create by hand, only to find out that it is being imported and used all over the place
external modules work, because they are all put into exports
and when the actual code is being run, all exports are already there.
so, not much to cut down there.
git reset :-)
Blake Niemyjski
@niemyjski
Nov 12 2015 21:39
:)