Open
Description
Increasing Access
Our codebase becomes more maintainable if functions are defined in one place only.
Feature enhancement details
I noticed that there is a function resolvePathsForElementsWithAttribute
which is identical in both files. Other parts of the code are similar but different.
Tasks:
- Look at the Git history for each file and read any discussions on the PRs and issues that led to changes.
- Reuse functions from the server code in the client component instead of recreating it.
- Add explanatory comments in the code.
- Add unit tests.
- Make improvements to the code itself, for example using RegExp
test()
to check for truthiness rather thanmatch() !== null
.
Questions:
- Which parts of the code are the same and can be reused?
- For the parts which differ, is the difference due to necessity of the client vs server environment?
- Do we even need the server version at all? This code was previously used for the
/embed/
endpoints, but those are disabled right now due to phishing concerns. I'm not sure what it would take for us to re-enable it. It might make sense to delete it. See Bug/phishing #1967, Restore Present view that doesn't allow phishing #1971, etc. for background.
Activity