I'm trying to use this project as a template to help me understand how to integrate RacketScript/Rackt in my own projects. I was able to get it to build, but I feel my workflow is different from what you're intending. I'll say what I did, and maybe you can say what I should have done?
Setup
1) I installed racketscript (raco pkg install racketscript).
2) I installed rackt (git clone git@github.com:rackt-org/rackt.git; cd ./rackt; raco pkg install)
3) I cloned this repo.
Build
1) In the cloned directory, I ran racks src/app.rkt
2) I served the cloned directory and viewed index.html in my browser
I got errors that indicated that "react-dom" was not being found.
After some digging around and some failed attempts, I stumbled upon the following workflow, which worked:
1) cd into the local rackt directory produced from racks command.
2) Did npm init; npm install react react-dom
3) Re-ran racks with racks --target webpack src/app.rkt
4) Ran cd js-build; npx webpack
5) Edited index.html's relevant <script /> tag to load /js-build/dist/main.js instead of /js-build/modules/app.rkt.js
6) Visited the served index.html file in my browser and it worked!
This is really exciting! I'm excited to start using this.
However, given that I edited an html file, I'm sure your workflow is different from mine. What should I be doing?
I'm trying to use this project as a template to help me understand how to integrate RacketScript/Rackt in my own projects. I was able to get it to build, but I feel my workflow is different from what you're intending. I'll say what I did, and maybe you can say what I should have done?
Setup
1) I installed
racketscript
(raco pkg install racketscript
). 2) I installedrackt
(git clone git@github.com:rackt-org/rackt.git; cd ./rackt; raco pkg install
) 3) I cloned this repo.Build
1) In the cloned directory, I ran
racks src/app.rkt
2) I served the cloned directory and viewedindex.html
in my browserI got errors that indicated that "react-dom" was not being found.
After some digging around and some failed attempts, I stumbled upon the following workflow, which worked:
1)
cd
into the localrackt
directory produced fromracks
command. 2) Didnpm init; npm install react react-dom
3) Re-ranracks
withracks --target webpack src/app.rkt
4) Rancd js-build; npx webpack
5) Editedindex.html
's relevant<script />
tag to load/js-build/dist/main.js
instead of/js-build/modules/app.rkt.js
6) Visited the servedindex.html
file in my browser and it worked!This is really exciting! I'm excited to start using this.
However, given that I edited an html file, I'm sure your workflow is different from mine. What should I be doing?