Giter VIP home page Giter VIP logo

Comments (14)

chenglou avatar chenglou commented on May 31, 2024

Can we do just 2? You're talking about generating a module alias file right?

from bs-webapi-incubator.

bobzhang avatar bobzhang commented on May 31, 2024

yes, just generating a module alias, but reason-js is not a vaild suffix or prefix

from bs-webapi-incubator.

chenglou avatar chenglou commented on May 31, 2024

Ah I remember: npm doesn't allow uppercase letters anymore, so the only choice the user has is snake_case. This probably sucks for camelCase. So let's not reuse package name...?

from bs-webapi-incubator.

glennsl avatar glennsl commented on May 31, 2024

Couldn't the package name just be transformed to snake_case? I'd like that for module names derived from (dasherized) filenames too. It's a simple and predictable process, and while there is a minute chance of accidental collisions it seems essentially theoretical to me.

from bs-webapi-incubator.

chenglou avatar chenglou commented on May 31, 2024

@glennsl what if we want the module to be called ReasonJs rather than Reason_js?

from bs-webapi-incubator.

glennsl avatar glennsl commented on May 31, 2024

Then I suppose you'd have to specify it, but you would have to do that either way, right? Having a generated default wouldn't change that.

from bs-webapi-incubator.

bobzhang avatar bobzhang commented on May 31, 2024

ReasonJs looks better, it is acceptable to have all files renamed form 'xxRe' to 'ReasonJs_xx', too ugly ?

from bs-webapi-incubator.

bobzhang avatar bobzhang commented on May 31, 2024

btw, if we enforce such convention, then the build system could infer the package name, is a good idea?

from bs-webapi-incubator.

jaredly avatar jaredly commented on May 31, 2024

I dunno if this is coming from the right direction. I guess it's cool to look at the current convention and say "how can we adapt our build tools to make this better", but the real problem is that there's no notion of namespacing beyond that of a file. Doing funky things with the file name is, like, a cool hack, but hey we've got folders!! which provide a super great way of organizing files...
Could we instead adopt rust semantics for namespacing, where each folder essentially becomes a module?

from bs-webapi-incubator.

glennsl avatar glennsl commented on May 31, 2024

@jaredly I'd really like that, but I'm guessing the heavy reuse of ocaml's toolchain makes that difficult. I've heard rumours that ocaml might gain support for some form of namespacing sometime in the next decade or so, though!

@bobzhang I'd be fine with that. I'd be fine with anything, really, as long as it's not gibberish.

from bs-webapi-incubator.

bobzhang avatar bobzhang commented on May 31, 2024

cool, I will whip up a quick solution, stay tuned, btw, do you use open too much?

from bs-webapi-incubator.

chenglou avatar chenglou commented on May 31, 2024

We have package names that also have . in it. For starter, just a {"namespace": ...} would be good enough. Can we leave the prefix/suffix thing to later? fooRe is a lazy arbitrary convention I came up with to avoid collision internally.

I don't dislike @jaredly proposal either. But we can at least do a library-wise namespace first. If it's not too much trouble we can do both?

from bs-webapi-incubator.

glennsl avatar glennsl commented on May 31, 2024

@bobzhang I don't understand the question, Do you think I use open too much? ReasonJs and ReasonJs.Dom is kind of designed to be opened, like a core library, though it could certainly use some cleaning up here and there.

from bs-webapi-incubator.

glennsl avatar glennsl commented on May 31, 2024

Closing for having outlived its usefulness, I think. There's namespace support in BS now. See #81

from bs-webapi-incubator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.