Closed isaacabraham closed 3 years ago
If you remove top level namespace then you need to make module top-level, so we'd need to make e.g. Route
top-level module
You can put it in the global
namespace?
Oh I didn't know you can do that! So literally we'd have something like following?
namespace global
module Route =
let hello = "/api/hello"
I've never seen that before and would probably find it confusing if I saw that without context. If it was my first time using SAFE I might think that shared code has to be directly in the global namespace for some reason and then copy it when making other shared files.
What's the purpose of removing the Shared namespace?
If the user wishes, they can prefix everything with e.g. ProjectName and be done with it.
If it starts as Shared
you can do that with just a rename. Not so quick if it starts as global
.
That's a valid point. I've never used global namespace myself either. @isaacabraham thoughts?
True.
I'm just thinking of making it simpler that both client and server can access "common" stuff without a Shared namespace.
Maybe I should create a sample SAFE app with some renames etc. - we can chuck it around and see where it goes?
Either that or you have multiple files for each top-level module e.g. Routes etc.. But this feels a bit of an overkill (as it is, I'm not convinced we should even have the Routes module in the minimal template).
I like the Routes module in minimal as it's the only small thingy that you can actually use to share code between server and client
Do we really need
Shared
as a namespace? Why not just leave that a level up? If the user wishes, they can prefix everything with e.g. ProjectName and be done with it.