Skip to content

Commit ecdc6b8

Browse files
authored
Cloudflare transition follow-up cleanup (#1040)
* Remove KeyCDN/Simple Analytics from the footer * cleanup * Update README * remove unused Next.js redirects, use `_redirects` file instead. See https://developers.cloudflare.com/pages/configuration/redirects/
1 parent 626853a commit ecdc6b8

File tree

11 files changed

+9
-163
lines changed

11 files changed

+9
-163
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
2-
3-
<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>
4-
51
# rescript-lang.org
2+
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
63

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

next.config.mjs

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ const { ProvidePlugin } = webpack;
1515
const transpileModules = ["rescript"].concat(bsconfig["bs-dependencies"]);
1616

1717
const config = {
18-
output: process.env.BUILD_STATIC === "true" ? "export" : undefined,
18+
output: "export",
1919
pageExtensions: ["jsx", "js", "bs.js", "mdx", "mjs"],
2020
env: {
2121
ENV: process.env.NODE_ENV,
2222
VERSION_LATEST: process.env.VERSION_LATEST,
2323
VERSION_NEXT: process.env.VERSION_NEXT,
24-
VERCEL: process.env.VERCEL,
2524
},
2625
swcMinify: false,
2726
webpack: (config, options) => {
@@ -85,70 +84,6 @@ const config = {
8584
config.plugins.push(new ProvidePlugin({ React: "react" }));
8685
return config;
8786
},
88-
async redirects() {
89-
return [
90-
{
91-
source: "/community",
92-
destination: "/community/overview",
93-
permanent: true,
94-
},
95-
{
96-
source: "/bucklescript-rebranding",
97-
destination: "/blog/bucklescript-is-rebranding",
98-
permanent: true,
99-
},
100-
{
101-
source: "/docs/manual/latest/migrate-from-bucklescript-reason",
102-
destination: "/docs/manual/v10.0.0/migrate-from-bucklescript-reason",
103-
permanent: true,
104-
},
105-
{
106-
source: "/docs/manual/latest/unboxed",
107-
destination: "/docs/manual/v10.0.0/unboxed",
108-
permanent: true,
109-
},
110-
{
111-
source: "/docs/gentype/latest/introduction",
112-
destination: "/docs/manual/latest/typescript-integration",
113-
permanent: true,
114-
},
115-
{
116-
source: "/docs/gentype/latest/getting-started",
117-
destination: "/docs/manual/latest/typescript-integration",
118-
permanent: true,
119-
},
120-
{
121-
source: "/docs/gentype/latest/usage",
122-
destination: "/docs/manual/latest/typescript-integration",
123-
permanent: true,
124-
},
125-
{
126-
source: "/docs/gentype/latest/supported-types",
127-
destination: "/docs/manual/latest/typescript-integration",
128-
permanent: true,
129-
},
130-
{
131-
source: "/docs/manual/latest/:slug*",
132-
destination: `/docs/manual/${process.env.VERSION_LATEST}/:slug*`,
133-
permanent: false,
134-
},
135-
{
136-
source: "/docs/manual/next/:slug*",
137-
destination: `/docs/manual/${process.env.VERSION_NEXT}/:slug*`,
138-
permanent: false,
139-
},
140-
{
141-
source: "/llms/manual/latest/:file*",
142-
destination: `/llms/manual/${process.env.VERSION_LATEST}/:file*`,
143-
permanent: false,
144-
},
145-
{
146-
source: "/llms/manual/next/:file*",
147-
destination: `/llms/manual/${process.env.VERSION_NEXT}/:file*`,
148-
permanent: false,
149-
},
150-
];
151-
},
15287
};
15388

15489
export default {

now.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

pages/api/revalidate.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Packages.res

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ let parsePkgs = data =>
563563
}
564564
})
565565

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

569569
let (one, two, three) = await Promise.all3((
@@ -603,17 +603,12 @@ let getStaticProps: Next.GetStaticProps.revalidate<props, unit> = async _ctx =>
603603
->Node.Fs.readFileSync
604604
->JSON.parseExn
605605
->unsafeToUrlResource
606-
let props: props = {
607-
"packages": pkges,
608-
"unmaintained": unmaintained,
609-
"urlResources": urlResources,
610-
}
611606

612607
{
613-
"props": props,
614-
"revalidate": switch Node.Process.env->Dict.get("BUILD_STATIC") {
615-
| Some("true") => Nullable.undefined
616-
| _ => Nullable.make(43200)
608+
"props": {
609+
"packages": pkges,
610+
"unmaintained": unmaintained,
611+
"urlResources": urlResources,
617612
},
618613
}
619614
}

src/Packages.resi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ type props = {
2525

2626
let default: props => React.element
2727

28-
let getStaticProps: Next.GetStaticProps.revalidate<props, unit>
28+
let getStaticProps: Next.GetStaticProps.t<props, unit>

src/bindings/Next.res

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ module GetStaticProps = {
3131
}
3232

3333
type t<'props, 'params> = context<'props, 'params> => promise<{"props": 'props}>
34-
35-
type revalidate<'props, 'params> = context<'props, 'params> => promise<{
36-
"props": 'props,
37-
"revalidate": Nullable.t<int>,
38-
}>
3934
}
4035

4136
module GetStaticPaths = {

src/common/CompilerManagerHook.res

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ module LoadScript = {
3535
}
3636

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

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

src/components/Footer.res

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,6 @@ let make = () => {
2323
<img className="w-40 mb-5" src="/static/rescript_logo_black.svg" />
2424
<div className="text-16">
2525
<p> {React.string(`© ${copyrightYear} The ReScript Project`)} </p>
26-
<p>
27-
{React.string("Software and assets distribution powered by ")}
28-
<Markdown.A href="https://www.keycdn.com/"> {React.string("KeyCDN")} </Markdown.A>
29-
{React.string(".")}
30-
</p>
31-
<p>
32-
<a
33-
target="_blank"
34-
rel="noopener noreferrer"
35-
href="https://simpleanalytics.com/rescript-lang.org">
36-
<img
37-
className="h-[2.25rem] mt-6"
38-
src="https://simpleanalyticsbadge.com/rescript-lang.org?counter=true&radius=13"
39-
/>
40-
</a>
41-
</p>
4226
</div>
4327
</div>
4428
<div

src/others/Revalidate.res

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/others/Revalidate.resi

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)