Comments (9)
Hi @cometkim !
Really really awesome that you're experimenting with this! 😃 I actually spent some time on this a few weeks back, and while I never got around to publishing my work (nor actual code splitting which you're doing and would be really cool to incorporate into this), I just pushed the work I had done previously to a new branch: https://github.com/zth/reason-relay/compare/router?expand=1
What I've done so far is really unpolished and there's at least a few things I'm going to change, but maybe it can serve for some inspiration. It's also a port of the issue-tracker
router, and the idea is to ship a basic and flexible router with reason-relay
that's concurrent mode/suspense/ssr/preload ready, in an easy to use and type safe way.
Aaaanyway, back to your original question. Yes, for sure preloading should be moved into the actual generated module so it's not tightly coupled with the definition, just like you describe. I've done some prototyping on it, let me see if I can get that done and released quickly so you can continue your experimentation, which is really interesting and cool 👍
from rescript-relay.
@cometkim I just published 0.8.3
which now supports what you want. Check this out: https://github.com/zth/reason-relay/blob/e3eca6151021c3c59ededca71b68a7b2ec4043bb/packages/reason-relay/__tests__/Test_query.re#L125-L128
I can hopefully get back to you soon-ish about the routing. Routing is always a hassle to get right, but I have some ideas for what I want to support in an initial release.
Great to hear that you're trying ReasonML out, and yes, please do let me know of any issues you bump into! Also please post issues on the repo of the extension if you find things that annoy you, don't work etc.
Really looking forward to follow your progress on this experimentation! 🎉
from rescript-relay.
@cometkim are you using VSCode by any chance? If so, I'd love for you to test drive a dedicated VSCode extension for ReasonRelay I'm working on if you're up for it.
It's a bit rough around the edges still since it's in testing, but it should hopefully improve your experience. It's called vscode-reason-relay
and is published (although I haven't announced it yet) and available in the VSCode Extensions Marketplace. If you're interested in trying it out, I recommend reading through the Readme before you get started to learn about the features. If you have my other VSCode extension for ReasonML + GraphQL installed (vscode-reasonml-graphql
) then you can remove that one as this supercedes that.
from rescript-relay.
@zth Yeah! I used your VSCode extension as well and I was surprised that the relay compiler was very seamlessly integrated. (And wondering that other relay compilers still don't offer better DX like this)
I'm satisfied with ReasonML's module system, PPX, and strong type inference are a perfect fit for codegen-based processes. Even way faster, TypeScript is terribly slow when used with codegen (AND it now has better IDE-support? 🤯)
I'm doing it slowly because I'm a newbie at ReasonML. Obviously, it would be better if you had a well-integrated router something like navi as a first-class citizen (or third-party plugin would be fine). I still don't know how to properly represent route variants, and how to support nested routes. 🤷
I will let you know on Twitter if there is any progress or any question. 😉
from rescript-relay.
Fixed in 6e29f8a
from rescript-relay.
Thank you for the quick response!
from rescript-relay.
@zth Oops, vscode-reason-relay overwrites new artifacts with older versions. Is there a way to make it use the workspace version?
from rescript-relay.
Ah, never mind. It seems resolved after reloading vscode. 😅
from rescript-relay.
@cometkim please open an issue for that if you don't mind. I think it's just about restarting the compiler but that could be really confusing.
from rescript-relay.
Related Issues (20)
- [Discussion] Enums/Unions and exhaustiveness HOT 5
- %relay ppx: This function is a curried function where an uncurried function is expected HOT 11
- Something went wrong trying to analyze the ReScript project with compiler v11-rc.4 HOT 10
- Blocked rescript@11 migration HOT 11
- Compile error with rescript-reason v2 and ReScript 11 rc.4 HOT 2
- Timestamp type generation support HOT 5
- Add algolia search in docusaurus documentation HOT 1
- Fail to update from 2.1.0 to 2.2.0 HOT 3
- The relay_resolver.error support HOT 3
- @preloadable support HOT 1
- BUG: Failure to resolve useBlockingPaginationFragment (and others) HOT 1
- Plugin for Jetbrains Idea HOT 3
- [3.0] Update Getting Started.
- [3.0] Move to rescript.json HOT 2
- Handling Interface with @refetchable directive HOT 2
- Rename RecordSourceSelectorProxy to Store HOT 1
- Building 3.0.0-rc.4 fails using cached node modules (ENOENT `ppx-macos-arm64`) HOT 2
- Document updatable queries and fragments
- Implement `@assignable` fragments
- Consider hiding `.use` on `@inline` fragments HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rescript-relay.