Skip to content

Cloudflare transition follow-up cleanup #1040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)

<a href="https://simpleanalytics.com/rescript-lang.org?utm_source=rescript-lang.org&utm_content=badge" referrerpolicy="origin" target="_blank"><img src="https://simpleanalyticsbadge.com/rescript-lang.org?counter=true" loading="lazy" referrerpolicy="no-referrer" crossorigin="anonymous" /></a>

# rescript-lang.org
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)

This is the official documentation platform for the [ReScript](https://rescript-lang.org) programming language.

Expand Down
67 changes: 1 addition & 66 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ const { ProvidePlugin } = webpack;
const transpileModules = ["rescript"].concat(bsconfig["bs-dependencies"]);

const config = {
output: process.env.BUILD_STATIC === "true" ? "export" : undefined,
output: "export",
pageExtensions: ["jsx", "js", "bs.js", "mdx", "mjs"],
env: {
ENV: process.env.NODE_ENV,
VERSION_LATEST: process.env.VERSION_LATEST,
VERSION_NEXT: process.env.VERSION_NEXT,
VERCEL: process.env.VERCEL,
},
swcMinify: false,
webpack: (config, options) => {
Expand Down Expand Up @@ -85,70 +84,6 @@ const config = {
config.plugins.push(new ProvidePlugin({ React: "react" }));
return config;
},
async redirects() {
return [
{
source: "/community",
destination: "/community/overview",
permanent: true,
},
{
source: "/bucklescript-rebranding",
destination: "/blog/bucklescript-is-rebranding",
permanent: true,
},
{
source: "/docs/manual/latest/migrate-from-bucklescript-reason",
destination: "/docs/manual/v10.0.0/migrate-from-bucklescript-reason",
permanent: true,
},
{
source: "/docs/manual/latest/unboxed",
destination: "/docs/manual/v10.0.0/unboxed",
permanent: true,
},
{
source: "/docs/gentype/latest/introduction",
destination: "/docs/manual/latest/typescript-integration",
permanent: true,
},
{
source: "/docs/gentype/latest/getting-started",
destination: "/docs/manual/latest/typescript-integration",
permanent: true,
},
{
source: "/docs/gentype/latest/usage",
destination: "/docs/manual/latest/typescript-integration",
permanent: true,
},
{
source: "/docs/gentype/latest/supported-types",
destination: "/docs/manual/latest/typescript-integration",
permanent: true,
},
{
source: "/docs/manual/latest/:slug*",
destination: `/docs/manual/${process.env.VERSION_LATEST}/:slug*`,
permanent: false,
},
{
source: "/docs/manual/next/:slug*",
destination: `/docs/manual/${process.env.VERSION_NEXT}/:slug*`,
permanent: false,
},
{
source: "/llms/manual/latest/:file*",
destination: `/llms/manual/${process.env.VERSION_LATEST}/:file*`,
permanent: false,
},
{
source: "/llms/manual/next/:file*",
destination: `/llms/manual/${process.env.VERSION_NEXT}/:file*`,
permanent: false,
},
];
},
};

export default {
Expand Down
7 changes: 0 additions & 7 deletions now.json

This file was deleted.

1 change: 0 additions & 1 deletion pages/api/revalidate.js

This file was deleted.

15 changes: 5 additions & 10 deletions src/Packages.res
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ let parsePkgs = data =>
}
})

let getStaticProps: Next.GetStaticProps.revalidate<props, unit> = async _ctx => {
let getStaticProps: Next.GetStaticProps.t<props, unit> = async _ctx => {
let baseUrl = "https://registry.npmjs.org/-/v1/search?text=keywords:rescript&size=250&maintenance=1.0&popularity=0.5&quality=0.9"

let (one, two, three) = await Promise.all3((
Expand Down Expand Up @@ -603,17 +603,12 @@ let getStaticProps: Next.GetStaticProps.revalidate<props, unit> = async _ctx =>
->Node.Fs.readFileSync
->JSON.parseExn
->unsafeToUrlResource
let props: props = {
"packages": pkges,
"unmaintained": unmaintained,
"urlResources": urlResources,
}

{
"props": props,
"revalidate": switch Node.Process.env->Dict.get("BUILD_STATIC") {
| Some("true") => Nullable.undefined
| _ => Nullable.make(43200)
"props": {
"packages": pkges,
"unmaintained": unmaintained,
"urlResources": urlResources,
},
}
}
2 changes: 1 addition & 1 deletion src/Packages.resi
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ type props = {

let default: props => React.element

let getStaticProps: Next.GetStaticProps.revalidate<props, unit>
let getStaticProps: Next.GetStaticProps.t<props, unit>
5 changes: 0 additions & 5 deletions src/bindings/Next.res
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ module GetStaticProps = {
}

type t<'props, 'params> = context<'props, 'params> => promise<{"props": 'props}>

type revalidate<'props, 'params> = context<'props, 'params> => promise<{
"props": 'props,
"revalidate": Nullable.t<int>,
}>
}

module GetStaticPaths = {
Expand Down
5 changes: 1 addition & 4 deletions src/common/CompilerManagerHook.res
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ module LoadScript = {
}

module CdnMeta = {
let baseUrl = switch Node.Process.env->Dict.get("VERCEL") {
| Some(_) => "https://cdn.rescript-lang.org"
| None => "/playground-bundles"
}
let baseUrl = "/playground-bundles"

let getCompilerUrl = (version): string => `${baseUrl}/${Semver.toString(version)}/compiler.js`

Expand Down
16 changes: 0 additions & 16 deletions src/components/Footer.res
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,6 @@ let make = () => {
<img className="w-40 mb-5" src="/static/rescript_logo_black.svg" />
<div className="text-16">
<p> {React.string(`© ${copyrightYear} The ReScript Project`)} </p>
<p>
{React.string("Software and assets distribution powered by ")}
<Markdown.A href="https://www.keycdn.com/"> {React.string("KeyCDN")} </Markdown.A>
{React.string(".")}
</p>
<p>
<a
target="_blank"
rel="noopener noreferrer"
href="https://simpleanalytics.com/rescript-lang.org">
<img
className="h-[2.25rem] mt-6"
src="https://simpleanalyticsbadge.com/rescript-lang.org?counter=true&radius=13"
/>
</a>
</p>
</div>
</div>
<div
Expand Down
42 changes: 0 additions & 42 deletions src/others/Revalidate.res

This file was deleted.

7 changes: 0 additions & 7 deletions src/others/Revalidate.resi

This file was deleted.