-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
doc: require
behavior on case-insensitive systems
#5331
Conversation
ff69c4c
to
81fdde0
Compare
/cc @nodejs/ctc |
LGTM |
1 similar comment
LGTM |
LGTM, though I think we should make the cache case insensitive as well. In any case, the documentation change is good given the current behavior. |
resolved filenames can point to the same file, but the cache will still treat | ||
them as different modules and will reload the file multiple times. For example, | ||
`require('./foo')` and `require('./FOO')` return two different objects, | ||
unrespective of whether or not `./foo` and `./FOO` are the same file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/unrespective/irrespective
I would be inclined to just say "file systems" and leave out "operating systems" but does Windows break this rule given that NTFS is technically not case-insensitive (is it?)? I believe the previous paragraph is limiting its comment entirely to where a module with a given name is located in the node_modules hierarchy given that it's possible to have an identical package located at multiple places, being resolved differently from other packages depending on where they are situated in relation to those packages. Less of a problem now with npm@3 given a more aggressive approach to hierarchy flattening but it's still perfectly reasonable to find two packages of different versions being resolved differently by dependents even though they use the same lgtm sans spelling nit and resolution of my question above re "operating systems" |
|
I believe you are correct about Windows. NTFS can be made case sensitive but Win32 is case-insensitive. So I think mentioning "operating systems" makes sense. |
As another data point: the ntfs-3g driver for linux is case-sensitive by default. |
This adds a paragraph in the Module Caching Caveats section about the behavior of require when Node is running on top of a file system (e.g. HFS) or operating system (e.g. Windows) that will not consider the case of file paths to find files.
81fdde0
to
f3527e6
Compare
@rvagg Spelling fixed. |
LGTM, landed in 5298c81. |
See #5143 and nodejs/node-v0.x-archive#6829.
This adds a paragraph in the
Module Caching Caveats
section about the behavior ofrequire
when Node is running on top of a file system (e.g. HFS) or operating system (e.g. Windows) that will not consider the case of file paths to find files.The goal is to make the behavior unambiguously clear, even though the previous paragraph might hint to the same caveat (to be honest, I'm not sure I understand that previous paragraph).
What do you think?
And thanks for making Node!