You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 6, 2021. It is now read-only.
Per @Timer and my discussion on MoOx/phenomic#1286 I am starting to work on a next plugin for ReasonML that is built directly in to next itself. I am now here to discuss the implementation and whether I am on the right path.
Prior Art and Current Issues
There are a few examples already in the next.js examples folder that handle working with ReasonML/ReasonReact, however, there is an issue with them. They use the babel-plugin-bucklescript which is archived on GitHub and out of date. See: https://github.com/mike-engel/babel-plugin-bucklescript. I think for this plugin, and future iterations, it would need to be supported by the the bucklescript platform, i.e. bs-platform. Although I suppose I could fork that repo and update it. However, if I go the route of using bs-platform, this presents another issue: building it to be deployed on now. I have had issues in the past attempting to deploy a ReasonML app on the now platform that does not support the OCaml ecosystem. This would work fine for JAM stack apps, but people would have an issue if they were deploying a server rendered app where it needs to be built to an image and not simply spit out HTML files using next export.
Considerations
For the reasons listed above I think I need to take a different approach whether I work with bs-platform or fork babel-plugin-bucklescript.
Firstly, I will need to add files and pull in dependencies. So my thought process here was to follow the typescript plugin that is now built into next.js: https://github.com/zeit/next.js/blob/canary/packages/next/lib/verifyTypeScriptSetup.ts. This makes sense because I will need to install bs-platform, add a bs-config file, a bindings file, and whatever other files are needed to get it working.
Anyhow, these are just a few of my ideas for creating a ReasonML/ReasonReact plugin directly into next.js. Let me know what you think and if I am on the correct path. Curious to hear anyone else's thoughts.
The text was updated successfully, but these errors were encountered:
Background
Per @Timer and my discussion on MoOx/phenomic#1286 I am starting to work on a next plugin for ReasonML that is built directly in to next itself. I am now here to discuss the implementation and whether I am on the right path.
Prior Art and Current Issues
There are a few examples already in the next.js examples folder that handle working with ReasonML/ReasonReact, however, there is an issue with them. They use the
babel-plugin-bucklescript
which is archived on GitHub and out of date. See: https://github.com/mike-engel/babel-plugin-bucklescript. I think for this plugin, and future iterations, it would need to be supported by the the bucklescript platform, i.e. bs-platform. Although I suppose I could fork that repo and update it. However, if I go the route of using bs-platform, this presents another issue: building it to be deployed on now. I have had issues in the past attempting to deploy a ReasonML app on the now platform that does not support the OCaml ecosystem. This would work fine for JAM stack apps, but people would have an issue if they were deploying a server rendered app where it needs to be built to an image and not simply spit out HTML files usingnext export
.Considerations
For the reasons listed above I think I need to take a different approach whether I work with bs-platform or fork babel-plugin-bucklescript.
Firstly, I will need to add files and pull in dependencies. So my thought process here was to follow the typescript plugin that is now built into next.js: https://github.com/zeit/next.js/blob/canary/packages/next/lib/verifyTypeScriptSetup.ts. This makes sense because I will need to install bs-platform, add a bs-config file, a bindings file, and whatever other files are needed to get it working.
Secondly, in order to get it to build on now, I think I will need to vendor bucklescript and place it into the node module already pre-packaged so that it doesn't need to be installed on the now server image. This is what is done in phenomic: https://github.com/phenomic/phenomic/blob/1a896add371a7903f9633457104f2caff78736c3/packages/bs-platform/package.json#L23. That is what is then installed: https://github.com/phenomic/phenomic/blob/76c8882c52606ab44e61c0502be915aa023634bc/packages/core/package.json#L32. Or something to this effect. Maybe I am misinterpreting what is happening here so I am happy to be corrected.
Next Steps
Anyhow, these are just a few of my ideas for creating a ReasonML/ReasonReact plugin directly into next.js. Let me know what you think and if I am on the correct path. Curious to hear anyone else's thoughts.
The text was updated successfully, but these errors were encountered: