Comments (8)
I'm open to changing it; the reason they're excluded at present is so that the examples have the possibility of defining their own release
profiles. If you move the examples from being excluded to being members of the workspace, it fires one of these warnings for each of them
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package: /Users/gjohnston/Documents/Projects/leptos-main/leptos/examples/todomvc-ssr/todomvc-ssr-client/Cargo.toml
workspace: /Users/gjohnston/Documents/Projects/leptos-main/leptos/Cargo.toml
This suggests to me that we'd need to set a single profile for all the examples, but there are different settings that make sense for them. Particularly in the SSR + hydration examples, for release
builds it's nice to optimize for size on the Wasm frontend and for speed on the server. It's not a big deal as these are just examples.
If anyone knows how to get around this problem, I'm open to hearing it.
I tend to just open the examples in their own editor window so I don't notice the lack of rust-analyzer support but that sounds like a pretty good argument for including them in the workspace. When you say rust-analyzer skips them, does that mean it just doesn't run at all for the examples? That's not ideal obviously.
from leptos.
When you say rust-analyzer skips them, does that mean it just doesn't run at all for the examples? That's not ideal obviously.
Indeed, that's what I mean. I'm not really knowledgeable in that area either but I'm interested in this project and I may try to play with the config a bit if I end up trying to contribute.
from leptos.
Sorry for the warning, it's due to my PR #22. The solution for the warning is to add an empty [workspace]
at the top of the Cargo.toml that is not included in the workspace (I'll raise a PR for it as soon as I have some time for it).
Based on the hackernews example (@gbj, is this right?):
In the currently workspaced Leptos libraries, there are a set of mutually exclusive features: ssr
, csr
and hydrate
.
When coding the app, it is done in a way that is compatible with all three.
When compiling the client, either csr
or hydrate
can be used. When compiling the server ssr
needs to be enabled (if you want it).
This means that the server and client needs conflicting features and if included in the workspace there would be errors due to these conflicts.
It can potentially be solved by Cargo's Feature resolver 2 but would need more investigation.
from leptos.
@akesson Thanks — I'd be happy for a PR.
At this point csr
is enabled by default when you import leptos
. On example that are just client-side this is fine, no further setup.
On todomvc-ssr
, the client and server each import todomvc
, but disable its csr
default feature and enable hydrate
or ssr
. This is why I have todomvc
define features that in turn set the features on leptos
.
Same for hackernews
except that they're all in one directory. hackernews-app
is the csr
version, hackernews-server
and hackernews-client
are ssr
and hydrate
.
from leptos.
Sorry, not keeping up with the changes here... On latest main branch I don't get the warning and I see that @gbj already added examples as excluded (which has the same effect as adding [workspace]
to the example projects' Cargo.toml.
from leptos.
I've decided to include the examples in the workspace and just define one profile at the workspace root... it's really not a big deal that we can't have a separate profile for the example servers.
from leptos.
I see that examples are removed from the workspace at this point, why is it?
from leptos.
@gbj can you explain please? Right now I see examples as excluded from the workspace. More on that in my feedback here: #2141.
from leptos.
Related Issues (20)
- DynChild is populated as a single Child in the components' children property HOT 4
- Breaking change in view macro between 0.6.10 and 0.6.11
- Allow custom derive for server_fns with custom encoding HOT 3
- Add Trigger::dispose
- leptos_macro 0.6.11 leptos::view! breaks with some comments
- Non-'static signals
- the format!() bug in <a href={format!()}> HOT 2
- Effects/Memos should't be able to "own" a signal HOT 4
- Nested Suspense ignores SSR Mode and breaks Hydration HOT 2
- Error when running server function inside spawn_local HOT 5
- Click events are registered twice when two leptos custom elements are on a page HOT 3
- about mobile support
- Recursive effects never run after recursing HOT 2
- Clippy warnings in some components with rust 1.78 HOT 1
- rkyv, avoid the copy to byte ? HOT 4
- Check ActionForm input names at compile time HOT 4
- Allow server components in islands architecture to call code behind ssr without need for #[server] HOT 1
- porting over some react code to my project, having hydration issues
- leptos_router parent Route attr view is not generating view for dynamic routes HOT 4
- relese build causes SIGSEGV and SIGBUS while dev build is just fine HOT 3
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 leptos.