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

Be resilient to Swizzle case typos #3148

Closed
slorber opened this issue Jul 28, 2020 · 13 comments · Fixed by #3281
Closed

Be resilient to Swizzle case typos #3148

slorber opened this issue Jul 28, 2020 · 13 comments · Fixed by #3281
Labels
bug An error in the Docusaurus core causing instability or issues with its execution good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. mlh Major League Hacking Fellowship

Comments

@slorber
Copy link
Collaborator

slorber commented Jul 28, 2020

🐛 Bug Report

image

image

Swizzling a comp with bad casing lead to a component swizzled with a bad name.

Webpack aliases we use for themes are case-sensitive, so we should either:

  • find a way to make webpack aliases not case-sensitive
  • never create swizzled comps/folders with wrong case
  • reject if user does a case-sensitive typo and suggest it the correct name

I thnk 2 and 3 are simpler options.

In any case I think it's not a very good idea to create a theme/nAVbAR folder, even if it's the case the user used.

Related: #3135
Related test: #3147

@slorber slorber added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Jul 28, 2020
@slorber slorber changed the title Swizzle should not be case sensitive Be resilient to Swizzle case typos Jul 28, 2020
@slorber slorber added good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. mlh Major League Hacking Fellowship and removed status: needs triage This issue has not been triaged by maintainers labels Jul 28, 2020
@FocalChord
Copy link
Contributor

I will try work on this issue!

@FocalChord
Copy link
Contributor

Any idea why I get this error?

Screen Shot 2020-07-29 at 9 08 38 AM

@slorber
Copy link
Collaborator Author

slorber commented Jul 29, 2020

Thanks,

You have this error because of double VV, in addition to weird casing you have an additional letterr

@FocalChord
Copy link
Contributor

Hmm, why does nAVbaR work but not nAVVbAr?

@anshulrgoyal
Copy link
Contributor

@slorber My pr on swizzle should be merged first to avoid conflicts I think

@anshulrgoyal
Copy link
Contributor

This is my pr for swizzle cli #3021

@slorber
Copy link
Collaborator Author

slorber commented Jul 30, 2020

Yes we'll merge it first

Hmm, why does nAVbaR work but not nAVVbAr?

@FocalChord this is expected, there's an additional letter here. You can't swizzle a component that does not exist in the first place, but you should be able to swizzle it if letters are ok but with an incorrect case

@FocalChord
Copy link
Contributor

@slorber Hi, can we get Anshuls pull request merged in please

@slorber
Copy link
Collaborator Author

slorber commented Aug 5, 2020

will try to review it asap, but this bug has higher priority: #3199

@slorber
Copy link
Collaborator Author

slorber commented Aug 6, 2020

merged @FocalChord

@anshulrgoyal
Copy link
Contributor

@FocalChord are u still woking on it?

@FocalChord
Copy link
Contributor

@anshulrgoyal yes

@slorber Hi, as seen in the screenshot below, I get this error now

Screen Shot 2020-08-13 at 10 44 12 AM

@slorber
Copy link
Collaborator Author

slorber commented Aug 14, 2020

@FocalChord I merged the PR of @anshulrgoyal that address this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. mlh Major League Hacking Fellowship
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants