Skip to content
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

Init commit create react app with react-app-rewired #13

Merged
merged 9 commits into from
Dec 3, 2020

Conversation

bonomat
Copy link
Member

@bonomat bonomat commented Dec 2, 2020

supersedes #12 do to changes of master

What is this?

This adds a new waves folder which is a react app using a rust wasm library combined with webpack.

my-app was creating using create-react-app.
However, this would not let us configure webpack (which is the reason we went for create-react-app in the first place).
Hence we use react-app-rewired and created a config-override.js
The library wasm_lib was created using wasm-pack new.
It showcases a single method to return hello world and a function to initialize a logger.

Issues

So far I like the setup, it has one caveat though: if we want to add native as a dependency in package.toml then a rebuild is not automatically reloaded. File-based import work though.

How to

Go into my-app and type

yarn install

followed by

yarn start

to start in development mode. You can then make changes in the rust library under native and the code should automatically rebuild and reload.

Enjoy :)

.github/workflows/ci.yml Outdated Show resolved Hide resolved
bobtimus/src/main.rs Outdated Show resolved Hide resolved
waves/src/App.tsx Outdated Show resolved Hide resolved
waves/src/App.tsx Outdated Show resolved Hide resolved
@bonomat bonomat force-pushed the react-bootstrap branch 2 times, most recently from 5ac4280 to e04a13a Compare December 2, 2020 21:34
@bonomat bonomat force-pushed the react-bootstrap branch 2 times, most recently from 56d11c0 to 13238d5 Compare December 3, 2020 04:12
@bonomat bonomat merged commit b0b10ac into master Dec 3, 2020
@bonomat bonomat deleted the react-bootstrap branch December 3, 2020 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants