rescript-lang / bucklescript.github.io Goto Github PK
View Code? Open in Web Editor NEWBuckleScript's documentation site
Home Page: https://bucklescript.github.io
BuckleScript's documentation site
Home Page: https://bucklescript.github.io
Currently the FFI docs do not show the generated Javascript, which leaves the reader guessing and makes bindings more difficult to learn. It would help if each FFI binding construct consistently had:
(you might even put the generated js first, since that is the reader's initial intent)
Example borrowed from Glennsl's cheatsheet
how to create links to some section?
for example Interop/Embed Raw JavaScrpt section
The syntax highlighting for OCaml code seems not correct, let
keyword is colored
For interop examples, can we always make it editable so that both ocaml/js code would displayed
Hello! I'm not sure if this is something I'm doing wrong, or if docs/object.md
is out of date so I didn't dare suggest a PR, but the document shows an example and mentions: "Js.Dict is simply backed by a JS object. The entire API uses nothing but ordinary BuckleScript externals, so the whole API disappears after compilation. There should be no mention of Dict anywhere in the generated output."
However, with BS 6.x I cannot reproduce the simplicity of the example, and instead get from:
external testobj : string Js.Dict.t = "testobj" [@@bs.val]
(* later: *)
( match Js.Dict.get testobj "test" with
| None -> Js.log "not found"
| Some _ -> Js.log "found"
)
β¦to:
var match = Js_dict.get(testobj, "test"); // <-- not testobj["test"]
if (match !== undefined) {
console.log("found");
return /* () */0;
} else {
console.log("not foud");
return /* () */0;
}
We might want to have reasonml's translation infra set up or something. But doesn't matter too much for now.
We can keep things in sync through manual copy pasting for now.
When selecting OCaml
syntax, some reason snippets don't hide.
Some (many ?) are incorrectly tagged with CSS class language-reasonml
instead of language-reason
with respect to main.css
.
When I copy and paste the example code into the playground I receive compiler warnings:
File "", line 9, characters 20-21: Warning 20: this argument will not be used by the function. File "", line 9, characters 22-23: Warning 20: this argument will not be used by the function.
version: // Generated by BUCKLESCRIPT VERSION 2.2.4, PLEASE EDIT WITH CARE
Is this expected?
Toggling buttons on the top of the pages doesn't seem to work.
Document pages are showing both Reason and OCaml no matter which language you choose on the top toggling menu.
I've tested this with my iOS Safari and Chrome and also macOS Safari and Chrome and they show all same results.
A couple of links are broken here: https://www.techatbloomberg.com/blog/bucklescript-1-0-release-arrived/
Hello world
examples of calling JS libraries
The playground
FFI
The link for the FFI changed, so it directs now to the header of the manual as a fallback,
instead to the FFI section
Plus, the Github button on this page leads to a complete different repo,
namely that one of Bloomberg instead of the Bucklescript one.
When somebody likes to visit your Homepage at https://bucklescript.github.io, redirects that to the manual instead to the actual Homepage, the link to the Blog does an intermediate step to a pointless page between and there is a space missing on the homepage.
@rickyvetter I think it's still crawling the Manual page
Firstly, I would like to give a massive thanks to the BuckleScript team for an amazing project!
I had just cloned this repo as I want to make some improvements to the docs site, and I realized that when I went to edit any of the .md
files, my editor was messing with the current formatting because I have the prettier extension installed. You have probably heard of prettier by now, but if you haven't, have a look at their website here.
I think prettier would make a great addition to the docs siterepo as it would format both the .md
files that contain the documentation text, as well as the .js
, .css
and .html
files that are used to build the site.
This would be useful because, from a quick look into the source files, I can see some inconsistencies in formatting. For example, sometimes trailing commas are used and sometimes they are not. It would also mean that possible new contributors (Like me!) wouldn't have to worry about how the project wants their files formatted, the editor / project would do it for me.
This could be done in two ways (Or both for better DX):
.prettierrc
) could be created at the root of the project, and a contributor's editor could recognize the file and format the files respecting these settings. The benefit of this approach is that it doesn't require much change. However, the issue is that if the contributor is not using the prettier plugin in their editor, or they just don't have one available, the code could be formatted wrong, and it would have to be changed before being merged.As mentioned above, I think that both 1 and 2 could be done together, so that when the contributor is developing, their editor will format the code correctly if they have the plugin installed, but if they don't then it doesn't matter because the pre-commit hook will format the files correctly anyway.
From what I have read of the source files, I think a config such as this would fit the project (Please correct this if it doesn't line up with the projects formatting style):
{
"printWidth": 80,
"semi": true,
"singleQuote": false,
"useTabs": false,
"tabWidth": 2,
"bracketSpacing": true,
"trailingComma": "none",
"proseWrap": "always"
}
Thanks for reading!
Bucklescript has name mangling rules (as explained in genType
's documentation) which are not explained at all in the official documentation. Can we add them? I can make a PR if the maintainers can tell me where to add them.
It uses the outcome printer though, so there are BS-EXTERNAL
tags everywhere
There is a typo (missing c in object word) on page https://bucklescript.github.io/bucklescript/api/Js.Json.html
val object_ : t Js_dict.t -> t
object_ dict makes a JSON objet of the Js.Dict.t dict
to
val object_ : t Js_dict.t -> t
object_ dict makes a JSON object of the Js.Dict.t dict
Wanted to submit a pull request but did not found the file in this repo.
Hi, I just hit the error documented here: https://bucklescript.github.io/docs/en/import-export.html#import-an-es6-default-value. I was trying to import this: https://github.com/chenglou/react-spinner
I tried the suggested fix:
[@bs.module "react-spinner"] external spinner : ReasonReact.reactClass = "default";
However it didn't work for me, I kept getting the same error. What worked in the end was this:
[@bs.module] external spinner : ReasonReact.reactClass = "react-spinner";
I suspect (but I'm not sure) this is because the exported value is a class? If we can identify the cause of the problem we can update the documentation.
https://github.com/BuckleScript/bucklescript.github.io/blob/source/docs/object.md
Please, it was rather difficult to google how to access a field of an object that is not yet created.
It would be interesting to have an .epub version of the docs. maybe we can use pandoc to generate something appropriate from the .md files.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.