-
Notifications
You must be signed in to change notification settings - Fork 457
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
Future of Bucklescript #1797
Comments
I quite like all that spew... >.> But I could see a
Not a Bucklescript thing, that is an OCaml thing, you should use the BetterErrors package to make them better (could be included with bucklescript though?).
Eh, I'd say it is more of the React/TypeScript/PureScript audience, Elm is fairly small among it all.
We don't always want a bundler/buildsystem. I personally just keep it as raw ECMAScript modules when served over http2 for example.
Already trivial to do, just a single extra line (well, 2 lines including the dependency) in the npm's I really do not think all this bundling and stuff would ever be in bucklescript's purview. Everyone has their own build systems, I just use npm scripts, and they want it to work well when imported piecemeal, to not auto-bundle and compress it all, which would cause excess code to be included when they could just keep the modules they want, nor does it handle assets packing or processing and so forth. Every project is different and this is not something that you can have reasonable defaults for that would be used by even 10% (perhaps even 1%) of users.
Time is nice, but I already get that in my system. Build size is entirely superfluous, after all not all modules are touched, so should it then touch and stat the files just to get their sizes, or what if you are only including certain modules, or is it of pre compiled code, or what? This is another part that I'm not sure is useful in any way either...? /me is not an author of bucklescript, just a user |
Yea, i'm not sure how helpful "spew" is.
I think leaning towards a
Maybe Bucklescript can bring
Arent those all competition in addition to elm? Thus gaurenteeing a better experience is equally as helpful.
I'd wager to say that there isn't a large number of people/companies on http2 in comparison to http1.X. If you want raw modules maybe a
Everyone in Js land either uses Webpack/Rollup/Browserfify. If Bucklescript audience is Javascript folks this is a MUST. Like I said if you don't want to bundle maybe adding a
Buildsize as it relates to files that are outputted, Similar to webpack build size output. Size in Javascript community is huge thing and currently every bundler/buildsystem is optimizing this the best they can. If bucklescript doesn't do this once again lagging behind. I want bucklescript to win just as bad as anyone else and it's really fast and useful for reason. However it is hard to pitch project managers and engineering teams to use bucklescript if it adds to overhead to our build pipeline. However replacing webpack in our build pipeline would be a HUGE and favorable option that would win over engineering teams and project managers because webpack is complex and difficult to configure in comparison to bucklescript. @bobzhang I hope this is seriously considered as I want to use bucklescript outside of our internal channels or weekend pet projects. |
hi @sigarthur thanks for your suggestions
We can have a quiet mode (#1799)
Did you use vscode , we provide a problem matcher which provide such functionality. We are working with @chenglou to absorb betterErrors upstream. (Syntax errrors and type errors are what we inherited from ocaml)
Since BuckleScript are mostly targeting js devs, they probably will feel more comfortable using their existing build tools, webpack or rollup, and with chrome 60 having native es6 module support, probably you don't need bundler any more during dev time. Also developing a high quality bundler is non-trivial, since you are not just bundling generated JS files from OCaml(which is easy), you also need bundle all third party external js libs, (we can vendor in rollup though #1800, but I suggest we do not bundle during dev, bucklescript support amdjs/es6 module which does not need bundle at all during dev, so you can enjoy the fast feedback loop)
You should try out vscode with our tasks.json, which fits your goal, we should document it properly though |
@bobzhang As far as the quiet mode goes, A verbose mode that shows all that information would be better. For the average dev most of the information shown when building is rather verbose and unnecessary. |
Here's my 2cts: BuckleScript should optimize for 1 thing and 1 thing only, UNIX style. Vendoring a single solution with BS will make other issues pop up requesting different tooling. And then how to deal with mixed codebases, i.e. adopt BS incrementally when it clearly favors 1 tool over others? IMHO bundling is a downstream concern in userland and it should remain there. |
Perhaps, but perhaps add that to a global configuration instead defaulting to following the stock OCaml compiler as it really is just the OCaml compiler.
It's not just that, I have bucklescript compile, take it's output and run two passes on it (just normal npm scripts, no build system, a single line each in
Exactly, lots of options, don't force one of them on someone, plus there is running the modules straight on
That is the point of closure and so forth, not the transpiler.
Uh, what overhead? I literally add a single line...
Those are entirely orthogonal. I could never see the bucklescript build system naturally handling the variety of other javascript parsers, closure, image minizers and packers, html packers, etc... etc... Absolutely not!
Then let the rest of your build system handle that. I just call them directly, even on a single line in a
Exactly this, closure is not even the only option out there. The OCaml compiler follows standard unix philosophy as those are trivially composable, as rollup also follows among others, even closure, hence why you do not need a build system like webpack or so for that (I really dislike webpack, I can do more work in less code and faster than webpack...).
Precisely. |
@bobzhang @OvermindDL1 @anmonteiro There are 2 types of people that use Bucklescript:
I agree with you all that people that fall into the number one should indeed integrate with their existing build step. HOWEVER People that fall under number 2 likely are doing so because the want to take advantage of OCaml speed (Bucklescript vs Babel+Webpack) and easy setup (Bucklescript vs Babel Plugins/Presets+ Webpack) Maybe a bundler shouldn't be included into Bucklescript directly, but maybe a standalone bundler that uses gcc underneath and consumes build artifacts that Bucklescript produces that will be useful to gcc in order to create slim and fast bundles and leverages gcc code splitting feature whilst avoiding developers from configuring gcc themselves (due to gcc history of being hard to configure with advanced mode and intelligent codesplits) is useful to these people. I know it would be for me and the ability to use Bucklescript at work. I'm only arguing for people in category 2. |
@sigarthur I agree. I've used all of the JS tools extensively (Webpack, Closure, Rollup, Babel, TypeScript, etc.), but I really like how easy it is to setup and use BuckleScript. Bundling is such a necessary tool that I think BuckleScript should have great bundling support out of the box (even if that just means a thin wrapper over an existing bundler). Not having to deal with bundler configuration would be a huge advantage over the JavaScript ecosystem. Having watch mode Just Work(tm) with the BuckleScript compiler and bundler would also be a huge advantage. Right now you have to run Webpack watch mode and BuckleScript watch mode in parallel, which is a bit annoying (in addition to the extra configuration and setup). Of course if somebody has special needs, they can choose to not use BuckleScript's built-in bundler and instead use whatever bundler they want. |
If you're using webpack, why not just use bs-loader, which abstracts everything away for you? |
@bassjacob I think @sigarthur is saying that is what people who fall under "category 1" should do. But what about people in "category 2"? I agree with this, so long as it's a separate module and not built into bucklescript itself. |
Ah, understood. I think webpack+bs-loader answers this problem regardless (both for cat1 and cat2) in terms of effort against payoff. We could ship a simple lib that just wraps webpack and bs-loader directly and it would be 99% of what's being asked for here, right? But if there's enough community interest in an alternative, then sure, why not? 😄 |
@bassjacob I was unaware of Of course it would still be a separate npm package, so people can choose to not use it if they want. Having a simple wrapper for it is not a bad idea either, because it simplifies the common case. Having |
makes total sense 😄 as far as I know, bs-loader has only recently been considered stable (@rrdelaney, is it considered stable enough for wider promition?) If it is, would be good to mention it in both the bucklescript and the reason docs as a good way to go. |
All outstanding issues with bs-loader have been closed for two weeks now, and no new ones have been reported for a while. I also worked on the perf a lot a couple weeks ago so it's not slow, so I'd say it's pretty production ready 🙂 |
I do both, routinely actually. :-)
That all sounds to be like just a template, why not make a template for such a setup? It seems the perfect use-case for it. Certainly not built into the compiler though, but as a template, certainly. I do the above in, say, my overbots tutorial project, all via npm scripts, no webpack or anything utterly stupid like webpack, and that style could easily be a template. But it absolutely should not be built in to the build system. |
@sigarthur @OvermindDL1 Here is my suggestion (as an outsider):
Both should be officially documented and supported. |
some of those issues are already addressed. I will close this issue since it is not actionable. you are encouraged to discuss more in discord.gg/reasonml or https://discuss.ocaml.org/ |
Bucklescript is great! However Still not reached a level of maturity the seems to be production ready for the masses. There are not so subtle warts with the developer experience. These are some that I have seen mentioned on discord and between colleagues of mine since we started using bucklescript at our company internally.
bsb -make-world
- this command fills my terminal with information that isn't particularly useful to me. Bucklescript should hide this information and just tell me when its done building.Error Messages
- the error messages kinda suck. Following improvements are huge:Production Mode Setting
- currently theres no production mode in bucklescript that handles everything for us.Useful and Developer experience additions
The text was updated successfully, but these errors were encountered: