Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: make components case-insensitive #335

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nobkd
Copy link
Collaborator

@nobkd nobkd commented Aug 31, 2024

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 nobkd changed the title fix: make components case insensitive fix: make components case-insensitive Aug 31, 2024
@nobkd nobkd added nuejs-core Related to nuejs-core package needs discussion Needs a discussion or decision labels Sep 1, 2024
@tipiirai tipiirai marked this pull request as ready for review September 3, 2024 08:35
@tipiirai
Copy link
Contributor

tipiirai commented Sep 3, 2024

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?

@nobkd
Copy link
Collaborator Author

nobkd commented Sep 3, 2024

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 nobkd removed the needs discussion Needs a discussion or decision label Sep 3, 2024
@nobkd nobkd changed the title fix: make components case-insensitive fix!: make components case-insensitive Sep 3, 2024
@tipiirai
Copy link
Contributor

tipiirai commented Sep 5, 2024

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

@nobkd nobkd marked this pull request as draft September 5, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nuejs-core Related to nuejs-core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

child component name Contains uppercase letters ,error not show 、ref undefined
2 participants