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 sections to Flavors page about flavor-conditional asset bundling #9864

Merged
merged 4 commits into from
Dec 27, 2023

Conversation

andrewkolos
Copy link
Contributor

@andrewkolos andrewkolos commented Nov 28, 2023

This PR introduces additional documentation for a new feature, the conditional bundling of assets based on app flavor, which will be introduced by flutter/flutter#132985.

I've decided to incorporate the documentation into the flavors page, as I believe this is where this new feature would be most relevant. I do not suspect many users would start using the flavors feature specifically for this new feature.

I've also tried to keep this documentation simple, explaining how to use the feature entirely through an example (similar to how the Adding assets and images works).

Presubmit checklist

@flutter-website-bot
Copy link
Collaborator

flutter-website-bot commented Nov 28, 2023

Visit the preview URL for this PR (updated for commit 4c16322):

https://flutter-docs-prod--pr9864-add-flavor-specific-asset-co-ftxxhpt8.web.app

@gnprice
Copy link
Member

gnprice commented Nov 29, 2023

I've decided to incorporate the documentation into the flavors page, as I believe this is where this new feature would be most relevant. I do not suspect many users would start using the flavors feature specifically for this new feature.

This seems reasonable to me.

I think it would be important, though, to include at least a mention of this feature at https://docs.flutter.dev/ui/assets/assets-and-images#specifying-assets . That's the place that otherwise serves to document what the syntax is for the flutter: assets: … part of the pubspec.yaml file, so it's valuable for that to cover (either directly or indirectly) all the features that can appear there.

In particular, consider the case of a user who's maintaining a project they didn't themself create from scratch, and they're trying to understand how the assets configuration works. Their starting point is "how do assets in a Flutter pubspec work", not "how do I use flavors", so they'll find that page with its "Specifying assets" section. If the pubspec file they're looking at has this path:/flavors: syntax, and they don't see anything resembling that there, then they'd be frustrated that the docs are incomplete.

Copy link
Contributor

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a few tiny tweaks, but this looks good, @andrewkolos! Can you also add the link in Assets & images to here? I'll go ahead an approve so you can land it when ready.

src/deployment/flavors.md Outdated Show resolved Hide resolved
src/deployment/flavors.md Outdated Show resolved Hide resolved
src/deployment/flavors.md Outdated Show resolved Hide resolved
andrewkolos and others added 3 commits November 30, 2023 12:49
Co-authored-by: Shams Zakhour (ignore Sfshaza) <[email protected]>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <[email protected]>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <[email protected]>
@atsansone
Copy link
Contributor

@andrewkolos : This looks good. If you take it out of draft and update to the base branch, you can merge.

@atsansone atsansone assigned andrewkolos and unassigned sfshaza2 Dec 21, 2023
@atsansone atsansone marked this pull request as ready for review December 27, 2023 18:19
@atsansone atsansone merged commit 98c8244 into flutter:main Dec 27, 2023
9 checks passed
sfshaza2 pushed a commit that referenced this pull request Jul 1, 2024
…#10823)

This is a follow-up to
#9864 (comment).

This adds a breadcrumb to the "Assets and images" page that mentions and
links to the flavor-conditional asset bundling feature. This is meant to
aid discovery of the feature for users who are new to the assets
feature.

I chose adding a simple bread crumb over a full explanation + example
pubspec as this is a relatively niche feature, and I didn't want there
to be a significant amount of text between the top-level "Specifying
assets" and "Loading assets" sections, as the beginning of these
sections are going to be what I feel like the vast-majority of visitors
are going to be interested in.

## Presubmit checklist

- [x] This PR is marked as draft with an explanation if not meant to
land until a future stable release.
- [x] This PR doesn’t contain automatically generated corrections
(Grammarly or similar).
- [x] This PR follows the [Google Developer Documentation Style
Guidelines](https://developers.google.com/style) — for example, it
doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person).
- [x] This PR uses [semantic line
breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks)
of 80 characters or fewer.
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.

5 participants