Skip to content

Upgrade to NextJS 13 / MDX v2 / Tailwindcss v3 #723

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 38 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2456665
- Update Next.js to version 12
JiaeK Jan 4, 2023
24f612b
Merge branch 'rescript-association:master' into nextjs-12
JiaeK Jan 27, 2023
25d4a35
Updated NextJS to v.13
JiaeK Jan 27, 2023
5334930
Merge branch 'nextjs-12' of https://github.com/JiaeK/rescript-lang.or…
JiaeK Jan 27, 2023
90baa7a
Revert "Merge branch 'nextjs-12' of https://github.com/JiaeK/rescript…
JiaeK Jan 27, 2023
89c8df1
update
aspeddro Jul 30, 2023
66f65ad
update
aspeddro Jul 31, 2023
6929ff4
remove next-transpile-modules
aspeddro Jul 31, 2023
942f2c1
rm postcss
aspeddro Jul 31, 2023
20ad53b
back to html comments
aspeddro Jul 31, 2023
ae6de65
rm .md extension
aspeddro Jul 31, 2023
6fbe8ad
cleanup
aspeddro Jul 31, 2023
2add1d8
format
aspeddro Jul 31, 2023
0e1db89
fix next build
aspeddro Aug 2, 2023
59c00c4
comment extract-tocs for v9
aspeddro Aug 2, 2023
29a2d4b
move v9 docs to pages
aspeddro Aug 2, 2023
08b2e9f
remove v9 from gitignore
aspeddro Aug 2, 2023
be12e8f
Merge branch 'master' into nextjs-13-cont-aspeddro
aspeddro Aug 2, 2023
9cf8fa0
move page: mirate-from-v3 to migrate-react
aspeddro Aug 2, 2023
35c1ba2
update sidebar react section
aspeddro Aug 2, 2023
083f0c7
update rescript to 10.1.4
aspeddro Aug 2, 2023
6bff459
fix |
aspeddro Aug 2, 2023
001ee75
fix |
aspeddro Aug 3, 2023
1a7c319
remove expiremental next.config
aspeddro Aug 3, 2023
4d5d455
restore migrate-react pages
aspeddro Aug 3, 2023
4bb9028
remove import json
aspeddro Aug 3, 2023
e6c88d4
update packge-lock.json
aspeddro Aug 3, 2023
d0039ef
refactor
aspeddro Aug 3, 2023
985fcfe
remove mdx-loader and next-mdx plugins
aspeddro Aug 3, 2023
2414d21
fix parse block code
aspeddro Aug 3, 2023
f7d4b72
fix code block docs overview
aspeddro Aug 3, 2023
e9d378d
uncomment import-from-export-to-js.mdx
aspeddro Aug 3, 2023
90addb4
reduce diff
aspeddro Aug 3, 2023
de2d2d8
testing
aspeddro Oct 8, 2023
f821a1a
add v9
aspeddro Oct 8, 2023
57b45d6
adios require
aspeddro Oct 10, 2023
3621722
fix syntax lookup page
aspeddro Oct 11, 2023
0072541
Apply suggestions from code review
ryyppy Oct 24, 2023
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
7 changes: 0 additions & 7 deletions .babelrc

This file was deleted.

4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ _tempFile.cmj
_tempFile.cmt

# these docs are checked in, but we consider them frozen.
pages/docs/manual/v8.0.0/
pages/docs/manual/v9.0.0/
# pages/docs/manual/v8.0.0/
# pages/docs/manual/v9.0.0/

.bsb.lock
.merlin
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ If you need inspiration on what to work on, you can check out issues tagged with

We really appreciate all input from users, community members and potential contributors. Please make sure to consider the other person's opinion and don't assume any common knowledge.

**Most importantly: Keep it professional and be nice to each other**
**Most importantly: Keep it professional and be nice to eachother**

There might be situations where others don't understand a proposed feature or have different opinions on certain writing styles. That's fine, discussions are always welcome! Communicate in clear actionables, make your plans clear and always stick to the original topic.
There might be situations where others don't understand a proposed feature or have different opinions on certain writing styles. That's fine, discussions are always welcome! Communicate in clear actionables, make your plans clear and always to stick to the original topic.

If other contributors disagree with certain proposals and don't change their mind after longer discussions, please don't get discouraged when an issue gets closed / postponed. Everyone tries their best to make the platform better, and to look at it in another perspective: Closed issues are also a highly valuable resource for others to understand technical decisions later on.

### Communicate your Time Commitment

Open Source development can be a challenge to coordinate, so please make sure to block enough time to work on your tasks and show commitment when taking on some work. Let other contributors know if your time schedule changes significantly, and also let others know if you can't finish a task.

