-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor getQueryParameters() to use URL/URLSearchParams #218
Comments
@mfelsche - are we still pulling in updated code from the Rust playground that we lifted from (in which case it may not make sense to make a bunch of maintainability-focused changes to the javascript code) or are we pretty decoupled from that upstream repo now (in which case it may indeed make sense to make iterative small improvements)? |
@jemc we didnt update it from the original codebase for ages. I didnt do any work on the frontend bits, but would be happy to get those on stable feet. Happy for every improvement here. |
Am I missing something or is Line 5 in 14abb9e
|
It doesn't seem to be referenced. Your js language server of choice might know more through some static analysis. |
Would you like to have JSDoc comments above your functions? |
Those aren't my functions. They belong to everyone. Treat them like they are yours. Whatever improves code quality, Iwe are happy to accept. I can write Rust and Pony, but I don't really dare to touch javascript. |
Yeah, sorry, bad wording on my part 😅 I didn't mean singular "you". More like that the repository owners might have a little more say in this
Perfect 👍🏻 Will do. |
Would it make sense to refactor
getQueryParameters()
to useURL
/URLSearchParams
, so we don't have to maintain custom code over native one or do you prefer not to fix something that ain't broken?pony-playground/static/web.js
Lines 295 to 305 in 35f1d18
By the way, this
pony-playground/static/web.js
Lines 7 to 12 in 35f1d18
could also be rewritten as
and so can
pony-playground/static/web.js
Lines 496 to 501 in 35f1d18
as
as well as
pony-playground/static/web.js
Lines 25 to 33 in 35f1d18
which can be shortened to
Then, we have
pony-playground/static/web.js
Lines 116 to 121 in 35f1d18
which doesn't need the
else
, since it has areturn
:The following is an interesting case:
pony-playground/static/web.js
Lines 251 to 258 in 35f1d18
it could either be rewritten as
or
Next, we have a bunch of these:
pony-playground/static/web.js
Lines 617 to 627 in 35f1d18
when they only contain a single function call, instead of creating a bunch of overhead with new anonymous wrapper functions, you could use
bind
:One could possibly also refactor
editGo()
,editShowRegion()
,editShowLine()
, andeditShowPoint()
, but that'd be slightly more than a simplification.Miscellaneous
className
vsclassList
fetch
vsXMLHttpRequest
setAttribute('data-*')
vsdataset
onclick
vsaddEventListener()
The text was updated successfully, but these errors were encountered: