SanyaZol
TTCTheo's Typesafe Cult
•Created by sondre on 8/9/2024 in #questions
Code ownership
depends on contract, jurisdiction
and also if the code is part of what you was hired for.
Generally in america law is more on corporate side, while in europe it's other way around.
In Russia there is a concept for "служебное произведение" which translates roughly to "official work" or "work of service" but means kinda like a painting made as a part of your employment duty, and it requires a grant separate from your employment contract. Which literally makes every software dev is a ticking legal landmine.
Which also can backfire in reverse, see nginx author case who developed it when working for Rambler and after nginx plus was created they realized they can have a share of that pie
7 replies
TTCTheo's Typesafe Cult
•Created by Liam B on 8/7/2024 in #questions
How are y'all handling custom icons?
In my company they use
<svg><use href="#smth"></use></svg>
and href="sprite-url.svg#smth"
(but I wasn't the one who set it up so don't know pros&cons)4 replies
TTCTheo's Typesafe Cult
•Created by oz on 8/1/2024 in #questions
Embedable Scripts
You can add styles, make sure they are scoped and will play nice with bootstrap, tailwind, jquery, whatever.
You can use shadow dom and web components, but that's often unnecessary.
Many scripts use about:blank iframes with injected code for best isolation. Register and reverse-engineer tawk.to embed script to see a good and minimaliatic example.
5 replies
TTCTheo's Typesafe Cult
•Created by oz on 8/1/2024 in #questions
Embedable Scripts
There is some unspoken rules that you need to follow, but generally it's pretty doable.
- write your script so it can (and should) be included with "async" param
- provide both static and dynamic ways of loading your code - see hcaptcha docs for a good example
- don't rely on anything in window. Bring your own scripts and frameworks if needed. Don't pollute window.
- play nice when your dom element is removed.
- play nice with content script policy. Don't use unsafe-eval
Etc etc
5 replies