nue icon indicating copy to clipboard operation
nue copied to clipboard

fix!: make components case-insensitive

Open nobkd opened this issue 1 year ago • 3 comments

This is just some idea I had when reading #100, and it would fix #100, but I'm not sure, if this is a good idea. This just makes components case-insensitive and passes the access to the object through a proxy that makes all key accesses lower-case. This PR solves the problem, because HTML elements are case-insensitive for the browser by default, but currently might allow collisions on Component creation...

Well... This is just a proposal to make components case-insensitive in the end... Okay, I'm really repeating myself.

This was just a quick sketch to outline the idea and might have some obvious flaws, and the code can be changed more, to make this better integrated (and fix some possible issues)...

Feel free to reject and let me know your opinion about this.

nobkd avatar Aug 31 '24 21:08 nobkd

I think this is a good change. Makes sense to be compliant with the HTML specs. I did not merge this yet since you were concerned about the potential flaws. I guess tests are needed. Do you think proxy is the easiest way to do this?

tipiirai avatar Sep 03 '24 08:09 tipiirai

To be honest, this is the first time I really used Proxy (because it seemed like a really easy way, to get case-insensitive access to an object). So I'm really not sure, if this is the way to go. I will check, if I see an easier / better way, and then try adding tests.

But I'm currently a bit preoccupied with personal matters, so this may (or may not) take a while.

Feel free to take this over, if you have a good idea, or want this included fast.

nobkd avatar Sep 03 '24 09:09 nobkd

Take your time on this. I'm not in a hurry with Nue JS issues as they are all delayed for later

tipiirai avatar Sep 05 '24 06:09 tipiirai

I currently don't want to work on this, if someone wants to take this over, you can redo this on your end / copy my cranch / commits over from my fork

nobkd avatar Dec 15 '24 00:12 nobkd