Open vikaspotluri123 opened 6 years ago
These points are great! I believe, and this is just my opinion, that we use a proper web framework like Express. It might seem overkill, but IMHO it will do most justice to the optimisations @vikaspotluri123 mentioned. Moreover, using Gulp to help pre-render data, optimise it, and build the files seems alright, but we can get the same things with much less code and more accessible. Also, URL handling will be made much simpler using simple routes. Thoughts?
Since the optimizations I'm making are to the gulp build process, express would technically negate them π That's not to say express is a bad idea though π
The improvements I'm making will hopefully make the code more readable, albeit slightly bigger in size (let's just say it's stockpiling for winter π) and with the current spec I have in mind, will remove the need for the swag in a JSON format.
I personally prefer static over dynamic (ironically I prefer backend over frontend π€«) because it cuts out a vector for vulnerability, whether it be from contributor-introduced bugs or an attack vector, and it reduces maintenance costs overall
You do make some good points, though I'd still be implicitly pushing towards a web framework (don't mind me :smile:).
and with the current spec I have in mind, will remove the need for the swag in a JSON format.
This sounds interesting, could you elaborate?
This sounds interesting, could you elaborate?
Currently everytime an input changes, swag has to be rerendered. That doesn't have to happen since we can use native javascript dom manipulation to show / hide swag items. The most taxing input change is sorting, as there really isn't an easy way to rearrange DOM nodes natively (I think part of the reason might be the UI vomit implications for that are high). StackOverflow has some discussion to do this, and I'm going to experiment with relative performance to decide if it's worth rerendering swag in the special case of sorting
Ah, I misinterpreted it as removing the need of data.json
. My bad :sweat_smile:
Only on the client side π
there really isn't an easy way to rearrange DOM nodes natively
Not with JS, but with CSS there is: use flexbox
and the order
property! A good demo on CSS-Tricks: https://css-tricks.com/almanac/properties/o/order/
@vikaspotluri123 Should I try working on:
filter: toggle visibility based on classes to reduce re-rendering requirement sort: Clone DOM nodes rather than use template literals. This is to DRY up and possibly get performance improvements Disallow sorting by difficulty when only one difficulty is shown
or are you handling that?
Not with JS, but with CSS there is: use
flexbox
and theorder
property!
Using the order property doesn't update the a11y tree, so it's not suggested to use it for major changes like this π¬
@vikaspotluri123 Should I try working on:
I have some work done, but feel free to take over if you want
Cachebusting & extended caching has been added by #93. Does it lacks anything?
Not that I am aware, everything seems to be working, correct?
Looks good to me, yes. It only needs a rebase.
Let's bump that one. There are still some points to PR.
I'm in the progress of implementing performance improvements both to the backend and frontend. Here's what's being done:
swag-img:build-data
task (processing is done on gulpfile load)[x] Add .editorconfig to normalize formatting
<noscript>
Feel free to add any other suggestions, or discuss anything above
all difficulties
toall
and add the worddifficulties
after the input[ ] Add a
no items found
item to be shown when filtering hides everything (I was able to trigger this witheasy
difficulties that are taggeddevice
108