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

Feature-gate sections of Yew #648

Closed
hgzimmerman opened this issue Sep 17, 2019 · 0 comments · Fixed by #684
Closed

Feature-gate sections of Yew #648

hgzimmerman opened this issue Sep 17, 2019 · 0 comments · Fixed by #684
Labels
feature-request A feature request

Comments

@hgzimmerman
Copy link
Member

Description

**I'm submitting a feature request

Given how size is an important factor in load time, I think there is reason to allow turning off certain parts of Yew if users don't use them via feature flags. Notable sections that can easily be partitioned away are Services and Agents. Without these, you can still create web-apps that display information and respond to user input. Framework users may want the choice to remove these features if they aren't using them.

Together, agents and services make up about 1.5kloc out of the 3.5kloc project (kloc is an okish proxy for binary size). While that seems large comparatively, remember that user-code and the expanded output from the html! macro accounts for far more code than the library does. Even if the 1.5kloc is reletively small, being able to eliminate it is valuable to those trying to get their app under a size budget.

Possibly in the future, services could be split into its own crate, and reexported from yew. Each service could be given a feature-flag, with a subset designated behind a core flag which would include the current services we have (this would be the subset reexported from yew).
This would allow that crate to accept less generally-useful services without causing code and feature bloat in the main yew repo.

I don't think this is super important to address in the near future, but I think its a discussion worth having.

@jstarry jstarry changed the title Feature: Feature-gate sections of Yew Feature-gate sections of Yew Sep 27, 2019
@jstarry jstarry added the feature-request A feature request label Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants