-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
chore(flutter): Add missing options to download sentry-wizard for getting started page #14120
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
Merged
coolguyzone
merged 4 commits into
master
from
cursor/enhance-flutter-onboarding-experience-fa34
Jul 1, 2025
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2ba7c4f
Update Flutter SDK installation guide with detailed Sentry Wizard ins…
cursoragent 9d4b8f7
Update Sentry Wizard installation docs to v5.1.0 for all platforms
cursoragent 8ae9a95
[getsentry/action-github-commit] Auto commit
getsantry[bot] bb97c8b
Refine PR
buenaflor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| # Dynamic Sentry Wizard Version Implementation | ||
|
|
||
| ## Current State | ||
| The Flutter and Android documentation now includes comprehensive installation options for sentry-wizard, but the version is currently hardcoded to v5.1.0 (updated from the previous v4.0.1). | ||
|
|
||
| ## Problem Solved | ||
| - ✅ Added comprehensive platform support (Windows, macOS Intel/ARM, Linux x64/ARM) | ||
| - ✅ Updated to latest version (v5.1.0 from v4.0.1) | ||
| - ✅ Windows users no longer forced to use `brew` | ||
| - ✅ Flutter developers can avoid JavaScript tooling (`npx`) if preferred | ||
| - ✅ Consistent with Android documentation approach | ||
|
|
||
| ## Future Enhancement: Dynamic Version Fetching | ||
|
|
||
| ### Approach 1: Build-time Version Fetching (Recommended) | ||
| Create a build script that fetches the latest version during the build process: | ||
|
|
||
| ```javascript | ||
| // scripts/fetch-sentry-wizard-version.js | ||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
|
|
||
| async function fetchLatestVersion() { | ||
| try { | ||
| const response = await fetch('https://api.github.com/repos/getsentry/sentry-wizard/releases/latest'); | ||
buenaflor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| const data = await response.json(); | ||
| const version = data.tag_name.startsWith('v') ? data.tag_name : `v${data.tag_name}`; | ||
|
|
||
| // Save to a JSON file that can be imported | ||
| const versionData = { sentryWizardVersion: version }; | ||
| fs.writeFileSync( | ||
| path.join(__dirname, '../src/data/versions.json'), | ||
| JSON.stringify(versionData, null, 2) | ||
| ); | ||
|
|
||
| console.log(`Fetched sentry-wizard version: ${version}`); | ||
| } catch (error) { | ||
| console.warn('Failed to fetch latest version, keeping existing version'); | ||
| } | ||
| } | ||
|
|
||
| fetchLatestVersion(); | ||
| ``` | ||
|
|
||
| ### Approach 2: Runtime Component | ||
| Create a React component that fetches the version dynamically: | ||
|
|
||
| ```typescript | ||
| // src/components/SentryWizardInstall.tsx | ||
| import { useEffect, useState } from 'react'; | ||
|
|
||
| export function SentryWizardInstall({ platform }: { platform: string }) { | ||
| const [version, setVersion] = useState('v5.1.0'); // fallback | ||
|
|
||
| useEffect(() => { | ||
| fetch('/api/sentry-wizard-version') | ||
| .then(res => res.json()) | ||
| .then(data => setVersion(data.version)) | ||
| .catch(() => console.warn('Failed to fetch version')); | ||
| }, []); | ||
|
|
||
| // Render installation commands with dynamic version | ||
| return ( | ||
| // ... code blocks with ${version} interpolation | ||
| ); | ||
| } | ||
| ``` | ||
|
|
||
| ### Approach 3: MDX Variable Replacement | ||
| Use MDX processing to replace version placeholders: | ||
|
|
||
| ```javascript | ||
| // In MDX processing pipeline | ||
| const sentryWizardVersion = await fetchLatestVersion(); | ||
| const processedContent = content.replace( | ||
| /\{\{SENTRY_WIZARD_VERSION\}\}/g, | ||
| sentryWizardVersion | ||
| ); | ||
| ``` | ||
|
|
||
| ### Integration Points | ||
| 1. **Build process**: Add version fetching to the build pipeline | ||
| 2. **CI/CD**: Cache GitHub API responses to avoid rate limits | ||
| 3. **Fallback**: Always have a recent known version as fallback | ||
| 4. **Consistency**: Apply to all platforms (Flutter, Android, React Native, etc.) | ||
|
|
||
| ### Implementation Priority | ||
| 1. **Phase 1**: ✅ Update hardcoded versions to latest (COMPLETED) | ||
| 2. **Phase 2**: Implement build-time version fetching | ||
| 3. **Phase 3**: Add runtime version checking for validation | ||
| 4. **Phase 4**: Automate version updates across all platforms | ||
|
|
||
| ## Files Updated | ||
| - `docs/platforms/dart/guides/flutter/index.mdx` - Updated to v5.1.0 | ||
| - `docs/platforms/android/index.mdx` - Updated to v5.1.0 | ||
|
|
||
| ## Benefits Achieved | ||
| - **Better Windows support**: No more forcing Windows users to use `brew` | ||
| - **Ecosystem alignment**: Flutter developers can avoid JavaScript tooling | ||
| - **Platform consistency**: All major OS/architecture combinations supported | ||
| - **Up-to-date tooling**: Using latest version instead of outdated v4.0.1 | ||
| - **Maintainability**: When dynamic fetching is implemented, versions will stay current automatically | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.