-
Notifications
You must be signed in to change notification settings - Fork 633
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
Too much usage of mod.ts #130
Comments
This would be less boiler plate if there were more modules in http. I like the mod.ts if there were a bunch of different ts files and mod was gluing them up that, would be useful. Especially since you may need to export functions e.g. say in a utils.ts, but don't really want that to be in the "published" API: mod.ts. |
@hayd What's wrong with a bunch of TS files. Each of them exports different functionality. There's no semantic difference between "a/b/c/mod.ts" and "a/b/c.ts" but the latter is shorter. |
top level mod.ts e.g. color/mod.ts then no other mod.ts e.g. color/b/c.ts rather than color/b/c/mod.ts |
Possibly revisit keroxp's proposal or my proposal? (Or could I publish this issue to a broader range of developers I know and seek for their ideas?) |
@kevinkassimo I'm more or less onboard with your proposal but I want to avoid having source code in the root - so what if we come up with some categories:
I want us to be very thoughtful about our path names - since it's the public interface. I realize it's disturbing to continually rename stuff, but it's important we iterate on this now rather than later. |
Is everything exported in any file a public interface? |
@ry How about like this?
Edited at 2019/01/22:moved //http/http_proto.ts -> //io/textproto.ts |
textproto should keep its name (it’s not a http parser) but I’m generally in agreement. |
May I ask a question about
What does it mean? |
@ry Did you have examples other than http? Which would be addressed with Honestly, I don't understand the hate for explicitly defining the api in a potentially separate file (and in most cases there is only one file anyway). Edit: a la python's I know I said this before: but why util? (Perhaps everything should just be in util 🙄 ) |
I think current usage of
colors and flags modules are great but relatively small to compose a module set IMO (or should every single file be considered as a module set? That is why there are a lot of @hayd I don't hate the idea itself to collect public apis into a single file. It is useful for other platforms. But one reason why I hesitate to introduce Loading Additionally, even though export rotation is useful for import, It potentially disturbs jumping to source codes in IDE. Especially in Go, It is easy to jump declaration and implementation because there are no duplicated exportation. I believe that is one of the powerful feature in typed language.. In my opinion, one of the great concept of deno was defining module as a file (and URL). I want respect its concept and designing module naming and placement of standard module is very important. |
That's because std is a collection, they're organised in that way as each directory would ordinarily be a distinct repo (and correspond to a single name in the registry). Other projects won't have this issue: they'll only be one mod.ts. There's a pr to export file_server, imo the actual executable belongs in examples. Agree there is inconsistency ATM, but I don't think it's fatal (or that the above solutions solve this). I haven't tried jump to definition in VS Code , will be interesting to know if it's fooled by re-exports and/or if that's fixable. URLs are great, structure and convention is also valuable. |
Without suggesting one thing or the other on how deno_std should be organized, but semantically, I think it'd be nice to follow what rust does w.r.t |
In addition to this there is no definition in the style guide for test naming.
I can see the use in deno_std is based on the Go syntax. It might be good to put this in the style guide no? (like a recommended usage) |
A contributing.md with the style guide would be nice to add to the repo. Your thoughts? |
@zekth link is in the README: https://deno.land/style_guide.html |
@bartlomieju So about the test syntax it is revelant to add in the style guide of deno itself? Like |
@zekth Sure you can add that to the style guide, but don't reference golang (the style doesn't originate there - it's google style AFAIK). Something like:
|
@ry do you still want tu pursue this issue? |
No - closing |
I'm glad we've got rid of the usage of index.ts everywhere - however I'm not so happy with the excessive usage of "mod.ts" now. For example, in
http/mod.ts
:https://github.com/denoland/deno_std/blob/4283c26b8930ca80e5babca3337b5431f16334d0/http/mod.ts#L1-L7
This is just boilerplate. It would be better to have people link to
http/http.ts
instead.I would like to do another disruptive rename - sorry - in which we remove the
mod.ts
usage.The text was updated successfully, but these errors were encountered: