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

Add nextjs example #46

Merged
merged 6 commits into from Oct 1, 2022
Merged

Conversation

marjorg
Copy link
Contributor

@marjorg marjorg commented Sep 11, 2022

I've been testing RSPC in a Next.js project and thought I could add an example based on it. Also did some extra changes I thought made sense. Let me know if you want any of them reverted.

Summary:

  • Made Axum example file into an actual project that can be run by Cargo (bindings output to /examples/bindings.ts)
  • Moved Astro (packages/example) into /examples/astro
  • Added Next.js example to /examples/nextjs

I'm not fully sure if the changes made to Cargo.toml in root are correct, so please check that.

Fixes issue #43

@marjorg
Copy link
Contributor Author

marjorg commented Sep 11, 2022

@oscartbeaumont Just give me a shout here or on discord if you want any changes

@oscartbeaumont
Copy link
Owner

Thanks for these changes but let me think about whether it's a good idea to move the examples into the /examples folder or not. I originally had the examples in the /examples folder like you have now but the problem with that is that Cargo includes them when publishing the crate which makes for a lot of unnecessary data. The tools in Cargo to ignore those examples were very finicky and that's why I moved it. However, having the examples split up isn't a great experience for someone coming to the repository so, I will do some local tests and see if I can get it to ignore the examples correctly.

I can deal with the merge conflicts later in the week.

Having a NextJS example has been on my todolist, thanks for making it happen!

@marjorg
Copy link
Contributor Author

marjorg commented Sep 12, 2022

Yeah I get that, wasn't completely aware of how the /examples directory worked.

Could and alternative be to move the crate into /packages/rspc/packages/rust or something. That way general examples can live in /examples and crate examples in /packages/rpsc/examples

@oscartbeaumont
Copy link
Owner

Heads up, I haven't forgotten about this. I wanna get the changes from the 0.0.6 branch in before I merge this because I think they will come with a rearrangement of the examples.

@oscartbeaumont oscartbeaumont merged commit 4dd190a into oscartbeaumont:main Oct 1, 2022
@oscartbeaumont
Copy link
Owner

Sorry for the delay. Thanks for your contribution!

@marjorg marjorg deleted the add-nextjs-example branch October 1, 2022 15:10
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.

None yet

2 participants