We need proposals for:
* A module-relative "resource" object, like module.resource(path).open(…).
* To fix the module identifier domain. The current specification
restricts module identifiers to camelCase delimited by slashes, but
this is hazardous in case-insensitve stores, and not restricted in
practice.
Tobie has made a proposal for async, which is in flux:
http://wiki.commonjs.org/wiki/Modules/Async/A
Kris Kowal
There's also a note on the wiki:
** version 1.1 will need spec tweaks and more work: there has been
discussion/argument over the behaviour and formation of module.id, one
side going for invariance based on path relative to search paths, the
other going for absolute file path, since the top level id is
dependent on the require.paths at the time of module load. There is
also discussion about what we should and shouldn't allow as an
argument to require, particularly about camelCase (which not many
platforms mandate) and about file extensions.
Kris Kowal
We should be looking at module resources and clarifying instanceof and
exports enumerability expectations on 1.2 IMO.
Wes
Sent from my iPhone
> --
> You received this message because you are subscribed to the Google
> Groups "CommonJS" group.
> To post to this group, send email to comm...@googlegroups.com.
> To unsubscribe from this group, send email to commonjs+u...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/commonjs?hl=en
> .
>
-Charles
A case-insensitive name-space is vulnerable to cross-platform
difficulties. I think we need to mandate a delimiter at least, for
CommonJS modules, never mind extensions to the spec that have no
interest in being portable, like ObjJ Frameworks, which Narwhal is
obliged to support beyond spec anyway.
The reason for being picky about case insensitivity is the very real
albeit rare problem of ambiguous names like "expertsexchange". On a
case-insensitive file system "ExpertsExchange" is informational but
still collides with "ExpertSexChange", so these two names cannot
coexist. Mandating a delimiter and a normal case obviates this class
of problems.
So this is another area of verbiage that is sensitive to the
distinction between constraints on interoperable modules, and
constraints on interoperable module loaders. I do not think that we
should mandate that module loaders reject modules that are not
CommonJS module identifiers. We should however mandate that CommonJS
compliant modules should use a strict name-space, to guarantee that
all loaders can load them without conflicts. I'm in favor of hyphen
delimited lower-case alphanumeric terms delimited by slashes.
Kris Kowal
Kris Kowal
I'm not suggesting case-insensitivity. I'm recommending that the
module identifiers must be lower case so that if they happen to be
stored on a case insensitive file system (e.g., a Mac with stock HFS,
and NTFS last time I checked, which was admittedly a previous life),
there won't be any conflicts. I am not recommending any special
checks or toLowerCase calls in loader code.
Kris Kowal
Wes
Sent from my iPhone
Right, we need to refactor the module specification to be divided into
a section for which "may" and "must" apply to modules, and another
section where "may" and "must" apply to module loaders.
Kris Kowal
I do not recall other systems, like Python or Java, that have spec
schemes to avoid casing issues? It would seem fine to leave it out of
any CommonJS module spec.
I do not like any naming scheme that makes it hard to make a JS
variable of the same name as the module name. Slashes are not allowed
in JS names, but using the last part of a module ID seems like it
might be a common choice.
James
The spec could say that a term must be a lowercase alphanumerical
value that is a legal javascript variable identifier.
"4logjs" would be illegal, so is (and always was) "fs-base".
Chris
In practice, there is no reason to restrict module names to valid
JavaScript identifiers.
Kris Kowal
Well, being able to assign a required module to a variable of the same
name should probably be counted as a reason.
Beyond that, I just think that we may one day want to extend the use
of modules in a way that will make allowing none-js--var-id-names feel
like a mistake. For example an implementation or convention that under
some circumstances would make modules directly available in the
context of certain scopes or that would make them available as
properties of an object. Forcing users to use a syntax like
foo["fs-base"] wouldn't be pretty, needing to do global["fs-base"] or
this["fs-base"] even worse.
Are we loosing a lot by keeping the restriction?
Chris
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
> > <chris.z...@gmail.com <mailto:chris.z...@gmail.com>>
> <mailto:comm...@googlegroups.com>.
> To unsubscribe from this group, send email to
> commonjs+u...@googlegroups.com
> <mailto:commonjs%2Bunsu...@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/group/commonjs?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "CommonJS" group.
> To post to this group, send email to comm...@googlegroups.com
> <mailto:comm...@googlegroups.com>.
> To unsubscribe from this group, send email to
> commonjs+u...@googlegroups.com
> <mailto:commonjs%2Bunsu...@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/group/commonjs?hl=en.
>
>
>
>
> --
> Wesley W. Garland
> Director, Product Development
> PageMail, Inc.
> +1 613 542 2787 x 102