Hi Gladys developers ![]()
The Gladys 4 « frontend » project was created in 2018/2019, and some configuration points are becoming outdated/more suitable in hindsight.
I’d like us to discuss together the different things that can be updated so the code is more up to date, and to iterate on what worked/didn’t work in the frontend.
Update ESLint
Update the ESLint configuration to allow the latest JS ES2023 improvements (the ?. operator for example, we talked about it with @bertrandda on his last PR)
This makes me think we should do it on the backend too because some errors related to JSDoc are impossible to understand, and in a newer version it’s much more comprehensible!
Stop using the @connect decorators used by unistore
That was trendy at the time and in the end unistore no longer recommends it; it was a « hack » allowed by the transpiler, I don’t even think it’s in the JS spec in 2023.
Before:
Now:
I need to add an ESLint rule to ban this behavior.
Heavily restrict the use of the global unistore store
I’ll admit it’s my fault — at the start of v4 I thought a global store would be a good idea, probably due to lack of experience at the time with React frontend development. The result: we had many bugs related to the global store, because variables inevitably polluted each other between components.
My recommendation: Limit the store usage to « global » variables: user, session, httpClient, and that’s it.
The rest should be class states, local to the class. That avoids pollution between components.
Also, we should see if ESLint could help warn the developer.
Unify style behavior
Styling in the frontend hasn’t necessarily been enforced at the ESLint level, and in my opinion that’s a mistake.
Some components use inline styles (style={{}}), which is a bad practice performance-wise because an object is recreated on every render.
Also, those styles are hard to modify for responsive handling.
My recommendation: .css style files (one per feature roughly), which are imported into the component.
Media queries become possible and allow handling small/large devices:
More ESLint rules to speed up PR reviews
I realized while reviewing @bertrandda’s last PR that I often made the same comments on frontend code in PRs (watch out for inline functions, inline styles, etc.), and that these feedbacks could be in ESLint so reviews go faster ![]()
@contributors: What do you think? Any other feedback on the frontend? ![]()