We value your voluntary work, and of course it's fine to step back from a ticket for any reason (we can also help you if you are getting stuck). Please talk to us in any case, otherwise we might re-assign the ticket to other contributors.
We value your voluntary work, and of course it's fine to step back from a ticket for any reasons (we can also help you if you are getting stuck). Please talk to us in any case, otherwise we might re-assign the ticket to other contributors.

### Communication Channels

Expand All @@ -66,7 +66,7 @@ Always check if there are any designs for certain UI components and think about
### Technical Writing (Documentation)

- Think and write in a JS friendly mindset when explaining concepts / showing examples.
- No `foo` examples if somewhat possible. Try to establish practical context in your showcase examples.
- No `foo` examples if somewhat possible. Try to establish practical context in your show case examples.
- No references to `OCaml`. ReScript is its own language, and we don't rely on external resources of our host language.
- If possible, no references to `Reason` examples / external resources. Our goal is to migrate everything to ReScript syntax.

Expand Down
2 changes: 1 addition & 1 deletion _blogposts/2020-09-25-release-8-3-2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ There are two ways of removing staled artifacts, the second one is introduced in

- Based on live analysis and prebuilt-in knowledge

We scan `lib/bs` directory and check some dangling cm{i,t,j,ti} files, if it does not exist in
We scan `lib/bs` directory and check some dangling `cm{i,t,j,ti}` files, if it does not exist in
the current build set, it is considered stale artifacts. If it is `cmt` file, it would trigger some hooks of `genType`, notably -cmt-rm.

- Based on previous build logs
Expand Down
2 changes: 1 addition & 1 deletion _blogposts/2021-02-09-release-9-0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ReScript is a robustly typed language that compiles to efficient and human-reada

Use `npm` to install the newest [9.0.1 release](https://www.npmjs.com/package/bs-platform/v/9.0.1) with the following command:

```
```sh
npm install bs-platform@9.0.1
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ A detailed list of changes are listed as below:
- #1658, fix typeof = "null" issue
- #1656, bs.get/set/get_index/set_index respects bs.ignore
- #1654, `bsb -init` fails if package or current dir has space (parent dir can have spaces)
- #1678, bs.get{null;undefined} in object type
- #1678, `bs.get{null;undefined}` in object type
- #1692, fix invalid js syntax output
- #1701, fix tailcall handling interaction with exception handler
- #1666, fix misue of GADT api
Expand Down
88 changes: 0 additions & 88 deletions next.config.js

This file was deleted.

98 changes: 98 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import fs from "fs";
import webpack from "webpack";
import rehypeSlug from 'rehype-slug';
import remarkGfm from 'remark-gfm';
import remarkComment from 'remark-comment';
import remarkFrontmatter from 'remark-frontmatter'
import remarkMdxFrontmatter from "remark-mdx-frontmatter";
import { createLoader } from 'simple-functional-loader'

const bsconfig = JSON.parse(fs.readFileSync("./bsconfig.json"))

const { ProvidePlugin } = webpack;

const transpileModules = ["rescript"].concat(bsconfig["bs-dependencies"]);

const config = {
pageExtensions: ["jsx", "js", "bs.js", "mdx", "mjs"],
env: {
ENV: process.env.NODE_ENV,
},
swcMinify: true,
webpack: (config, options) => {
const { isServer } = options;
if (!isServer) {
// We shim fs for things like the blog slugs component
// where we need fs access in the server-side part
config.resolve.fallback = {
fs: false,
path: false,
};
}
// We need this additional rule to make sure that mjs files are
// correctly detected within our src/ folder
config.module.rules.push({
test: /\.m?js$/,
// v-- currently using an experimental setting with esbuild-loader
//use: options.defaultLoaders.babel,
use: [{ loader: "esbuild-loader", options: { loader: "jsx" } }],
exclude: /node_modules/,
type: "javascript/auto",
resolve: {
fullySpecified: false,
},
});

function mainMdxLoader(plugins) {
return [
createLoader(function(source) {
const result = `${source}\n\nMDXContent.frontmatter = frontmatter`
return result
}),
]
}

config.module.rules.push({
test: /\.mdx?$/,
use: mainMdxLoader(),
});

config.module.rules.push({
test: /\.mdx?$/,
use: [
{
loader: '@mdx-js/loader',
/** @type {import('@mdx-js/loader').Options} */
options: {
remarkPlugins: [remarkComment, remarkGfm, remarkFrontmatter, remarkMdxFrontmatter],
providerImportSource: '@mdx-js/react',
rehypePlugins: [rehypeSlug]
}
}
]
});


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,
},
];
},
};

export default {
transpilePackages: transpileModules,
...config
}
Loading