├── pages ├── index.mdx ├── docs │ ├── latest.js │ ├── v8.0.0.js │ ├── manual │ │ ├── v8.0.0 │ │ │ ├── api │ │ │ │ ├── belt │ │ │ │ │ └── debug.mdx │ │ │ │ ├── js │ │ │ │ │ ├── result.mdx │ │ │ │ │ ├── typed-array-2.mdx │ │ │ │ │ ├── typed-array_array-buffer.mdx │ │ │ │ │ ├── typed-array.mdx │ │ │ │ │ ├── typed-array-2_array-buffer.mdx │ │ │ │ │ ├── types.mdx │ │ │ │ │ └── obj.mdx │ │ │ │ └── dom │ │ │ │ │ ├── storage.mdx │ │ │ │ │ └── storage2.mdx │ │ │ ├── libraries.mdx │ │ │ ├── browser-support-polyfills.mdx │ │ │ ├── editor-plugins.mdx │ │ │ ├── api.mdx │ │ │ └── reserved-keywords.mdx │ │ ├── latest │ │ │ ├── api │ │ │ │ ├── belt │ │ │ │ │ └── debug.mdx │ │ │ │ ├── js │ │ │ │ │ ├── result.mdx │ │ │ │ │ ├── typed-array-2.mdx │ │ │ │ │ ├── typed-array_array-buffer.mdx │ │ │ │ │ ├── typed-array-2_array-buffer.mdx │ │ │ │ │ ├── typed-array.mdx │ │ │ │ │ ├── obj.mdx │ │ │ │ │ └── types.mdx │ │ │ │ └── dom │ │ │ │ │ ├── storage.mdx │ │ │ │ │ └── storage2.mdx │ │ │ ├── try.mdx │ │ │ ├── warning-numbers.mdx │ │ │ ├── build-configuration-schema.mdx │ │ │ ├── browser-support-polyfills.mdx │ │ │ ├── editor-plugins.mdx │ │ │ └── api.mdx │ │ └── v9.0.0 │ │ │ ├── api │ │ │ ├── belt │ │ │ │ └── debug.mdx │ │ │ ├── js │ │ │ │ ├── result.mdx │ │ │ │ ├── typed-array-2.mdx │ │ │ │ ├── typed-array_array-buffer.mdx │ │ │ │ ├── typed-array-2_array-buffer.mdx │ │ │ │ ├── typed-array.mdx │ │ │ │ ├── obj.mdx │ │ │ │ └── types.mdx │ │ │ └── dom │ │ │ │ ├── storage.mdx │ │ │ │ └── storage2.mdx │ │ │ ├── build-configuration-schema.mdx │ │ │ ├── browser-support-polyfills.mdx │ │ │ ├── editor-plugins.mdx │ │ │ └── api.mdx │ └── reason-compiler │ │ └── latest │ │ └── nodejs-special-variables.mdx ├── blog │ └── [slug].js ├── docs-cn │ └── manual │ │ └── latest │ │ ├── api │ │ ├── belt │ │ │ └── debug.mdx │ │ ├── js │ │ │ ├── result.mdx │ │ │ ├── typed-array-2.mdx │ │ │ ├── typed-array_array-buffer.mdx │ │ │ ├── typed-array-2_array-buffer.mdx │ │ │ ├── typed-array.mdx │ │ │ ├── obj.mdx │ │ │ └── types.mdx │ │ └── dom │ │ │ ├── storage.mdx │ │ │ └── storage2.mdx │ │ ├── try.mdx │ │ ├── build-configuration-schema.mdx │ │ ├── warning-numbers.mdx │ │ ├── editor-plugins.mdx │ │ └── browser-support-polyfills.mdx ├── community │ ├── roadmap.mdx │ └── translations.mdx ├── blog.js ├── packages.js ├── syntax-lookup.mdx ├── try.js ├── _app.js ├── brand.mdx └── _document.js ├── index_data └── .gitkeep ├── public ├── blog │ └── .gitkeep └── static │ ├── hero.jpg │ ├── blog │ ├── grid_0.jpeg │ ├── compiler_release_9_0.jpg │ ├── compiler_release_9_1.jpg │ ├── landing_page_figma.png │ ├── archive │ │ ├── search-mockup.jpg │ │ ├── playground-mockup.jpg │ │ ├── youtube-search-reasonml.jpg │ │ ├── state-of-reasonml-pt1-hero.jpg │ │ ├── reasonml-org-structure-retina.jpg │ │ ├── state-of-reasonml-org-q2-2020.jpg │ │ ├── state-of-reasonml-q1-2020-card.jpg │ │ ├── reasonml-org-color-palette-retina.jpg │ │ └── state-of-reasonml-2020-q2-pt2-articleimg.jpg │ ├── editor_support_article.jpg │ ├── editor_support_preview.jpg │ ├── rescript-launch │ │ ├── ReScript-1.jpg │ │ ├── ReScript-2.jpg │ │ ├── ReScript-3.jpg │ │ └── ReScript-4.jpg │ ├── rescript_assoc_rename_preview.jpg │ └── wizard_typing_on_a_keyboard_in_a_sea_of_lava_flowing_54e33c58-aa14-4f1d-8249-dae636dfc0e9.png │ ├── ic_manual@2x.png │ ├── lp │ ├── illu_left.png │ ├── community-1.jpg │ ├── community-2.jpg │ ├── community-3.jpg │ ├── illu_right.png │ ├── easy-to-unadopt.jpg │ ├── editor-tooling-1.jpg │ ├── fast-build-preview.jpg │ ├── type-better-preview.jpg │ └── interop-example-preview.jpg │ ├── nav-logo@2x.png │ ├── favicon │ ├── favicon.ico │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── apple-touch-icon.png │ ├── android-chrome-192x192.png │ ├── android-chrome-512x512.png │ └── site.webmanifest │ ├── ic_gentype@2x.png │ ├── ic_reanalyze@2x.png │ ├── img │ ├── bstracing.png │ ├── debugger-after.png │ ├── debugger-before.png │ ├── debugger-inspector.png │ └── landing_page_figma.png │ ├── pupilfirst-logo.png │ ├── nav-logo-full@2x.png │ ├── brand │ ├── rescript-logo.png │ ├── rescript-brandmark.png │ └── rescript-logo-white.png │ ├── ic_rescript_react@2x.png │ ├── messenger-logo-64@2x.png │ ├── vitejs_starter_logo.png │ ├── Art-3-rescript-launch.jpg │ ├── illu_index_rescript@2x.png │ ├── vitejs_starter_logo@2x.png │ ├── fonts │ ├── roboto-mono-400.woff2 │ ├── roboto-mono-700.woff2 │ ├── subset-Inter-Bold.woff2 │ ├── subset-Inter-Italic.woff2 │ ├── subset-Inter-Medium.woff2 │ ├── subset-Inter-Regular.woff2 │ └── subset-Inter-SemiBold.woff2 │ ├── nextjs_starter_logo.svg │ ├── ic_sidebar_drawer.svg │ ├── star.svg │ ├── ic_search.svg │ ├── partners │ └── ahrefs.svg │ ├── nodejs_starter_logo.svg │ └── ic_package.svg ├── .nowignore ├── src ├── components │ ├── ApiMarkdown.resi │ ├── Footer.resi │ ├── Text.resi │ ├── ApiIntro.resi │ ├── ApiIntro.res │ ├── Video.resi │ ├── AnsiPre.resi │ ├── Tag.resi │ ├── Navigation.resi │ ├── DocSearch.resi │ ├── VersionSelect.resi │ ├── Image.resi │ ├── Button.resi │ ├── Text.mjs │ ├── Text.res │ ├── Meta.resi │ ├── ApiIntro.mjs │ ├── Tag.res │ ├── CodeExample.resi │ ├── Tag.mjs │ ├── Docson.resi │ ├── WarningTable.res │ ├── VersionSelect.res │ ├── Image.res │ ├── Video.res │ ├── ApiMarkdown.res │ ├── Docson.mjs │ ├── Button.res │ ├── Image.mjs │ ├── VersionSelect.mjs │ ├── Docson.res │ ├── ApiMarkdown.mjs │ └── Video.mjs ├── Design.resi ├── SyntaxLookup.resi ├── common │ ├── App.resi │ ├── ColorTheme.resi │ ├── LzString.mjs │ ├── HighlightJs.resi │ ├── ColorTheme.res │ ├── DateStr.resi │ ├── ColorTheme.mjs │ ├── DocFrontmatter.resi │ ├── DateStr.mjs │ ├── LzString.res │ ├── DateStr.res │ ├── Util.resi │ ├── Url.resi │ ├── LangUtil.res │ ├── XmlHttpRequest.mjs │ ├── WarningFlagDescription.resi │ ├── BlogApi.resi │ ├── LangUtil.mjs │ ├── DocFrontmatter.res │ └── Constants.res ├── Playground.resi ├── bindings │ ├── GitHubSlugger.res │ ├── Fuse.mjs │ ├── GitHubSlugger.mjs │ ├── Webapi.mjs │ ├── HeadlessUI.mjs │ ├── Fuse.res │ ├── Worker.resi │ ├── Worker.res │ ├── Webapi.res │ └── Worker.mjs ├── DocsOverview.resi ├── layouts │ ├── MainLayout.resi │ ├── LandingPageLayout.resi │ ├── ReasonCompilerDocsLayout.resi │ ├── ApiOverviewLayout8_0_0.resi │ ├── CommunityLayout.resi │ ├── GenTypeDocsLayout.resi │ ├── ApiOverviewLayout.resi │ ├── BeltDocsLayout.resi │ ├── DomDocsLayout.resi │ ├── JsDocsLayout.resi │ ├── BeltDocsLayout8_0_0.resi │ ├── DomDocsLayout8_0_0.resi │ ├── JsDocsLayout8_0_0.resi │ ├── ApiLayout.resi │ ├── CommunityLayout.res │ ├── MainLayout.res │ └── GenTypeDocsLayout.res ├── Blog.resi ├── BlogArticle.resi ├── vendor │ └── Json.ml ├── Packages.resi ├── Design.res ├── ffi │ ├── loadScript.js │ └── parse-numeric-range.js └── Design.mjs ├── jsconfig.json ├── .github ├── FUNDING.yml └── workflows │ └── pull-request.yml ├── .babelrc ├── now.json ├── scripts ├── generate_feed.res └── generate_feed.mjs ├── data ├── sidebar_community.json ├── sidebar_gentype_latest.json ├── packages_url_resources.json └── sidebar_react_latest.json ├── postcss.config.js ├── compilers ├── README.md └── package.json ├── styles ├── utils.css ├── _theme.css └── _markdown.css ├── Makefile ├── _blogposts └── archive │ ├── 2017-10-01-bucklescript-release-1-0.mdx │ ├── 2017-10-03-bucklescript-release-1-4-3.mdx │ ├── 2019-03-31-bucklescript-release-6-0.mdx │ ├── 2017-10-05-bucklescript-release-1-5-1.mdx │ ├── 2017-10-06-bucklescript-release-1-5-2.mdx │ ├── 2017-10-04-bucklescript-release-1-5-0.mdx │ ├── 2018-05-23-bucklescript-release-3-1-4.mdx │ ├── 2020-08-03-bucklescript-release-8-2.mdx │ ├── 2019-01-07-bucklescript-release-4-0-17.mdx │ ├── 2017-10-02-bucklescript-release-1-4-2.mdx │ ├── 2019-03-21-bucklescript-release-5-0.mdx │ └── 2017-10-08-bucklescript-release-1-7-4.mdx ├── .gitignore ├── misc_docs └── syntax │ ├── specialvalues_line.mdx │ ├── specialvalues_file.mdx │ ├── operators_mod.mdx │ ├── specialvalues_module.mdx │ ├── operators_float_division.mdx │ ├── operators_string_concatenation.mdx │ ├── operators_integer_subtraction.mdx │ ├── operators_integer_multiplication.mdx │ ├── operators_float_addition.mdx │ ├── operators_float_subtraction.mdx │ ├── operators_float_multiplication.mdx │ ├── specialvalues_loc.mdx │ ├── operators_integer_addition.mdx │ ├── language_function.mdx │ ├── language_let.mdx │ ├── decorator_module_warning.mdx │ ├── decorator_scope.mdx │ ├── operators_integer_division.mdx │ ├── decorator_get.mdx │ ├── decorator_new.mdx │ ├── decorator_module.mdx │ ├── decorator_set.mdx │ ├── extension_debugger.mdx │ ├── language_if_else.mdx │ ├── specialvalues_line_of.mdx │ ├── decorator_variadic.mdx │ ├── decorator_val.mdx │ ├── decorator_ignore.mdx │ ├── decorator_unboxed.mdx │ ├── builtinfunctions_ignore.mdx │ ├── decorator_inline.mdx │ ├── language_string_literal.mdx │ ├── specialvalues_loc_of.mdx │ ├── extension_regular_expression.mdx │ ├── language_module.mdx │ ├── decorator_obj.mdx │ ├── language_string_interpolation.mdx │ ├── decorator_meth.mdx │ ├── decorator_int.mdx │ ├── decorator_module_deprecated.mdx │ ├── extension_identity.mdx │ ├── decorator_unwrap.mdx │ ├── decorator_raises.mdx │ ├── operator_ref_value_assignment.mdx │ ├── specialvalues_pos.mdx │ ├── decorator_dead.mdx │ ├── decorator_string.mdx │ ├── extension_private_let.mdx │ ├── language_char_literal.mdx │ ├── language_uncurried_function.mdx │ ├── decorator_send.mdx │ ├── decorator_does_not_raise.mdx │ ├── extension_raw_expression.mdx │ ├── decorator_live.mdx │ ├── decorator_set_index.mdx │ ├── specialvalues_pos_of.mdx │ ├── decorator_get_index.mdx │ ├── decorator_return.mdx │ ├── decorator_expression_deprecated.mdx │ ├── language_open.mdx │ ├── decorator_send_pipe.mdx │ ├── language_type.mdx │ └── language_switch.mdx ├── plugins └── next-mdx.js ├── bsconfig.json └── LICENSE /pages/index.mdx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /index_data/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/blog/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.nowignore: -------------------------------------------------------------------------------- 1 | .next/ 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /src/components/ApiMarkdown.resi: -------------------------------------------------------------------------------- 1 | let default: Mdx.Components.t 2 | -------------------------------------------------------------------------------- /src/Design.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let default: unit => React.element 3 | -------------------------------------------------------------------------------- /src/SyntaxLookup.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: unit => React.element 3 | -------------------------------------------------------------------------------- /src/common/App.resi: -------------------------------------------------------------------------------- 1 | type props 2 | 3 | let make: props => React.element 4 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "." 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/Playground.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let default: unit => React.element 3 | -------------------------------------------------------------------------------- /src/components/Footer.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: unit => React.element 3 | -------------------------------------------------------------------------------- /src/common/ColorTheme.resi: -------------------------------------------------------------------------------- 1 | type t = [#Reason | #Js] 2 | 3 | let toCN: t => string 4 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: ryyppy 2 | custom: https://rescript-association.org/donate 3 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "next/babel" 4 | ], 5 | "plugins": [ 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /pages/docs/latest.js: -------------------------------------------------------------------------------- 1 | import make from "src/DocsOverview.mjs"; 2 | 3 | export default make; 4 | -------------------------------------------------------------------------------- /pages/docs/v8.0.0.js: -------------------------------------------------------------------------------- 1 | import make from "src/DocsOverview.mjs"; 2 | 3 | export default make; 4 | -------------------------------------------------------------------------------- /src/bindings/GitHubSlugger.res: -------------------------------------------------------------------------------- 1 | @module("github-slugger") external slug: string => string = "slug" 2 | -------------------------------------------------------------------------------- /src/components/Text.resi: -------------------------------------------------------------------------------- 1 | module Link: { 2 | let inline: string 3 | let standalone: string 4 | } 5 | -------------------------------------------------------------------------------- /src/DocsOverview.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let default: (~showVersionSelect: bool=?) => React.element 3 | -------------------------------------------------------------------------------- /src/components/ApiIntro.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: (~children: React.element) => React.element 3 | -------------------------------------------------------------------------------- /src/components/ApiIntro.res: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make = (~children) =>
children
3 | -------------------------------------------------------------------------------- /src/components/Video.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let default: (~src: string, ~caption: string=?) => React.element 3 | -------------------------------------------------------------------------------- /src/components/AnsiPre.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: (~className: string=?, ~children: string) => React.element 3 | -------------------------------------------------------------------------------- /now.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "scope": "reason-association", 4 | "github": { 5 | "silent": true 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /pages/blog/[slug].js: -------------------------------------------------------------------------------- 1 | export { 2 | default, 3 | getStaticPaths, 4 | getStaticProps 5 | } from "src/BlogArticle.mjs"; 6 | -------------------------------------------------------------------------------- /public/static/hero.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/hero.jpg -------------------------------------------------------------------------------- /scripts/generate_feed.res: -------------------------------------------------------------------------------- 1 | let content = { 2 | open BlogApi.RssFeed 3 | getLatest()->toXmlString 4 | } 5 | 6 | Js.log(content) 7 | -------------------------------------------------------------------------------- /src/components/Tag.resi: -------------------------------------------------------------------------------- 1 | type kind = [#Subtle] 2 | 3 | @react.component 4 | let make: (~text: string, ~kind: kind=?) => React.element 5 | -------------------------------------------------------------------------------- /src/layouts/MainLayout.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: (~components: Mdx.Components.t=?, ~children: React.element) => React.element 3 | -------------------------------------------------------------------------------- /public/static/blog/grid_0.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/grid_0.jpeg -------------------------------------------------------------------------------- /public/static/ic_manual@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/ic_manual@2x.png -------------------------------------------------------------------------------- /public/static/lp/illu_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/lp/illu_left.png -------------------------------------------------------------------------------- /public/static/nav-logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/nav-logo@2x.png -------------------------------------------------------------------------------- /src/components/Navigation.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: (~fixed: bool=?, ~overlayState: (bool, (bool => bool) => unit)) => React.element 3 | -------------------------------------------------------------------------------- /src/layouts/LandingPageLayout.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: (~components: Mdx.Components.t=?, ~children: React.element) => React.element 3 | -------------------------------------------------------------------------------- /pages/docs/manual/v8.0.0/api/belt/debug.mdx: -------------------------------------------------------------------------------- 1 | # Debug 2 | 3 | ## setupChromeDebugger 4 | 5 | ``` 6 | let setupChromeDebugger: unit => unit; 7 | ``` 8 | -------------------------------------------------------------------------------- /public/static/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/favicon/favicon.ico -------------------------------------------------------------------------------- /public/static/ic_gentype@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/ic_gentype@2x.png -------------------------------------------------------------------------------- /public/static/ic_reanalyze@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/ic_reanalyze@2x.png -------------------------------------------------------------------------------- /public/static/img/bstracing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/img/bstracing.png -------------------------------------------------------------------------------- /public/static/lp/community-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/lp/community-1.jpg -------------------------------------------------------------------------------- /public/static/lp/community-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/lp/community-2.jpg -------------------------------------------------------------------------------- /public/static/lp/community-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/lp/community-3.jpg -------------------------------------------------------------------------------- /public/static/lp/illu_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/lp/illu_right.png -------------------------------------------------------------------------------- /public/static/pupilfirst-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/pupilfirst-logo.png -------------------------------------------------------------------------------- /src/layouts/ReasonCompilerDocsLayout.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: (~components: Mdx.Components.t=?, ~children: React.element) => React.element 3 | -------------------------------------------------------------------------------- /data/sidebar_community.json: -------------------------------------------------------------------------------- 1 | { 2 | "Resources": [ 3 | "overview", 4 | "roadmap", 5 | "code-of-conduct", 6 | "translations" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /pages/docs/manual/latest/api/belt/debug.mdx: -------------------------------------------------------------------------------- 1 | # Debug 2 | 3 | ## setupChromeDebugger 4 | 5 | ```res sig 6 | let setupChromeDebugger: unit => unit 7 | ``` 8 | -------------------------------------------------------------------------------- /pages/docs/manual/v9.0.0/api/belt/debug.mdx: -------------------------------------------------------------------------------- 1 | # Debug 2 | 3 | ## setupChromeDebugger 4 | 5 | ```res sig 6 | let setupChromeDebugger: unit => unit 7 | ``` 8 | -------------------------------------------------------------------------------- /public/static/nav-logo-full@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/nav-logo-full@2x.png -------------------------------------------------------------------------------- /pages/docs-cn/manual/latest/api/belt/debug.mdx: -------------------------------------------------------------------------------- 1 | # Debug 2 | 3 | ## setupChromeDebugger 4 | 5 | ```res sig 6 | let setupChromeDebugger: unit => unit 7 | ``` 8 | -------------------------------------------------------------------------------- /public/static/brand/rescript-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/brand/rescript-logo.png -------------------------------------------------------------------------------- /public/static/ic_rescript_react@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/ic_rescript_react@2x.png -------------------------------------------------------------------------------- /public/static/img/debugger-after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/img/debugger-after.png -------------------------------------------------------------------------------- /public/static/img/debugger-before.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/img/debugger-before.png -------------------------------------------------------------------------------- /public/static/lp/easy-to-unadopt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/lp/easy-to-unadopt.jpg -------------------------------------------------------------------------------- /public/static/lp/editor-tooling-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/lp/editor-tooling-1.jpg -------------------------------------------------------------------------------- /public/static/messenger-logo-64@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/messenger-logo-64@2x.png -------------------------------------------------------------------------------- /public/static/vitejs_starter_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/vitejs_starter_logo.png -------------------------------------------------------------------------------- /public/static/Art-3-rescript-launch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/Art-3-rescript-launch.jpg -------------------------------------------------------------------------------- /public/static/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /public/static/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /public/static/illu_index_rescript@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/illu_index_rescript@2x.png -------------------------------------------------------------------------------- /public/static/img/debugger-inspector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/img/debugger-inspector.png -------------------------------------------------------------------------------- /public/static/img/landing_page_figma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/img/landing_page_figma.png -------------------------------------------------------------------------------- /public/static/lp/fast-build-preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/lp/fast-build-preview.jpg -------------------------------------------------------------------------------- /public/static/lp/type-better-preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/lp/type-better-preview.jpg -------------------------------------------------------------------------------- /public/static/vitejs_starter_logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/vitejs_starter_logo@2x.png -------------------------------------------------------------------------------- /public/static/blog/compiler_release_9_0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/compiler_release_9_0.jpg -------------------------------------------------------------------------------- /public/static/blog/compiler_release_9_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/compiler_release_9_1.jpg -------------------------------------------------------------------------------- /public/static/blog/landing_page_figma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/landing_page_figma.png -------------------------------------------------------------------------------- /public/static/brand/rescript-brandmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/brand/rescript-brandmark.png -------------------------------------------------------------------------------- /public/static/brand/rescript-logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/brand/rescript-logo-white.png -------------------------------------------------------------------------------- /public/static/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /public/static/fonts/roboto-mono-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/fonts/roboto-mono-400.woff2 -------------------------------------------------------------------------------- /public/static/fonts/roboto-mono-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/fonts/roboto-mono-700.woff2 -------------------------------------------------------------------------------- /public/static/fonts/subset-Inter-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/fonts/subset-Inter-Bold.woff2 -------------------------------------------------------------------------------- /public/static/blog/archive/search-mockup.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/archive/search-mockup.jpg -------------------------------------------------------------------------------- /public/static/blog/editor_support_article.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/editor_support_article.jpg -------------------------------------------------------------------------------- /public/static/blog/editor_support_preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/editor_support_preview.jpg -------------------------------------------------------------------------------- /public/static/fonts/subset-Inter-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/fonts/subset-Inter-Italic.woff2 -------------------------------------------------------------------------------- /public/static/fonts/subset-Inter-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/fonts/subset-Inter-Medium.woff2 -------------------------------------------------------------------------------- /public/static/lp/interop-example-preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/lp/interop-example-preview.jpg -------------------------------------------------------------------------------- /public/static/blog/archive/playground-mockup.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/archive/playground-mockup.jpg -------------------------------------------------------------------------------- /public/static/favicon/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/favicon/android-chrome-192x192.png -------------------------------------------------------------------------------- /public/static/favicon/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/favicon/android-chrome-512x512.png -------------------------------------------------------------------------------- /public/static/fonts/subset-Inter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/fonts/subset-Inter-Regular.woff2 -------------------------------------------------------------------------------- /public/static/fonts/subset-Inter-SemiBold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/fonts/subset-Inter-SemiBold.woff2 -------------------------------------------------------------------------------- /src/bindings/Fuse.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | 3 | 4 | var Options = {}; 5 | 6 | export { 7 | Options , 8 | } 9 | /* No side effect */ 10 | -------------------------------------------------------------------------------- /src/layouts/ApiOverviewLayout8_0_0.resi: -------------------------------------------------------------------------------- 1 | module Docs: { 2 | @react.component 3 | let make: (~components: Mdx.Components.t=?, ~children: React.element) => React.element 4 | } 5 | -------------------------------------------------------------------------------- /pages/community/roadmap.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Roadmap" 3 | description: "Goals & Future Releases" 4 | canonical: "/community/roadmap" 5 | --- 6 | 7 | # Roadmap 8 | 9 | TODO 10 | -------------------------------------------------------------------------------- /public/static/blog/rescript-launch/ReScript-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/rescript-launch/ReScript-1.jpg -------------------------------------------------------------------------------- /public/static/blog/rescript-launch/ReScript-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/rescript-launch/ReScript-2.jpg -------------------------------------------------------------------------------- /public/static/blog/rescript-launch/ReScript-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/rescript-launch/ReScript-3.jpg -------------------------------------------------------------------------------- /public/static/blog/rescript-launch/ReScript-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/rescript-launch/ReScript-4.jpg -------------------------------------------------------------------------------- /src/common/LzString.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 3 | -------------------------------------------------------------------------------- /data/sidebar_gentype_latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "概览": [ 3 | "introduction", 4 | "getting-started", 5 | "usage" 6 | ], 7 | "进阶": [ 8 | "supported-types" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /public/static/blog/rescript_assoc_rename_preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/rescript_assoc_rename_preview.jpg -------------------------------------------------------------------------------- /src/common/HighlightJs.resi: -------------------------------------------------------------------------------- 1 | let renderHLJS: ( 2 | ~highlightedLines: array=?, 3 | ~darkmode: bool=?, 4 | ~code: string, 5 | ~lang: string, 6 | unit, 7 | ) => React.element 8 | -------------------------------------------------------------------------------- /src/components/DocSearch.resi: -------------------------------------------------------------------------------- 1 | module Textbox: { 2 | @react.component 3 | let make: (~id: string) => React.element 4 | } 5 | 6 | @react.component 7 | let make: unit => React.element 8 | -------------------------------------------------------------------------------- /pages/blog.js: -------------------------------------------------------------------------------- 1 | import BlogRes from "src/Blog.mjs"; 2 | 3 | export { getStaticProps } from "src/Blog.mjs"; 4 | 5 | export default function Blog(props) { 6 | return 7 | } 8 | -------------------------------------------------------------------------------- /public/static/blog/archive/youtube-search-reasonml.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/archive/youtube-search-reasonml.jpg -------------------------------------------------------------------------------- /src/Blog.resi: -------------------------------------------------------------------------------- 1 | let defaultPreviewImg: string 2 | 3 | type params 4 | type props 5 | 6 | let default: props => React.element 7 | 8 | let getStaticProps: Next.GetStaticProps.t 9 | -------------------------------------------------------------------------------- /src/bindings/GitHubSlugger.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 3 | -------------------------------------------------------------------------------- /src/layouts/CommunityLayout.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: ( 3 | ~frontmatter: Js.Json.t=?, 4 | ~components: Mdx.Components.t=?, 5 | ~children: React.element, 6 | ) => React.element 7 | -------------------------------------------------------------------------------- /src/layouts/GenTypeDocsLayout.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: ( 3 | ~frontmatter: Js.Json.t=?, 4 | ~components: Mdx.Components.t=?, 5 | ~children: React.element, 6 | ) => React.element 7 | -------------------------------------------------------------------------------- /pages/packages.js: -------------------------------------------------------------------------------- 1 | import Comp from "src/Packages" 2 | 3 | export { getStaticProps } from "src/Packages" 4 | 5 | export default function PackagesPage(props) { 6 | return ; 7 | } 8 | -------------------------------------------------------------------------------- /public/static/blog/archive/state-of-reasonml-pt1-hero.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/archive/state-of-reasonml-pt1-hero.jpg -------------------------------------------------------------------------------- /src/common/ColorTheme.res: -------------------------------------------------------------------------------- 1 | // Equivalent to styles/_theme.css 2 | 3 | @deriving(jsConverter) 4 | type t = [@as("theme-reason") #Reason | @as("theme-js") #Js] 5 | 6 | let toCN = value => tToJs(value) 7 | -------------------------------------------------------------------------------- /public/static/blog/archive/reasonml-org-structure-retina.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/archive/reasonml-org-structure-retina.jpg -------------------------------------------------------------------------------- /public/static/blog/archive/state-of-reasonml-org-q2-2020.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/archive/state-of-reasonml-org-q2-2020.jpg -------------------------------------------------------------------------------- /public/static/blog/archive/state-of-reasonml-q1-2020-card.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/archive/state-of-reasonml-q1-2020-card.jpg -------------------------------------------------------------------------------- /src/components/VersionSelect.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: ( 3 | ~onChange: ReactEvent.Form.t => unit, 4 | ~version: string, 5 | ~availableVersions: array<(string, string)>, 6 | ) => React.element 7 | -------------------------------------------------------------------------------- /public/static/blog/archive/reasonml-org-color-palette-retina.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/archive/reasonml-org-color-palette-retina.jpg -------------------------------------------------------------------------------- /src/layouts/ApiOverviewLayout.resi: -------------------------------------------------------------------------------- 1 | module Docs: { 2 | @react.component 3 | let make: (~lang: LangUtil.language=?, ~components: Mdx.Components.t=?, 4 | ~children: React.element) => React.element 5 | } 6 | -------------------------------------------------------------------------------- /public/static/blog/archive/state-of-reasonml-2020-q2-pt2-articleimg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/archive/state-of-reasonml-2020-q2-pt2-articleimg.jpg -------------------------------------------------------------------------------- /src/components/Image.resi: -------------------------------------------------------------------------------- 1 | // This component is representing a embedded image, mainly used for markdown content 2 | 3 | @react.component 4 | let default: (~src: string, ~withShadow: bool=?, ~caption: string=?) => React.element 5 | -------------------------------------------------------------------------------- /src/common/DateStr.resi: -------------------------------------------------------------------------------- 1 | /* JSON doesn't support a native date type, so we need to codify dates as strings */ 2 | type t 3 | 4 | external fromString: string => t = "%identity" 5 | 6 | let fromDate: Js.Date.t => t 7 | let toDate: t => Js.Date.t 8 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | const plugins ={ 2 | tailwindcss: {}, 3 | autoprefixer: {} 4 | }; 5 | 6 | if(process.env.NODE_ENV === 'production') { 7 | plugins.cssnano = {}; 8 | } 9 | 10 | module.exports = { 11 | plugins: plugins 12 | }; 13 | -------------------------------------------------------------------------------- /pages/docs-cn/manual/latest/api/js/result.mdx: -------------------------------------------------------------------------------- 1 | # Result 2 | 3 | 4 | 5 | Define the interface for result. 6 | 7 | 8 | 9 | ## t 10 | 11 | ```res sig 12 | type t<'good, 'bad> = 13 | | Ok('good) 14 | | Error('bad) 15 | ``` 16 | -------------------------------------------------------------------------------- /pages/docs/manual/latest/api/js/result.mdx: -------------------------------------------------------------------------------- 1 | # Result 2 | 3 | 4 | 5 | Define the interface for result. 6 | 7 | 8 | 9 | ## t 10 | 11 | ```res sig 12 | type t<'good, 'bad> = 13 | | Ok('good) 14 | | Error('bad) 15 | ``` 16 | -------------------------------------------------------------------------------- /pages/docs/manual/v8.0.0/api/js/result.mdx: -------------------------------------------------------------------------------- 1 | # Result 2 | 3 | 4 | 5 | Define the interface for result. 6 | 7 | 8 | 9 | ## t 10 | 11 | ```re sig 12 | type t('good, 'bad) = 13 | | Ok('good) 14 | | Error('bad); 15 | ``` 16 | -------------------------------------------------------------------------------- /pages/docs/manual/v9.0.0/api/js/result.mdx: -------------------------------------------------------------------------------- 1 | # Result 2 | 3 | 4 | 5 | Define the interface for result. 6 | 7 | 8 | 9 | ## t 10 | 11 | ```res sig 12 | type t<'good, 'bad> = 13 | | Ok('good) 14 | | Error('bad) 15 | ``` 16 | -------------------------------------------------------------------------------- /src/bindings/Webapi.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | 3 | 4 | var $$Document = {}; 5 | 6 | var ClassList = {}; 7 | 8 | var $$Element = {}; 9 | 10 | export { 11 | $$Document , 12 | ClassList , 13 | $$Element , 14 | } 15 | /* No side effect */ 16 | -------------------------------------------------------------------------------- /src/common/ColorTheme.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | 3 | 4 | var _map = {"Reason":"theme-reason","Js":"theme-js"}; 5 | 6 | function toCN(value) { 7 | return _map[value]; 8 | } 9 | 10 | export { 11 | toCN , 12 | } 13 | /* No side effect */ 14 | -------------------------------------------------------------------------------- /pages/syntax-lookup.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Syntax Lookup" 3 | description: "Discover ReScript syntax constructs with our lookup tool" 4 | canonical: "/docs/manual/latest/syntax-lookup" 5 | --- 6 | 7 | import { make as SyntaxLookup } from "src/SyntaxLookup" 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/BlogArticle.resi: -------------------------------------------------------------------------------- 1 | module Params: { 2 | type t = {slug: string} 3 | } 4 | 5 | type props = {path: string} 6 | 7 | let default: props => React.element 8 | 9 | let getStaticProps: Next.GetStaticProps.t 10 | let getStaticPaths: Next.GetStaticPaths.t 11 | -------------------------------------------------------------------------------- /src/layouts/BeltDocsLayout.resi: -------------------------------------------------------------------------------- 1 | module Docs: { 2 | @react.component 3 | let make: (~components: Mdx.Components.t=?, ~children: React.element) => React.element 4 | } 5 | 6 | module Prose: { 7 | @react.component 8 | let make: (~children: React.element) => React.element 9 | } 10 | -------------------------------------------------------------------------------- /src/layouts/DomDocsLayout.resi: -------------------------------------------------------------------------------- 1 | module Docs: { 2 | @react.component 3 | let make: (~components: Mdx.Components.t=?, ~children: React.element) => React.element 4 | } 5 | 6 | module Prose: { 7 | @react.component 8 | let make: (~children: React.element) => React.element 9 | } 10 | -------------------------------------------------------------------------------- /src/layouts/JsDocsLayout.resi: -------------------------------------------------------------------------------- 1 | module Docs: { 2 | @react.component 3 | let make: (~components: Mdx.Components.t=?, ~children: React.element) => React.element 4 | } 5 | 6 | module Prose: { 7 | @react.component 8 | let make: (~children: React.element) => React.element 9 | } 10 | -------------------------------------------------------------------------------- /pages/try.js: -------------------------------------------------------------------------------- 1 | import dynamic from "next/dynamic"; 2 | 3 | const Playground = dynamic(() => import("src/Playground.mjs"), { 4 | ssr: false, 5 | //loading: () =>
Loading...
6 | }); 7 | 8 | function Try() { 9 | return ; 10 | } 11 | 12 | export default Try; 13 | -------------------------------------------------------------------------------- /public/static/favicon/site.webmanifest: -------------------------------------------------------------------------------- 1 | {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} -------------------------------------------------------------------------------- /src/layouts/BeltDocsLayout8_0_0.resi: -------------------------------------------------------------------------------- 1 | module Docs: { 2 | @react.component 3 | let make: (~components: Mdx.Components.t=?, ~children: React.element) => React.element 4 | } 5 | 6 | module Prose: { 7 | @react.component 8 | let make: (~children: React.element) => React.element 9 | } 10 | -------------------------------------------------------------------------------- /src/layouts/DomDocsLayout8_0_0.resi: -------------------------------------------------------------------------------- 1 | module Docs: { 2 | @react.component 3 | let make: (~components: Mdx.Components.t=?, ~children: React.element) => React.element 4 | } 5 | 6 | module Prose: { 7 | @react.component 8 | let make: (~children: React.element) => React.element 9 | } 10 | -------------------------------------------------------------------------------- /src/layouts/JsDocsLayout8_0_0.resi: -------------------------------------------------------------------------------- 1 | module Docs: { 2 | @react.component 3 | let make: (~components: Mdx.Components.t=?, ~children: React.element) => React.element 4 | } 5 | 6 | module Prose: { 7 | @react.component 8 | let make: (~children: React.element) => React.element 9 | } 10 | -------------------------------------------------------------------------------- /public/static/blog/wizard_typing_on_a_keyboard_in_a_sea_of_lava_flowing_54e33c58-aa14-4f1d-8249-dae636dfc0e9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rescript-idea/rescript-lang.org-chinese-translation/HEAD/public/static/blog/wizard_typing_on_a_keyboard_in_a_sea_of_lava_flowing_54e33c58-aa14-4f1d-8249-dae636dfc0e9.png -------------------------------------------------------------------------------- /src/common/DocFrontmatter.resi: -------------------------------------------------------------------------------- 1 | type t = { 2 | title: string, 3 | metaTitle: Js.null, // If there's no metaTitle, we will take title instead 4 | description: Js.null, 5 | canonical: Js.null, 6 | ghEditHref: string, 7 | } 8 | 9 | let decode: Js.Json.t => option 10 | -------------------------------------------------------------------------------- /src/components/Button.resi: -------------------------------------------------------------------------------- 1 | type kind = PrimaryRed | PrimaryBlue | SecondaryRed 2 | type size = Small | Large 3 | 4 | @react.component 5 | let make: ( 6 | ~href: string=?, 7 | ~target: string=?, 8 | ~kind: kind=?, 9 | ~size: size=?, 10 | ~children: React.element, 11 | ) => React.element 12 | -------------------------------------------------------------------------------- /src/components/Text.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | 3 | 4 | var Link = { 5 | inline: "no-underline border-b border-gray-80 hover:border-bs-purple text-inherit", 6 | standalone: "no-underline text-fire" 7 | }; 8 | 9 | export { 10 | Link , 11 | } 12 | /* No side effect */ 13 | -------------------------------------------------------------------------------- /compilers/README.md: -------------------------------------------------------------------------------- 1 | # compilers 2 | 3 | This folder is needed to install additional rescript compiler versions for testing our documented source code on multiple compiler versions. 4 | 5 | Our `scripts/test-examples.js` script will automatically install all package.json dependencies if it cannot find any compiler versions. 6 | -------------------------------------------------------------------------------- /pages/docs/manual/latest/try.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Try" 3 | description: "Try ReScript via Command Line" 4 | canonical: "/docs/manual/latest/try" 5 | --- 6 | 7 | ## Try Online 8 | 9 | Our [Playground](/try) lets you try ReScript online, and comes with [ReScript-React](/docs/react/latest/introduction) preinstalled. 10 | -------------------------------------------------------------------------------- /src/components/Text.res: -------------------------------------------------------------------------------- 1 | // This file was automatically converted to ReScript from 'Text.re' 2 | // Check the output and make sure to delete the original file 3 | module Link = { 4 | let inline = "no-underline border-b border-gray-80 hover:border-bs-purple text-inherit" 5 | let standalone = "no-underline text-fire" 6 | } 7 | -------------------------------------------------------------------------------- /src/common/DateStr.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | 3 | 4 | function fromDate(date) { 5 | return date.toString(); 6 | } 7 | 8 | function toDate(dateStr) { 9 | return new Date(dateStr.replace(/-/g, "/")); 10 | } 11 | 12 | export { 13 | fromDate , 14 | toDate , 15 | } 16 | /* No side effect */ 17 | -------------------------------------------------------------------------------- /src/common/LzString.res: -------------------------------------------------------------------------------- 1 | // Used for compressing / decompressing code for url sharing 2 | 3 | @module("lz-string") 4 | external compressToEncodedURIComponent: string => string = "compressToEncodedURIComponent" 5 | 6 | @module("lz-string") 7 | external decompressToEncodedURIComponent: string => string = "decompressFromEncodedURIComponent" 8 | -------------------------------------------------------------------------------- /src/components/Meta.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: ( 3 | ~siteName: string=?, 4 | ~keywords: array=?, 5 | ~description: string=?, 6 | ~canonical: string=?, 7 | ~title: string=?, 8 | ~ogLocale: string=?, 9 | ~ogSiteName: string=?, 10 | ~ogDescription: string=?, 11 | ~ogTitle: string=?, 12 | ~ogImage: string=?, 13 | ) => React.element 14 | -------------------------------------------------------------------------------- /.github/workflows/pull-request.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | on: [pull_request] 3 | jobs: 4 | build: 5 | name: Test 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v2 9 | - uses: actions/setup-node@v2 10 | with: 11 | node-version: 14.x 12 | - run: npm ci 13 | - run: npx rescript 14 | - run: npm test 15 | -------------------------------------------------------------------------------- /scripts/generate_feed.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | 3 | import * as BlogApi from "../src/common/BlogApi.mjs"; 4 | 5 | var content = BlogApi.RssFeed.toXmlString(undefined, undefined, BlogApi.RssFeed.getLatest(undefined, undefined, undefined)); 6 | 7 | console.log(content); 8 | 9 | export { 10 | content , 11 | } 12 | /* content Not a pure module */ 13 | -------------------------------------------------------------------------------- /public/static/nextjs_starter_logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/common/DateStr.res: -------------------------------------------------------------------------------- 1 | type t = string 2 | 3 | // Used to prevent issues with webkit based date representations 4 | let parse = (dateStr: string): Js.Date.t => 5 | dateStr->Js.String2.replaceByRe(%re("/-/g"), "/")->Js.Date.fromString 6 | 7 | let fromDate = date => Js.Date.toString(date) 8 | let toDate = dateStr => parse(dateStr) 9 | 10 | external fromString: string => t = "%identity" 11 | -------------------------------------------------------------------------------- /styles/utils.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | .gradientShadow { 4 | /*box-shadow: inset 30 -30 50px 50px #edf0f2, inset 15 0 -20px 50px #edf0f2;*/ 5 | 6 | /*background: red;*/ 7 | background: linear-gradient(to right, rgba(244, 100, 106, 0.4), rgba(234, 151, 67, 0.4)); 8 | transform: translateY(20px) scale(0.95); 9 | filter: blur(15px); 10 | opacity: 0.7; 11 | transition: opacity 0.3s; 12 | } 13 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SHELL = /bin/bash 2 | 3 | node_modules/.bin/rescript: 4 | npm install 5 | npm run update-index 6 | 7 | build: node_modules/.bin/rescript 8 | node_modules/.bin/rescript 9 | npm run update-index 10 | 11 | dev: build 12 | npm run dev 13 | 14 | test: build 15 | npm run test 16 | 17 | clean: 18 | rm -r node_modules lib 19 | 20 | .DEFAULT_GOAL := build 21 | 22 | .PHONY: clean test 23 | -------------------------------------------------------------------------------- /_blogposts/archive/2017-10-01-bucklescript-release-1-0.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | author: hongbo 3 | date: "2017-10-01" 4 | previewImg: 5 | badge: release 6 | title: Bloomberg announces BuckleScript 1.0 7 | description: | 8 | --- 9 | 10 | ## Hello World! 11 | 12 | The BuckleScript announcement can be found on the [Tech at Bloomberg 13 | blog](https://www.techatbloomberg.com/blog/bucklescript-1-0-release-arrived/). 14 | -------------------------------------------------------------------------------- /public/static/ic_sidebar_drawer.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/ApiIntro.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | 3 | import * as React from "react"; 4 | 5 | function ApiIntro(Props) { 6 | var children = Props.children; 7 | return React.createElement("div", { 8 | className: "my-10" 9 | }, children); 10 | } 11 | 12 | var make = ApiIntro; 13 | 14 | export { 15 | make , 16 | } 17 | /* react Not a pure module */ 18 | -------------------------------------------------------------------------------- /src/common/Util.resi: -------------------------------------------------------------------------------- 1 | module Url: { 2 | let isAbsolute: string => bool 3 | } 4 | 5 | module Unsafe: { 6 | let elementAsString: React.element => string 7 | } 8 | 9 | module String: { 10 | let camelCase: string => string 11 | let capitalize: string => string 12 | } 13 | 14 | module Date: { 15 | let toDayMonthYear: Js.Date.t => string 16 | } 17 | 18 | module Json: { 19 | let prettyStringify: Js.Json.t => string 20 | } 21 | -------------------------------------------------------------------------------- /compilers/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "compilers", 3 | "private": true, 4 | "version": "1.0.0", 5 | "main": "index.js", 6 | "license": "MIT", 7 | "dependencies": { 8 | "rescript-820": "npm:bs-platform@8.2.0", 9 | "rescript-902": "npm:bs-platform@9.0.2", 10 | "rescript-912": "npm:rescript@9.1.2", 11 | "rescript-1000": "npm:rescript@10.0.0", 12 | "rescript-1010": "npm:rescript@10.1.0-rc.4" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /public/static/star.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/common/Url.resi: -------------------------------------------------------------------------------- 1 | type version = 2 | | Latest 3 | | NoVersion 4 | | Version(string) 5 | 6 | type t = { 7 | fullpath: array, 8 | base: array, 9 | version: version, 10 | pagepath: array, 11 | } 12 | 13 | // Moved here from original SidebarLayout.UrlPath 14 | type breadcrumb = { 15 | name: string, 16 | href: string, 17 | } 18 | 19 | let parse: string => t 20 | 21 | let prettyString: string => string 22 | -------------------------------------------------------------------------------- /src/components/Tag.res: -------------------------------------------------------------------------------- 1 | // This file was automatically converted to ReScript from 'Tag.re' 2 | // Check the output and make sure to delete the original file 3 | type kind = [#Subtle] 4 | 5 | @react.component 6 | let make = (~text, ~kind=#Subtle) => { 7 | let className = switch kind { 8 | | #Subtle => "px-1 bg-gray-10 text-gray-60 font-semibold rounded text-14" 9 | } 10 |
{React.string(text)}
11 | } 12 | -------------------------------------------------------------------------------- /src/common/LangUtil.res: -------------------------------------------------------------------------------- 1 | type language = 2 | | English 3 | | Chinese 4 | 5 | let langDocBase = (lang) => 6 | switch lang { 7 | | English => "docs" 8 | | Chinese => "docs-cn" 9 | } 10 | 11 | 12 | let whichLang = (url: Url.t) => 13 | if Array.length(url.base) > 0 { 14 | switch url.base[0] { 15 | | "docs-cn" => Chinese 16 | | _ => English 17 | } 18 | } 19 | else{ 20 | English 21 | } 22 | -------------------------------------------------------------------------------- /src/common/XmlHttpRequest.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | 3 | 4 | var Upload = {}; 5 | 6 | function decodeReadyState(x) { 7 | if (x > 4 || x < 0) { 8 | return /* Unknown */5; 9 | } else { 10 | return x; 11 | } 12 | } 13 | 14 | function readyState(xhr) { 15 | return decodeReadyState(xhr.readyState); 16 | } 17 | 18 | export { 19 | Upload , 20 | decodeReadyState , 21 | readyState , 22 | } 23 | /* No side effect */ 24 | -------------------------------------------------------------------------------- /src/common/WarningFlagDescription.resi: -------------------------------------------------------------------------------- 1 | module Parser: { 2 | type token = { 3 | enabled: bool, 4 | flag: string, 5 | } 6 | 7 | let parse: string => result, string> 8 | 9 | let merge: (array, array) => array 10 | let tokensToString: array => string 11 | } 12 | let lookup: string => array<(string, string)> 13 | let lookupAll: unit => array<(string, string)> 14 | let fuzzyLookup: string => array<(string, string)> 15 | -------------------------------------------------------------------------------- /pages/docs-cn/manual/latest/try.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "试一试" 3 | description: "Try ReScript via Command Line" 4 | canonical: "/docs/manual/latest/try" 5 | --- 6 | 7 | 10 | ## 在线体验 11 | 12 | 15 | 16 | 我们的 [Playground](/try) 可让你在线体验 ReScript,并且预安装了 [ReScript-React](/docs/react/latest/introduction)。 17 | -------------------------------------------------------------------------------- /src/components/CodeExample.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: ( 3 | ~highlightedLines: array=?, 4 | ~code: string, 5 | ~showLabel: bool=?, 6 | ~lang: string=?, 7 | ) => React.element 8 | 9 | module Toggle: { 10 | type tab = { 11 | highlightedLines: option>, 12 | label: option, 13 | lang: option, 14 | code: string, 15 | } 16 | 17 | @react.component 18 | let make: (~tabs: array) => React.element 19 | } 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.swp 3 | *.swo 4 | 5 | # Generated via update-index script 6 | public/blog/feed.xml 7 | 8 | node_modules/ 9 | .next/ 10 | index_data/*.json 11 | 12 | # Generated via test examples script 13 | _tempFile.cmi 14 | _tempFile.cmj 15 | _tempFile.cmt 16 | 17 | # these docs are checked in, but we consider them frozen. 18 | pages/docs/manual/v8.0.0/ 19 | pages/docs/manual/v9.0.0/ 20 | 21 | .bsb.lock 22 | .merlin 23 | lib/ 24 | .vscode/ 25 | 26 | .vercel 27 | -------------------------------------------------------------------------------- /src/components/Tag.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | 3 | import * as React from "react"; 4 | 5 | function Tag(Props) { 6 | var text = Props.text; 7 | return React.createElement("div", undefined, React.createElement("span", { 8 | className: "px-1 bg-gray-10 text-gray-60 font-semibold rounded text-14" 9 | }, text)); 10 | } 11 | 12 | var make = Tag; 13 | 14 | export { 15 | make , 16 | } 17 | /* react Not a pure module */ 18 | -------------------------------------------------------------------------------- /misc_docs/syntax/specialvalues_line.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "line" 3 | keywords: ["line"] 4 | name: "__LINE__" 5 | summary: "This is the `__LINE__` special value." 6 | category: "specialvalues" 7 | --- 8 | 9 | `__LINE__` returns the line number in the file at which you put this very expression. 10 | 11 | 12 | 13 | ```res example 14 | // Line 1 15 | // Line 2 16 | __LINE__->Js.log 17 | ``` 18 | 19 | ```js 20 | console.log(3); 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /misc_docs/syntax/specialvalues_file.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "file" 3 | keywords: ["file"] 4 | name: "__FILE__" 5 | summary: "This is the `__FILE__` special value." 6 | category: "specialvalues" 7 | --- 8 | 9 | `__FILE__` returns the name of the file currently being parsed by the compiler. 10 | 11 | 12 | 13 | ```res example 14 | // testmodule.res 15 | __FILE__->Js.log 16 | ``` 17 | 18 | ```js 19 | console.log("testmodule.res"); 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /misc_docs/syntax/operators_mod.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "mod" 3 | keywords: ["mod", "modulo", "operator"] 4 | name: "mod" 5 | summary: "This is the `modulo` operator." 6 | category: "operators" 7 | --- 8 | 9 | The `mod` operator calculates the *modulo* (remainder after division) of two integers. 10 | 11 | ### Example 12 | 13 | 14 | 15 | ```res 16 | let result = mod(7, 4) 17 | ``` 18 | 19 | ```js 20 | var result = 3; 21 | ``` 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /pages/_app.js: -------------------------------------------------------------------------------- 1 | // import App from 'next/app' 2 | 3 | 4 | //function MyApp({ Component, pageProps }) { 5 | //console.log(pageProps); 6 | //return 7 | //} 8 | 9 | import "styles/main.css"; 10 | import "styles/utils.css"; 11 | import "codemirror/lib/codemirror.css"; 12 | import "styles/cm.css"; 13 | import "styles/docson.css"; 14 | 15 | import {make as ResApp} from "src/common/App.mjs"; 16 | 17 | export default function App(props) { 18 | return 19 | }; 20 | -------------------------------------------------------------------------------- /misc_docs/syntax/specialvalues_module.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "module" 3 | keywords: ["module"] 4 | name: "__MODULE__" 5 | summary: "This is the `__MODULE__` special value." 6 | category: "specialvalues" 7 | --- 8 | 9 | `__MODULE__` returns the module name of the file. Note that it does not return the name of a nested module, though. 10 | 11 | 12 | 13 | ```res example 14 | __MODULE__->Js.log 15 | ``` 16 | 17 | ```js 18 | console.log("Testmodule"); 19 | ``` 20 | 21 | -------------------------------------------------------------------------------- /misc_docs/syntax/operators_float_division.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "float-division" 3 | keywords: ["divide", "division", "float"] 4 | name: "/." 5 | summary: "This is the `floating point division` operator." 6 | category: "operators" 7 | --- 8 | 9 | This operator performs *floating point* division. 10 | 11 | 12 | 13 | ```res 14 | let result = 3.0 /. 2.5 15 | ``` 16 | 17 | ```js 18 | var result = 3.0 / 2.5; 19 | ``` 20 | 21 | 22 | 23 | For dividing *integers* see the `/` operator. 24 | -------------------------------------------------------------------------------- /misc_docs/syntax/operators_string_concatenation.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "string-concatenation" 3 | keywords: ["concat", "concatenation", "add", "string"] 4 | name: "++" 5 | summary: "This is the `string concatenation` operator." 6 | category: "operators" 7 | --- 8 | 9 | This operator concatenates two *strings* together. 10 | 11 | 12 | 13 | ```res 14 | let greetings = "Hello " ++ "world!" 15 | ``` 16 | 17 | ```js 18 | var greetings = "Hello world!"; 19 | ``` 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/vendor/Json.ml: -------------------------------------------------------------------------------- 1 | module Decode = Json_decode 2 | module Encode = Json_encode 3 | 4 | exception ParseError of string 5 | 6 | let parse s = 7 | try Some (Js.Json.parseExn s) with 8 | | _ -> None 9 | 10 | let parseOrRaise s = 11 | try Js.Json.parseExn s with 12 | | Js.Exn.Error e -> 13 | let message = 14 | match Js.Exn.message e with 15 | | Some m -> m 16 | | None -> "Unknown error" 17 | in raise @@ ParseError message 18 | 19 | external stringify : Js.Json.t -> string = "JSON.stringify" [@@bs.val] -------------------------------------------------------------------------------- /src/components/Docson.resi: -------------------------------------------------------------------------------- 1 | /* 2 | Docson is a tool to render a json schema via client side JS. 3 | 4 | Here is a list of files needed by this component: 5 | - Build schema is found in data/build-schema.json 6 | - Templates for rendering the content can be found in public/static/docson/. 7 | - Styles can be found in styles/docson.css 8 | 9 | Please note that this component cannot be rendered on SSR, so use it in conjunction with 10 | Next's dynamic import mechanism. 11 | */ 12 | 13 | @react.component 14 | let make: unit => React.element 15 | -------------------------------------------------------------------------------- /styles/_theme.css: -------------------------------------------------------------------------------- 1 | /* purgecss start ignore */ 2 | .theme-reason { 3 | --color-text-primary-dark: theme('colors.fire.DEFAULT'); 4 | --color-text-primary: theme('colors.fire.DEFAULT'); 5 | --color-text-primary-light: theme('colors.fire.DEFAULT'); 6 | --color-text-primary-80: theme('colors.fire.90'); 7 | --color-text-primary-40: theme('colors.fire.50'); 8 | --color-text-primary-15: theme('colors.fire.10'); 9 | } 10 | 11 | .list-fire li::before { 12 | content: "•"; 13 | @apply text-fire mr-2; 14 | } 15 | /* purgecss end ignore */ 16 | -------------------------------------------------------------------------------- /misc_docs/syntax/operators_integer_subtraction.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "integer-subtraction" 3 | keywords: ["subtract", "minus", "subtraction", "int", "integer"] 4 | name: "-" 5 | summary: "This is the `integer subtraction` operator." 6 | category: "operators" 7 | --- 8 | 9 | This operator performs *integer* subtraction. 10 | 11 | 12 | 13 | ```res 14 | let result = 3 - 2 15 | ``` 16 | 17 | ```js 18 | var result = 1; 19 | ``` 20 | 21 | 22 | 23 | For subtracting *floats* see the `-.` operator. 24 | -------------------------------------------------------------------------------- /public/static/ic_search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /misc_docs/syntax/operators_integer_multiplication.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "integer-multiplication" 3 | keywords: ["multiply", "multiplication", "int", "integer"] 4 | name: "*" 5 | summary: "This is the `integer multiplication` operator." 6 | category: "operators" 7 | --- 8 | 9 | This operator performs *integer* multiplication. 10 | 11 | 12 | 13 | ```res 14 | let result = 2 * 3 15 | ``` 16 | 17 | ```js 18 | var result = 6; 19 | ``` 20 | 21 | 22 | 23 | For multiplying *floats* see the `*.` operator. 24 | -------------------------------------------------------------------------------- /src/common/BlogApi.resi: -------------------------------------------------------------------------------- 1 | type post = { 2 | path: string, 3 | archived: bool, 4 | frontmatter: BlogFrontmatter.t, 5 | } 6 | 7 | let getAllPosts: unit => array 8 | let blogPathToSlug: string => string 9 | 10 | module RssFeed: { 11 | type item = { 12 | title: string, 13 | href: string, 14 | description: string, 15 | pubDate: Js.Date.t, 16 | } 17 | let getLatest: (~max: int=?, ~baseUrl: string=?, unit) => array 18 | let toXmlString: (~siteTitle: string=?, ~siteDescription: string=?, array) => string 19 | } 20 | -------------------------------------------------------------------------------- /misc_docs/syntax/operators_float_addition.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "float-addition" 3 | keywords: ["plus", "add", "addition", "sum", "float"] 4 | name: "+." 5 | summary: "This is the `floating point addition` operator." 6 | category: "operators" 7 | --- 8 | 9 | This operator performs *floating point* addition. 10 | 11 | 12 | 13 | ```res 14 | let result = 1.3 +. 0.5 15 | ``` 16 | 17 | ```js 18 | var result = 1.3 + 0.5; 19 | ``` 20 | 21 | 22 | 23 | For adding *integers* see the [`+`](#integer-addition) operator. 24 | -------------------------------------------------------------------------------- /misc_docs/syntax/operators_float_subtraction.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "float-subtraction" 3 | keywords: ["subtract", "minus", "subtraction", "float"] 4 | name: "-." 5 | summary: "This is the `floating point subtraction` operator." 6 | category: "operators" 7 | --- 8 | 9 | This operator performs *floating point* subtraction. 10 | 11 | 12 | 13 | ```res 14 | let result = 3.0 -. 2.5 15 | ``` 16 | 17 | ```js 18 | var result = 3.0 - 2.5; 19 | ``` 20 | 21 | 22 | 23 | For subtracting *integers* see the `-` operator. 24 | -------------------------------------------------------------------------------- /src/components/WarningTable.res: -------------------------------------------------------------------------------- 1 | open Markdown 2 | 3 | @react.component 4 | let make = () => { 5 | 6 | 7 | 8 | 9 | 10 | {WarningFlagDescription.lookupAll() 11 | ->Belt.Array.map(((number, description)) => 12 | 13 | 14 | 15 | ) 16 | ->React.array} 17 | 18 |
{React.string("#")} {React.string("Description")}
{React.string(number)} {React.string(description)}
19 | } 20 | -------------------------------------------------------------------------------- /misc_docs/syntax/operators_float_multiplication.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "float-multiplication" 3 | keywords: ["multiply", "multiplication", "float"] 4 | name: "*." 5 | summary: "This is the `floating point multiplication` operator." 6 | category: "operators" 7 | --- 8 | 9 | This operator performs *floating point* multiplication. 10 | 11 | 12 | 13 | ```res 14 | let result = 1.5 *. 2.3 15 | ``` 16 | 17 | ```js 18 | var result = 1.5 * 2.3; 19 | ``` 20 | 21 | 22 | 23 | For multiplying *integers* see the `*` operator. 24 | -------------------------------------------------------------------------------- /pages/docs/reason-compiler/latest/nodejs-special-variables.mdx: -------------------------------------------------------------------------------- 1 | # NodeJS Special Variables 2 | 3 | NodeJS has several file local variables: `__dirname`, `__filename`, `_module`, and `require`. Their semantics are more like macros instead of functions. 4 | 5 | `bs.node` exposes support for these. 6 | 7 | ```reason 8 | let dirname: option(string) = [%bs.node __dirname]; 9 | let filename: option(string) = [%bs.node __filename]; 10 | let _module: option(Node.node_module) = [%bs.node _module]; 11 | let require: option(Node.node_require) = [%bs.node require]; 12 | ``` 13 | -------------------------------------------------------------------------------- /misc_docs/syntax/specialvalues_loc.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "loc" 3 | keywords: ["loc"] 4 | name: "__LOC__" 5 | summary: "This is the `__LOC__` special value." 6 | category: "specialvalues" 7 | --- 8 | 9 | `__LOC__` returns a string of the location in the file at which you put this very expression. 10 | The string format is `"File %S, line %d, characters %d-%d"` 11 | 12 | 13 | 14 | ```res example 15 | __LOC__->Js.log 16 | ``` 17 | 18 | ```js 19 | console.log("File \"testmodule.res\", line 1, characters 0-7"); 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /src/layouts/ApiLayout.resi: -------------------------------------------------------------------------------- 1 | module OldDocsWarning: { 2 | @react.component 3 | let make: (~version: string, ~route: string) => React.element 4 | } 5 | 6 | let makeBreadcrumbs: (~prefix: Url.breadcrumb, string) => list 7 | 8 | @react.component 9 | let make: ( 10 | ~breadcrumbs: list=?, 11 | ~categories: array, 12 | ~title: string=?, 13 | ~version: string=?, 14 | ~activeToc: SidebarLayout.Toc.t=?, 15 | ~components: Mdx.Components.t=?, 16 | ~children: React.element, 17 | ) => React.element 18 | -------------------------------------------------------------------------------- /pages/docs/manual/latest/warning-numbers.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Warning Numbers" 3 | description: "Available compiler warning numbers in ReScript" 4 | canonical: "/docs/manual/latest/warning-numbers" 5 | --- 6 | 7 | import {make as WarningTable} from "src/components/WarningTable.mjs" 8 | 9 | # Warning Numbers 10 | 11 | You can configure which warnings the ReScript compiler generates 12 | [in the build configuration](/docs/manual/latest/build-configuration#warnings) or 13 | [using the `@@warning()` decorator](/syntax-lookup#module-warning-decorator). 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/bindings/HeadlessUI.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | 3 | 4 | var Button = {}; 5 | 6 | var Items = {}; 7 | 8 | var Item = {}; 9 | 10 | var Menu = { 11 | Button: Button, 12 | Items: Items, 13 | Item: Item 14 | }; 15 | 16 | var Button$1 = {}; 17 | 18 | var Options = {}; 19 | 20 | var $$Option = {}; 21 | 22 | var Listbox = { 23 | Button: Button$1, 24 | Options: Options, 25 | $$Option: $$Option 26 | }; 27 | 28 | var Transition = {}; 29 | 30 | export { 31 | Menu , 32 | Listbox , 33 | Transition , 34 | } 35 | /* No side effect */ 36 | -------------------------------------------------------------------------------- /src/Packages.resi: -------------------------------------------------------------------------------- 1 | type urlResource = { 2 | name: string, 3 | keywords: array, 4 | description: string, 5 | urlHref: string, 6 | official: bool, 7 | } 8 | 9 | type npmPackage = { 10 | name: string, 11 | version: string, 12 | keywords: array, 13 | description: string, 14 | repositoryHref: Js.Null.t, 15 | npmHref: string, 16 | } 17 | 18 | type props = {"packages": array, "urlResources": array} 19 | 20 | let default: props => React.element 21 | 22 | let getStaticProps: Next.GetStaticProps.revalidate 23 | -------------------------------------------------------------------------------- /pages/docs-cn/manual/latest/api/js/typed-array-2.mdx: -------------------------------------------------------------------------------- 1 | # TypedArray2 2 | 3 | 4 | 5 | Provide bindings to JS typed array. 6 | 7 | 8 | 9 | ## array_buffer 10 | 11 | ```res sig 12 | type array_buffer 13 | ``` 14 | 15 | ## array_like 16 | 17 | ```res sig 18 | type array_like<'a> 19 | ``` 20 | 21 | ## module ArrayBuffer 22 | ## module Int8Array 23 | ## module Uint8Array 24 | ## module Uint8ClampedArray 25 | ## module Int16Array 26 | ## module Uint16Array 27 | ## module Int32Array 28 | ## module Uint32Array 29 | ## module Float32Array 30 | ## module Float64Array 31 | ## module DataView 32 | -------------------------------------------------------------------------------- /pages/docs/manual/latest/api/js/typed-array-2.mdx: -------------------------------------------------------------------------------- 1 | # TypedArray2 2 | 3 | 4 | 5 | Provide bindings to JS typed array. 6 | 7 | 8 | 9 | ## array_buffer 10 | 11 | ```res sig 12 | type array_buffer 13 | ``` 14 | 15 | ## array_like 16 | 17 | ```res sig 18 | type array_like<'a> 19 | ``` 20 | 21 | ## module ArrayBuffer 22 | ## module Int8Array 23 | ## module Uint8Array 24 | ## module Uint8ClampedArray 25 | ## module Int16Array 26 | ## module Uint16Array 27 | ## module Int32Array 28 | ## module Uint32Array 29 | ## module Float32Array 30 | ## module Float64Array 31 | ## module DataView 32 | -------------------------------------------------------------------------------- /pages/docs/manual/v8.0.0/api/js/typed-array-2.mdx: -------------------------------------------------------------------------------- 1 | # TypedArray2 2 | 3 | 4 | 5 | Provide bindings to JS typed array. 6 | 7 | 8 | 9 | ## array_buffer 10 | 11 | ```re sig 12 | type array_buffer; 13 | ``` 14 | 15 | ## array_like 16 | 17 | ```re sig 18 | type array_like('a); 19 | ``` 20 | 21 | ## module ArrayBuffer 22 | ## module Int8Array 23 | ## module Uint8Array 24 | ## module Uint8ClampedArray 25 | ## module Int16Array 26 | ## module Uint16Array 27 | ## module Int32Array 28 | ## module Uint32Array 29 | ## module Float32Array 30 | ## module Float64Array 31 | ## module DataView 32 | -------------------------------------------------------------------------------- /pages/docs/manual/v9.0.0/api/js/typed-array-2.mdx: -------------------------------------------------------------------------------- 1 | # TypedArray2 2 | 3 | 4 | 5 | Provide bindings to JS typed array. 6 | 7 | 8 | 9 | ## array_buffer 10 | 11 | ```res sig 12 | type array_buffer 13 | ``` 14 | 15 | ## array_like 16 | 17 | ```res sig 18 | type array_like<'a> 19 | ``` 20 | 21 | ## module ArrayBuffer 22 | ## module Int8Array 23 | ## module Uint8Array 24 | ## module Uint8ClampedArray 25 | ## module Int16Array 26 | ## module Uint16Array 27 | ## module Int32Array 28 | ## module Uint32Array 29 | ## module Float32Array 30 | ## module Float64Array 31 | ## module DataView 32 | -------------------------------------------------------------------------------- /src/components/VersionSelect.res: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make = (~onChange, ~version: string, ~availableVersions: array<(string, string)>) => { 3 | // array<(version, label)> 4 | 5 | let children = Belt.Array.map(availableVersions, ((ver, label)) => { 6 | 7 | }) 8 | 15 | } 16 | -------------------------------------------------------------------------------- /src/layouts/CommunityLayout.res: -------------------------------------------------------------------------------- 1 | module CommunityLayout = DocsLayout.Make({ 2 | // Structure defined by `scripts/extract-tocs.js` 3 | let tocData: SidebarLayout.Toc.raw = %raw("require('index_data/community_toc.json')") 4 | }) 5 | 6 | @react.component 7 | let make = (~frontmatter=?, ~components=Markdown.default, ~children) => { 8 | let breadcrumbs = list{{Url.name: "Community", href: "/community"}} 9 | 10 | let title = "Community" 11 | 12 | 14 | children 15 | 16 | } 17 | -------------------------------------------------------------------------------- /misc_docs/syntax/operators_integer_addition.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "integer-addition" 3 | keywords: ["plus", "add", "addition", "sum", "int", "integer"] 4 | name: "+" 5 | summary: "This is the `integer addition` operator." 6 | category: "operators" 7 | --- 8 | 9 | This operator performs *integers* addition. 10 | 11 | 12 | 13 | ```res 14 | let result = 1 + 2 15 | ``` 16 | 17 | ```js 18 | val result = 3; 19 | ``` 20 | 21 | 22 | 23 | For adding *floats* see the [`+.`](#float-addition) operator. 24 | 25 | For contatenating *strings* see the [`++`](#string-concatenation) operator. 26 | -------------------------------------------------------------------------------- /pages/docs-cn/manual/latest/build-configuration-schema.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "构建配置概要" 3 | metaTitle: "Build System Configuration Schema" 4 | description: "Schema exploration widget for the ReScript configuration file" 5 | canonical: "/docs/manual/latest/build-configuration-schema" 6 | --- 7 | 8 | import dynamic from "next/dynamic"; 9 | 10 | export const Docson = dynamic(() => import("src/components/Docson").then((comp) => { 11 | return comp.make; 12 | }), { 13 | ssr: false, 14 | loading: () =>
Loading...
15 | }); 16 | 17 | export default function BuildConfigurationSchemaPage() { 18 | return ; 19 | } 20 | -------------------------------------------------------------------------------- /pages/docs/manual/latest/build-configuration-schema.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Configuration Schema" 3 | metaTitle: "Build System Configuration Schema" 4 | description: "Schema exploration widget for the ReScript configuration file" 5 | canonical: "/docs/manual/latest/build-configuration-schema" 6 | --- 7 | 8 | import dynamic from "next/dynamic"; 9 | 10 | export const Docson = dynamic(() => import("src/components/Docson").then((comp) => { 11 | return comp.make; 12 | }), { 13 | ssr: false, 14 | loading: () =>
Loading...
15 | }); 16 | 17 | export default function BuildConfigurationSchemaPage() { 18 | return ; 19 | } 20 | -------------------------------------------------------------------------------- /pages/docs/manual/v9.0.0/build-configuration-schema.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Configuration Schema" 3 | metaTitle: "Build System Configuration Schema" 4 | description: "Schema exploration widget for the ReScript configuration file" 5 | canonical: "/docs/manual/latest/build-configuration-schema" 6 | --- 7 | 8 | import dynamic from "next/dynamic"; 9 | 10 | export const Docson = dynamic(() => import("src/components/Docson").then((comp) => { 11 | return comp.make; 12 | }), { 13 | ssr: false, 14 | loading: () =>
Loading...
15 | }); 16 | 17 | export default function BuildConfigurationSchemaPage() { 18 | return ; 19 | } 20 | -------------------------------------------------------------------------------- /data/packages_url_resources.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "ReScript Test Framework", 4 | "description": "The most minimalistic testing library you will find for testing ReScript code", 5 | "keywords": ["testing", "minimal", "experimental"], 6 | "urlHref": "https://github.com/rescript-lang/rescript-project-template/blob/test/tests/Tests.res", 7 | "official": true 8 | }, 9 | { 10 | "name": "genType", 11 | "description": "Better interop with JS & TS in ReScript", 12 | "keywords": ["rescript", "typescript"], 13 | "urlHref": "https://github.com/reason-association/genType", 14 | "official": true 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /misc_docs/syntax/language_function.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "function" 3 | keywords: ["function"] 4 | name: "() => {}" 5 | summary: "This is a `function`." 6 | category: "languageconstructs" 7 | --- 8 | 9 | Functions are declared with arguments in parentheses, an arrow, and a return expression. 10 | 11 | ### Example 12 | 13 | 14 | 15 | ```res 16 | let greet = (name: string) => { 17 | "Hello " ++ name 18 | } 19 | ``` 20 | 21 | ```js 22 | function greet(name) { 23 | return "Hello " + name; 24 | } 25 | ``` 26 | 27 | 28 | 29 | ### References 30 | 31 | * [Function](/docs/manual/latest/function) 32 | -------------------------------------------------------------------------------- /src/layouts/MainLayout.res: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make = (~components=Markdown.default, ~children) => { 3 | let overlayState = React.useState(() => false) 4 | 5 | <> 6 |
7 |
8 | 9 |
10 |
11 | children 12 |
13 |
14 | //
15 |
16 |
17 | 18 | } 19 | -------------------------------------------------------------------------------- /data/sidebar_react_latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "概览": [ 3 | "introduction", 4 | "installation", 5 | "migrate-from-reason-react" 6 | ], 7 | "核心概念": [ 8 | "elements-and-jsx", 9 | "rendering-elements", 10 | "components-and-props", 11 | "arrays-and-keys", 12 | "refs-and-the-dom", 13 | "context", 14 | "styling", 15 | "router" 16 | ], 17 | "Hooks & 状态管理": [ 18 | "hooks-overview", 19 | "hooks-effect", 20 | "hooks-state", 21 | "hooks-reducer", 22 | "hooks-context", 23 | "hooks-ref", 24 | "hooks-custom" 25 | ], 26 | "指引": [ 27 | "beyond-jsx", 28 | "forwarding-refs" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /src/common/LangUtil.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | 3 | import * as Caml_array from "rescript/lib/es6/caml_array.js"; 4 | 5 | function langDocBase(lang) { 6 | if (lang) { 7 | return "docs-cn"; 8 | } else { 9 | return "docs"; 10 | } 11 | } 12 | 13 | function whichLang(url) { 14 | if (url.base.length === 0) { 15 | return /* English */0; 16 | } 17 | var match = Caml_array.get(url.base, 0); 18 | if (match === "docs-cn") { 19 | return /* Chinese */1; 20 | } else { 21 | return /* English */0; 22 | } 23 | } 24 | 25 | export { 26 | langDocBase , 27 | whichLang , 28 | } 29 | /* No side effect */ 30 | -------------------------------------------------------------------------------- /src/components/Image.res: -------------------------------------------------------------------------------- 1 | // This component is representing a embedded image, mainly used for markdown content 2 | 3 | @react.component 4 | let default = (~src: string, ~withShadow=false, ~caption: option=?) => { 5 | let shadow = if withShadow { 6 | "shadow-md" 7 | } else { 8 | "" 9 | } 10 |
11 | 12 | {switch caption { 13 | | None => React.null 14 | | Some(caption) => 15 |
{React.string(caption)}
16 | }} 17 |
18 | } 19 | -------------------------------------------------------------------------------- /pages/docs/manual/v8.0.0/libraries.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Libraries" 3 | description: "ReScript libraries" 4 | canonical: "/docs/manual/latest/libraries" 5 | --- 6 | 7 | # Libraries 8 | 9 | ReScript libraries are just like JavaScript libraries: hosted on [NPM](http://npmjs.com). 10 | 11 | If you can't find what you're looking for: sometimes **you don't need a wrapper** to use a JS library: 12 | 13 | - Most JS data types, such as array and objects, [map over cleanly to ReScript and vice-versa](shared-data-types.md). 14 | - You also have access to the familiar [JS API](api/js). 15 | - You can use a JavaScript library without needing to bind to them first. Check the [`external`](external) page. 16 | -------------------------------------------------------------------------------- /src/common/DocFrontmatter.res: -------------------------------------------------------------------------------- 1 | type t = { 2 | title: string, 3 | metaTitle: Js.null, 4 | description: Js.null, 5 | canonical: Js.null, 6 | ghEditHref: string, 7 | } 8 | 9 | let decode = json => { 10 | open! Json.Decode 11 | try Some({ 12 | title: field("title", string, json), 13 | metaTitle: optional(field("metaTitle", string), json)->Js.Null.fromOption, 14 | description: optional(field("description", string), json)->Js.Null.fromOption, 15 | canonical: optional(field("canonical", string), json)->Js.Null.fromOption, 16 | ghEditHref: field("__ghEditHref", string, json), 17 | }) catch { 18 | | DecodeError(_errMsg) => None 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /misc_docs/syntax/language_let.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "let-binding" 3 | keywords: ["let", "variable"] 4 | name: "let" 5 | summary: "This is the `let binding` keyword." 6 | category: "languageconstructs" 7 | --- 8 | 9 | `let` is used to _bind_ values to names, which is similar to assigning values to variables in other languages. 10 | 11 | ### Example 12 | 13 | 14 | 15 | ```res 16 | let greeting = "hello!" 17 | let score = 10 18 | let newScore = 10 + score 19 | ``` 20 | 21 | ```js 22 | var newScore = 20; 23 | var greeting = "hello!"; 24 | var score = 10; 25 | ``` 26 | 27 | 28 | 29 | ### References 30 | 31 | * [Let Binding](/docs/manual/latest/let-binding) 32 | -------------------------------------------------------------------------------- /pages/docs/manual/v8.0.0/api/js/typed-array_array-buffer.mdx: -------------------------------------------------------------------------------- 1 | # TypedArray.ArrayBuffer 2 | 3 | 4 | 5 | Provide bindings to JS typed array ArrayBuffer. 6 | 7 | 8 | 9 | ## t 10 | 11 | ```re sig 12 | type t = Js_typed_array.array_buffer; 13 | ``` 14 | 15 | ## make 16 | 17 | ```re sig 18 | let make: int => t; 19 | ``` 20 | 21 | Takes length. initializes elements to 0. 22 | 23 | ## byteLength 24 | 25 | ```re sig 26 | let byteLength: t => int; 27 | ``` 28 | 29 | ## slice 30 | 31 | ```re sig 32 | let slice: (~start: int, ~end_: int, t) => Js_typed_array.array_buffer; 33 | ``` 34 | 35 | ## sliceFrom 36 | 37 | ```re sig 38 | let sliceFrom: (int, t) => Js_typed_array.array_buffer; 39 | ``` 40 | -------------------------------------------------------------------------------- /pages/docs/manual/latest/api/js/typed-array_array-buffer.mdx: -------------------------------------------------------------------------------- 1 | # TypedArray.ArrayBuffer 2 | 3 | 4 | 5 | Provide bindings to JS typed array ArrayBuffer. 6 | 7 | 8 | 9 | ## t 10 | 11 | ```res prelude 12 | type t = Js_typed_array.array_buffer 13 | ``` 14 | 15 | ## make 16 | 17 | ```res sig 18 | let make: int => t 19 | ``` 20 | 21 | Takes length. initializes elements to 0. 22 | 23 | ## byteLength 24 | 25 | ```res sig 26 | let byteLength: t => int 27 | ``` 28 | 29 | ## slice 30 | 31 | ```res sig 32 | let slice: (~start: int, ~end_: int, t) => Js_typed_array.array_buffer 33 | ``` 34 | 35 | ## sliceFrom 36 | 37 | ```res sig 38 | let sliceFrom: (int, t) => Js_typed_array.array_buffer 39 | ``` 40 | -------------------------------------------------------------------------------- /pages/docs/manual/v8.0.0/api/js/typed-array.mdx: -------------------------------------------------------------------------------- 1 | # TypedArray 2 | 3 | 4 | 5 | Provide bindings to JS typed array. 6 | 7 | 8 | 9 | ## array_buffer 10 | 11 | ```re sig 12 | type array_buffer; 13 | ``` 14 | 15 | ## array_like 16 | 17 | ```re sig 18 | type array_like('a); 19 | ``` 20 | 21 | ## module type Type 22 | 23 | ```re sig 24 | module type Type = {type t;}; 25 | ``` 26 | 27 | ## module ArrayBuffer 28 | ## module type S 29 | ## module Int8Array 30 | ## module Uint8Array 31 | ## module Uint8ClampedArray 32 | ## module Int16Array 33 | ## module Uint16Array 34 | ## module Int32Array 35 | ## module Uint32Array 36 | ## module Float32Array 37 | ## module Float64Array 38 | ## module DataView 39 | -------------------------------------------------------------------------------- /pages/docs/manual/v9.0.0/api/js/typed-array_array-buffer.mdx: -------------------------------------------------------------------------------- 1 | # TypedArray.ArrayBuffer 2 | 3 | 4 | 5 | Provide bindings to JS typed array ArrayBuffer. 6 | 7 | 8 | 9 | ## t 10 | 11 | ```res prelude 12 | type t = Js_typed_array.array_buffer 13 | ``` 14 | 15 | ## make 16 | 17 | ```res sig 18 | let make: int => t 19 | ``` 20 | 21 | Takes length. initializes elements to 0. 22 | 23 | ## byteLength 24 | 25 | ```res sig 26 | let byteLength: t => int 27 | ``` 28 | 29 | ## slice 30 | 31 | ```res sig 32 | let slice: (~start: int, ~end_: int, t) => Js_typed_array.array_buffer 33 | ``` 34 | 35 | ## sliceFrom 36 | 37 | ```res sig 38 | let sliceFrom: (int, t) => Js_typed_array.array_buffer 39 | ``` 40 | -------------------------------------------------------------------------------- /public/static/partners/ahrefs.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pages/docs-cn/manual/latest/api/js/typed-array_array-buffer.mdx: -------------------------------------------------------------------------------- 1 | # TypedArray.ArrayBuffer 2 | 3 | 4 | 5 | Provide bindings to JS typed array ArrayBuffer. 6 | 7 | 8 | 9 | ## t 10 | 11 | ```res prelude 12 | type t = Js_typed_array.array_buffer 13 | ``` 14 | 15 | ## make 16 | 17 | ```res sig 18 | let make: int => t 19 | ``` 20 | 21 | Takes length. initializes elements to 0. 22 | 23 | ## byteLength 24 | 25 | ```res sig 26 | let byteLength: t => int 27 | ``` 28 | 29 | ## slice 30 | 31 | ```res sig 32 | let slice: (~start: int, ~end_: int, t) => Js_typed_array.array_buffer 33 | ``` 34 | 35 | ## sliceFrom 36 | 37 | ```res sig 38 | let sliceFrom: (int, t) => Js_typed_array.array_buffer 39 | ``` 40 | -------------------------------------------------------------------------------- /src/Design.res: -------------------------------------------------------------------------------- 1 | // NOTE: This file will later be important to document our 2 | // design tokens etc. 3 | 4 | module ColorSquare = { 5 | @react.component 6 | let make = (~className="") => { 7 |
8 | } 9 | } 10 | 11 | @react.component 12 | let default = () => { 13 | let fireColorSquares = [ 14 | "bg-fire-90", 15 | "bg-fire-70", 16 | "bg-fire-50", 17 | "bg-fire-30", 18 | "bg-fire-10", 19 | ]->Js.Array2.map(bgColorClass => { 20 | 21 | }) 22 | 23 |
24 |

{React.string("Main Palette")}

25 |
{React.array(fireColorSquares)}
26 |
27 | } 28 | -------------------------------------------------------------------------------- /pages/docs/manual/latest/api/js/typed-array-2_array-buffer.mdx: -------------------------------------------------------------------------------- 1 | # TypedArray2.ArrayBuffer 2 | 3 | 4 | 5 | Provide bindings to JS typed array ArrayBuffer. 6 | 7 | 8 | 9 | ## t 10 | 11 | ```res prelude 12 | type t = Js_typed_array2.array_buffer 13 | ``` 14 | 15 | ## make 16 | 17 | ```res sig 18 | let make: int => t 19 | ``` 20 | 21 | Takes length. initializes elements to 0. 22 | 23 | 24 | ## byteLength 25 | 26 | ```res sig 27 | let byteLength: t => int 28 | ``` 29 | 30 | ## slice 31 | 32 | ```res sig 33 | let slice: (t, ~start: int, ~end_: int) => Js_typed_array2.array_buffer 34 | ``` 35 | 36 | ## sliceFrom 37 | 38 | ```res sig 39 | let sliceFrom: (t, int) => Js_typed_array2.array_buffer 40 | ``` 41 | -------------------------------------------------------------------------------- /pages/docs/manual/latest/api/js/typed-array.mdx: -------------------------------------------------------------------------------- 1 | # TypedArray 2 | 3 | 4 | 5 | Provide bindings to JS typed array. 6 | 7 | 8 | 9 | ## array_buffer 10 | 11 | ```res sig 12 | type array_buffer 13 | ``` 14 | 15 | ## array_like 16 | 17 | ```res sig 18 | type array_like<'a> 19 | ``` 20 | 21 | ## module type Type 22 | 23 | ```res sig 24 | module type Type = { 25 | type t 26 | } 27 | ``` 28 | 29 | ## module ArrayBuffer 30 | ## module type S 31 | ## module Int8Array 32 | ## module Uint8Array 33 | ## module Uint8ClampedArray 34 | ## module Int16Array 35 | ## module Uint16Array 36 | ## module Int32Array 37 | ## module Uint32Array 38 | ## module Float32Array 39 | ## module Float64Array 40 | ## module DataView 41 | -------------------------------------------------------------------------------- /pages/docs/manual/v8.0.0/api/js/typed-array-2_array-buffer.mdx: -------------------------------------------------------------------------------- 1 | # TypedArray2.ArrayBuffer 2 | 3 | 4 | 5 | Provide bindings to JS typed array ArrayBuffer. 6 | 7 | 8 | 9 | ## t 10 | 11 | ```re sig 12 | type t = Js_typed_array2.array_buffer; 13 | ``` 14 | 15 | ## make 16 | 17 | ```re sig 18 | let make: int => t; 19 | ``` 20 | 21 | Takes length. initializes elements to 0. 22 | 23 | 24 | ## byteLength 25 | 26 | ```re sig 27 | let byteLength: t => int; 28 | ``` 29 | 30 | ## slice 31 | 32 | ```re sig 33 | let slice: (t, ~start: int, ~end_: int) => Js_typed_array2.array_buffer; 34 | ``` 35 | 36 | ## sliceFrom 37 | 38 | ```re sig 39 | let sliceFrom: (t, int) => Js_typed_array2.array_buffer; 40 | ``` 41 | -------------------------------------------------------------------------------- /pages/docs/manual/v9.0.0/api/js/typed-array-2_array-buffer.mdx: -------------------------------------------------------------------------------- 1 | # TypedArray2.ArrayBuffer 2 | 3 | 4 | 5 | Provide bindings to JS typed array ArrayBuffer. 6 | 7 | 8 | 9 | ## t 10 | 11 | ```res prelude 12 | type t = Js_typed_array2.array_buffer 13 | ``` 14 | 15 | ## make 16 | 17 | ```res sig 18 | let make: int => t 19 | ``` 20 | 21 | Takes length. initializes elements to 0. 22 | 23 | 24 | ## byteLength 25 | 26 | ```res sig 27 | let byteLength: t => int 28 | ``` 29 | 30 | ## slice 31 | 32 | ```res sig 33 | let slice: (t, ~start: int, ~end_: int) => Js_typed_array2.array_buffer 34 | ``` 35 | 36 | ## sliceFrom 37 | 38 | ```res sig 39 | let sliceFrom: (t, int) => Js_typed_array2.array_buffer 40 | ``` 41 | -------------------------------------------------------------------------------- /pages/docs/manual/v9.0.0/api/js/typed-array.mdx: -------------------------------------------------------------------------------- 1 | # TypedArray 2 | 3 | 4 | 5 | Provide bindings to JS typed array. 6 | 7 | 8 | 9 | ## array_buffer 10 | 11 | ```res sig 12 | type array_buffer 13 | ``` 14 | 15 | ## array_like 16 | 17 | ```res sig 18 | type array_like<'a> 19 | ``` 20 | 21 | ## module type Type 22 | 23 | ```res sig 24 | module type Type = { 25 | type t 26 | } 27 | ``` 28 | 29 | ## module ArrayBuffer 30 | ## module type S 31 | ## module Int8Array 32 | ## module Uint8Array 33 | ## module Uint8ClampedArray 34 | ## module Int16Array 35 | ## module Uint16Array 36 | ## module Int32Array 37 | ## module Uint32Array 38 | ## module Float32Array 39 | ## module Float64Array 40 | ## module DataView 41 | -------------------------------------------------------------------------------- /pages/docs-cn/manual/latest/api/js/typed-array-2_array-buffer.mdx: -------------------------------------------------------------------------------- 1 | # TypedArray2.ArrayBuffer 2 | 3 | 4 | 5 | Provide bindings to JS typed array ArrayBuffer. 6 | 7 | 8 | 9 | ## t 10 | 11 | ```res prelude 12 | type t = Js_typed_array2.array_buffer 13 | ``` 14 | 15 | ## make 16 | 17 | ```res sig 18 | let make: int => t 19 | ``` 20 | 21 | Takes length. initializes elements to 0. 22 | 23 | 24 | ## byteLength 25 | 26 | ```res sig 27 | let byteLength: t => int 28 | ``` 29 | 30 | ## slice 31 | 32 | ```res sig 33 | let slice: (t, ~start: int, ~end_: int) => Js_typed_array2.array_buffer 34 | ``` 35 | 36 | ## sliceFrom 37 | 38 | ```res sig 39 | let sliceFrom: (t, int) => Js_typed_array2.array_buffer 40 | ``` 41 | -------------------------------------------------------------------------------- /pages/docs-cn/manual/latest/api/js/typed-array.mdx: -------------------------------------------------------------------------------- 1 | # TypedArray 2 | 3 | 4 | 5 | Provide bindings to JS typed array. 6 | 7 | 8 | 9 | ## array_buffer 10 | 11 | ```res sig 12 | type array_buffer 13 | ``` 14 | 15 | ## array_like 16 | 17 | ```res sig 18 | type array_like<'a> 19 | ``` 20 | 21 | ## module type Type 22 | 23 | ```res sig 24 | module type Type = { 25 | type t 26 | } 27 | ``` 28 | 29 | ## module ArrayBuffer 30 | ## module type S 31 | ## module Int8Array 32 | ## module Uint8Array 33 | ## module Uint8ClampedArray 34 | ## module Int16Array 35 | ## module Uint16Array 36 | ## module Int32Array 37 | ## module Uint32Array 38 | ## module Float32Array 39 | ## module Float64Array 40 | ## module DataView 41 | -------------------------------------------------------------------------------- /public/static/nodejs_starter_logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /misc_docs/syntax/decorator_module_warning.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "module-warning-decorator" 3 | keywords: ["warning", "decorator"] 4 | name: "@@warning" 5 | summary: "This is the `@@warning` decorator." 6 | category: "decorators" 7 | --- 8 | 9 | The `@@warning` decorator is used to modify the enabled compiler warnings for the current module. See [here](/docs/manual/latest/warning-numbers) for all available warning numbers. 10 | 11 | ### Examples 12 | 13 | 14 | 15 | ```res 16 | // Disables warning 27 for the current module 17 | @@warning("-27") 18 | ``` 19 | 20 | ```js 21 | ``` 22 | 23 | 24 | 25 | ### References 26 | 27 | * [Warning Numbers](/docs/manual/latest/warning-numbers) 28 | -------------------------------------------------------------------------------- /misc_docs/syntax/decorator_scope.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "scope-decorator" 3 | keywords: ["scope", "decorator"] 4 | name: "@scope" 5 | summary: "This is the `@scope` decorator." 6 | category: "decorators" 7 | --- 8 | 9 | The `@scope` decorator is used with other decorators such as `@val` and `@module` to declare a parent scope for the binding. 10 | 11 | ### Example 12 | 13 | 14 | 15 | ```res 16 | @scope("Math") @val 17 | external floor: float => int = "floor" 18 | 19 | let result = floor(3.4) 20 | ``` 21 | 22 | ```js 23 | var result = Math.floor(3.4); 24 | ``` 25 | 26 | 27 | 28 | ### References 29 | 30 | * [Global Modules](/docs/manual/latest/bind-to-global-js-values#global-modules) -------------------------------------------------------------------------------- /misc_docs/syntax/operators_integer_division.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "integer-division" 3 | keywords: ["divide", "division", "int", "integer"] 4 | name: "/" 5 | summary: "This is the `integer division` operator." 6 | category: "operators" 7 | --- 8 | 9 | This operator performs *integer* division, with the result truncated to an integer value. 10 | 11 | If the second argument is *zero* then a `Division_by_zero` exception is thrown. Refer to the [Exception](/docs/manual/latest/exception) section for handling exceptions. 12 | 13 | 14 | 15 | ```res 16 | let result = 3 / 2 17 | ``` 18 | 19 | ```js 20 | var result = 1; 21 | ``` 22 | 23 | 24 | 25 | For dividing *floats* see the `/.` operator. 26 | -------------------------------------------------------------------------------- /pages/docs-cn/manual/latest/warning-numbers.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "警告编号" 3 | description: "Available compiler warning numbers in ReScript" 4 | canonical: "/docs/manual/latest/warning-numbers" 5 | --- 6 | 7 | import {make as WarningTable} from "src/components/WarningTable.mjs" 8 | 9 | # 警告编号 10 | 11 | 16 | 17 | 你可以在[构建配置](/docs/manual/latest/build-configuration#warnings) 中或 18 | [使用 `@@warning()` 装饰器](/syntax-lookup#module-warning-decorator) 配置 ReScript 编译器生成的警告。 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/bindings/Fuse.res: -------------------------------------------------------------------------------- 1 | module Options = { 2 | @deriving(abstract) 3 | type t = { 4 | @optional 5 | shouldSort: bool, 6 | @optional 7 | includeScore: bool, 8 | @optional 9 | threshold: float, 10 | @optional 11 | location: int, 12 | @optional 13 | distance: int, 14 | @optional 15 | ignoreLocation: bool, 16 | @optional 17 | minMatchCharLength: int, 18 | @optional 19 | keys: array, 20 | } 21 | } 22 | 23 | type t<'data> 24 | 25 | type match<'data> = {"item": 'data, "score": float} 26 | 27 | @new @module("fuse.js") 28 | external make: (array<'data>, Options.t) => t<'a> = "default" 29 | 30 | @send external search: (t<'data>, string) => array> = "search" 31 | -------------------------------------------------------------------------------- /src/bindings/Worker.resi: -------------------------------------------------------------------------------- 1 | type worker 2 | 3 | let make: string => worker 4 | 5 | module type Config = { 6 | type fromApp 7 | type fromWorker 8 | let make: unit => worker 9 | } 10 | 11 | module Make: (Config: Config) => 12 | { 13 | include Config 14 | 15 | module App: { 16 | let postMessage: (worker, fromApp) => unit 17 | let onMessage: (worker, {"data": fromWorker} => unit) => unit 18 | let onError: (worker, 'a => unit) => unit 19 | let terminate: worker => unit 20 | } 21 | 22 | module Worker: { 23 | type self 24 | let postMessage: fromWorker => unit 25 | let onMessage: (self, {"data": fromApp} => unit) => unit 26 | let self: self 27 | let importScripts: string => unit 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /misc_docs/syntax/decorator_get.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "get-decorator" 3 | keywords: ["get", "decorator"] 4 | name: "@get" 5 | summary: "This is the `@get` decorator." 6 | category: "decorators" 7 | --- 8 | 9 | The `@get` decorator is used to bind to a property of an object. 10 | 11 | ### Example 12 | 13 | 14 | 15 | ```res 16 | type window 17 | @val external window: window = "window" 18 | @get external getName: window => string = "name" 19 | 20 | let name = getName(window) 21 | ``` 22 | 23 | ```js 24 | var name = window.name; 25 | ``` 26 | 27 | 28 | 29 | ### References 30 | 31 | - [Bind using Special `@bs` Getters & Setters](/docs/manual/latest/bind-to-js-object#bind-using-special-bs-getters--setters) 32 | -------------------------------------------------------------------------------- /misc_docs/syntax/decorator_new.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "new-decorator" 3 | keywords: ["new", "decorator"] 4 | name: "@new" 5 | summary: "This is the `@new` decorator." 6 | category: "decorators" 7 | --- 8 | 9 | The `@new` decorator is used whenever you need to bind to a JavaScript 10 | class constructor that requires the `new` keword for instantiation. 11 | 12 | ### Example 13 | 14 | 15 | 16 | ```res 17 | type t 18 | 19 | @new external create: unit => t = "Date" 20 | 21 | let now = create() 22 | ``` 23 | 24 | ```js 25 | var now = new Date(); 26 | ``` 27 | 28 | 29 | 30 | ### References 31 | 32 | * [Bind to a JS Object That's a Class](/docs/manual/latest/bind-to-js-object#bind-to-a-js-object-thats-a-class) -------------------------------------------------------------------------------- /plugins/next-mdx.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = (pluginOptions = {}) => (nextConfig = {}) => { 4 | const extension = pluginOptions.extension || /\.mdx$/ 5 | 6 | return Object.assign({}, nextConfig, { 7 | webpack(config, options) { 8 | config.module.rules.push({ 9 | test: extension, 10 | use: [ 11 | options.defaultLoaders.babel, 12 | { 13 | loader: path.join(__dirname, 'mdx-loader'), 14 | options: pluginOptions.options, 15 | }, 16 | ], 17 | }) 18 | 19 | if (typeof nextConfig.webpack === 'function') { 20 | return nextConfig.webpack(config, options) 21 | } 22 | 23 | return config 24 | }, 25 | }) 26 | } 27 | -------------------------------------------------------------------------------- /misc_docs/syntax/decorator_module.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "module-decorator" 3 | keywords: ["module", "decorator"] 4 | name: "@module" 5 | summary: "This is the `@module` decorator." 6 | category: "decorators" 7 | --- 8 | 9 | The `@module` decorator is used to bind to a JavaScript module. 10 | 11 | ### Example 12 | 13 | 14 | 15 | ```res 16 | @module("path") 17 | external dirname: string => string = "dirname" 18 | 19 | let root = dirname("/User/github") 20 | ``` 21 | 22 | ```js 23 | var Path = require("path"); 24 | 25 | var root = Path.dirname("/User/github"); 26 | ``` 27 | 28 | 29 | 30 | ### References 31 | 32 | * [Import from JavaScript](/docs/manual/latest/import-from-export-to-js#import-from-javascript) 33 | -------------------------------------------------------------------------------- /misc_docs/syntax/decorator_set.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "set-decorator" 3 | keywords: ["set", "decorator"] 4 | name: "@set" 5 | summary: "This is the `@set` decorator." 6 | category: "decorators" 7 | --- 8 | 9 | The `@set` decorator is used to set a property of an object. 10 | 11 | ### Example 12 | 13 | 14 | 15 | ```res 16 | type window 17 | @val external window: window = "window" 18 | @set external setName: (window, string) => unit = "name" 19 | 20 | setName(window, "MyWindow") 21 | ``` 22 | 23 | ```js 24 | window.name = "MyWindow"; 25 | ``` 26 | 27 | 28 | 29 | ### References 30 | 31 | - [Bind using Special `@bs` Getters & Setters](/docs/manual/latest/bind-to-js-object#bind-using-special-bs-getters--setters) 32 | -------------------------------------------------------------------------------- /misc_docs/syntax/extension_debugger.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: "debugger" 3 | keywords: ["javascript", "embed", "raw", "debugger"] 4 | name: "%debugger" 5 | summary: "This is the `debugger` extension point." 6 | category: "extensionpoints" 7 | --- 8 | 9 | `%debugger` is used to insert a JavaScript `debugger` statement. 10 | 11 | 12 | 13 | ```res 14 | let f = (x, y) => { 15 | %debugger 16 | x + y 17 | } 18 | ``` 19 | 20 | ```js 21 | function f(x, y) { 22 | debugger; 23 | return (x + y) | 0; 24 | } 25 | ``` 26 | 27 | 28 | 29 | ### References 30 | 31 | * [Embed Raw JavaScript: Debugger](/docs/manual/latest/embed-raw-javascript#debugger) 32 | * [Extension Point Attributes](/docs/manual/latest/attribute#extension-point) 33 | -------------------------------------------------------------------------------- /pages/docs/manual/latest/browser-support-polyfills.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Browser Support & Polyfills" 3 | description: "Note on browser support in ReScript" 4 | canonical: "/docs/manual/latest/browser-support-polyfills" 5 | --- 6 | 7 | # Browser Support & Polyfills 8 | 9 | ReScript compiles to JavaScript **ES5**, with the exception of optionally allowing to compile to ES6's module import & export. 10 | 11 | For [old browsers](https://caniuse.com/#search=typed%20array), you also need to polyfill TypedArray. The following standard library functions require it: 12 | 13 | - `Int64.float_of_bits` 14 | - `Int64.bits_of_float` 15 | - `Int32.float_of_bits` 16 | - `Int32.bits_of_float` 17 | 18 | If you don't use these functions, you're fine. Otherwise, it'll be a runtime failure. 19 | -------------------------------------------------------------------------------- /pages/docs/manual/v8.0.0/browser-support-polyfills.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Browser Support & Polyfills" 3 | description: "Note on browser support in ReScript" 4 | canonical: "/docs/manual/latest/browser-support-polyfills" 5 | --- 6 | 7 | # Browser Support & Polyfills 8 | 9 | ReScript compiles to JavaScript **ES5**, with the exception of optionally allowing to compile to ES6's module import & export. 10 | 11 | For [old browsers](https://caniuse.com/#search=typed%20array), you also need to polyfill TypedArray. The following standard library functions require it: 12 | 13 | - `Int64.float_of_bits` 14 | - `Int64.bits_of_float` 15 | - `Int32.float_of_bits` 16 | - `Int32.bits_of_float` 17 | 18 | If you don't use these functions, you're fine. Otherwise, it'll be a runtime failure. 19 | -------------------------------------------------------------------------------- /pages/docs/manual/v9.0.0/browser-support-polyfills.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Browser Support & Polyfills" 3 | description: "Note on browser support in ReScript" 4 | canonical: "/docs/manual/latest/browser-support-polyfills" 5 | --- 6 | 7 | # Browser Support & Polyfills 8 | 9 | ReScript compiles to JavaScript **ES5**, with the exception of optionally allowing to compile to ES6's module import & export. 10 | 11 | For [old browsers](https://caniuse.com/#search=typed%20array), you also need to polyfill TypedArray. The following standard library functions require it: 12 | 13 | - `Int64.float_of_bits` 14 | - `Int64.bits_of_float` 15 | - `Int32.float_of_bits` 16 | - `Int32.bits_of_float` 17 | 18 | If you don't use these functions, you're fine. Otherwise, it'll be a runtime failure. 19 | -------------------------------------------------------------------------------- /src/components/Video.res: -------------------------------------------------------------------------------- 1 | // This component is representing a embedded video, mainly used for markdown content 2 | 3 | @react.component 4 | let default = (~src: string, ~caption: option=?) => { 5 |
6 |
7 |
10 |