-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add DartPad to flutter.dev #2938
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@legalcodes, I think this looks good, but has it been reviewed by @maguinis, @timsneath, and the UX folk?
I wonder if we should include a "Try Flutter" link higher up in the front page. I'm not sure how many ppl scroll down to the bottom. It would be easy to miss that DartPad instance. I also like injecting it into the Install page, but I think it needs to be higher up in the page. It would be easy to miss in the TOC, and it would be equally easy to select a platform and proceed to the next steps without noticing DartPad. I'm wondering if we should add a new step 1: Try Flutter, and then step 2: Install. OR, another suggestion is we replace the big blue "Get started" button at the top right of every page with "Try Flutter". And then the Try Flutter page leads to install.
Just some ideas.
|
This has my approval - I sat next to Jon yesterday as we made these
changes. I proposed adding it to the Install page since that is where our
"Get Started" buttons all lead to and hence it is the path that devs
wanting to try Flutter take. I found this to be a cleaner option than to
add 'Try Flutter' since that could be confused with 'Get Started' (unless
we changed 'Get Started' to 'Download'.
One thing I did mention is that having DartPad on bottom of homepage and
Install page could help us A/B test and if we feel more users are using the
Homepage version then we can alter buttons to point to that one.
Also, since the current time on the install page is very short, it will be
a good measure to see how much longer on average users spend on that page
when we implement DartPad there.
Martin Aguinis | Developer Marketing | Flutter
…On Tue, Aug 27, 2019 at 12:24 AM Shams Zakhour (ignore Sfshaza) < ***@***.***> wrote:
***@***.**** commented on this pull request.
@legalcodes <https://github.com/legalcodes>, I think this looks good, but
has it been reviewed by @maguinis <https://github.com/maguinis>,
@timsneath <https://github.com/timsneath>, and the UX folk?
I wonder if we should include a "Try Flutter" link higher up in the front
page. I'm not sure how many ppl scroll down to the bottom. It would be easy
to miss that DartPad instance. I also like injecting it into the Install
page, but I think it needs to be higher up in the page. It would be easy to
miss in the TOC, and it would be equally easy to select a platform and
proceed to the next steps. I'm wondering if we should add a new step 1: Try
Flutter, and then step 2: Install. OR, another suggestion is we replace the
big blue "Get started" button at the top right of every page with "Try
Flutter". And then the Try Flutter page and lead to install.
Just some ideas.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2938?email_source=notifications&email_token=ACFSNXQWSRCZLCULN24F63LQGTJC7A5CNFSM4IPZTIQ2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCCYHOJQ#pullrequestreview-280000294>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACFSNXSMZB6SWX4RQMSDA7TQGTJC7ANCNFSM4IPZTIQQ>
.
|
|
@maguinis, glad to hear. I was suggesting that we rename the "Get started" button to "Try Flutter", but we could also add a second button that says "Try Flutter" and rename "Get started" to "Install". Years ago @sethladd hammered out my preference for "Download" in favor of "Install" (you probably heard me kicking and screaming). Have we gone back to preferring "Download"? When you say, A/B testing, how do you mean? Are you suggesting that we do actual A/B testing, or do you mean that it's kind of like an A/B test by having it on both pages? I really think that "Try Flutter" should be a big blue button on every page. What do the UX folk say? |
johnpryan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall - thanks Jon! My main concern is around including samples that are affected by dart-lang/dart-pad#1223 initially. Maybe we can leave those out for now.
| // Snippet('Strings', strings), | ||
| // Snippet('Collection literals', collectionLiterals), | ||
| // Snippet('Classes', classes), | ||
| // Snippet('Compute Pi', piMonteCarlo), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: commented out code
src/_assets/css/_base.scss
Outdated
| $dash-dartpad-border: #293542; | ||
| $dash-callout: #121a26; | ||
| $dash-off-white: #f8f9fa; | ||
| $dash-dartpad-border: #293542; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this variable is defined twice
src/_assets/css/_base.scss
Outdated
| @@ -1,3 +1,55 @@ | |||
|
|
|||
| $dash-dartpad-border: #293542; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: Maybe this should be (0, 0, 0, 0.125); to match the card border?
| var select = querySelector('#dartpad-select'); | ||
|
|
||
| var snippets = [ | ||
| Snippet('Counter', counter), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only concern with this and the todo examples is that they require Chrome 77 to work well ( dart-lang/dart-pad#1223).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I think that just before or after the first DartPad instance, there should be a warning about the version of Chrome that you need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, as discussed we'll:
- Wait until 77
- add a warning about the Chrome version
| Widget build(BuildContext context) { | ||
| return Container( | ||
| height: 50, | ||
| width: 400, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: the width doesn't need to be set
| border: OutlineInputBorder(), | ||
| labelText: labelText, | ||
| hintText: hintText), | ||
| )); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: put a comma between these to and re-format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch:
return Container(
height: 50,
margin: const EdgeInsets.all(20.0),
child: TextField(
obscureText: false,
decoration: InputDecoration(
icon: Icon(icon),
border: OutlineInputBorder(),
labelText: labelText,
hintText: hintText),
)
);
(without adding a comma, right?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding a comma will tell the formatter to format it like this:
Widget build(BuildContext context) {
return Container(
height: 50,
width: 400,
margin: const EdgeInsets.all(20.0),
child: TextField(
obscureText: false,
decoration: InputDecoration(
icon: Icon(icon),
border: OutlineInputBorder(),
labelText: labelText,
hintText: hintText),
),
);
which I think is a best-practice for readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Thanks for the tip
| ''' | ||
| .trim(); | ||
|
|
||
| var strings = ''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's take out the samples that aren't being used - they can be added back in if needed.
| import 'package:dartpad_picker/dartpad_picker.dart'; | ||
|
|
||
| void main() { | ||
| if (isMobile()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be extended to detect Safari as well due to https://bugs.webkit.org/show_bug.cgi?id=199866.
This is the check we're doing in dart-pad:
if (window.navigator.vendor.contains('Apple') &&
!window.navigator.userAgent.contains('CriOS') &&
!window.navigator.userAgent.contains('FxiOS')) {
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this also needs to be changed on site-www dart-lang/site-www#1854
| class SpinningSquare extends StatefulWidget { | ||
| @override | ||
| _SpinningSquareState createState() => new _SpinningSquareState(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: new isn't required anymore
| width: 150.0, | ||
| height: 150.0, | ||
| color: const Color(0xFF00FF00), | ||
| )); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also need a comma here
|
Some other suggestions, after a in-person discussion with Kathy and Jon:
|
|
Talked to @legalcodes offline. Recommend to divide this into several PRs/issues
Detailed feedback about Dartpad on the landing page
|
- Reframe the installation page as the very first step of get started (aka try/install) - Put the embedded Dartpad above the installation buttons and change the page title. - Update title in left nav
sfshaza2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
LGTM from Marketing. Let's ship! |
| var select = querySelector('#dartpad-select'); | ||
|
|
||
| var snippets = [ | ||
| Snippet('Spinning flutter', spinning_logo), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "Flutter"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
I think the last I saw about this PR, Jon was suggesting that we back out changes to the Install page and only update the home page, by adding DP, with no pointers, to the bottom of the page. It doesn't feel like there's much point to the PR if that's all it does. We would track how many people find the DP instance at the bottom of the page, and that's it. Thoughts? |
|
@sfshaza2 Thank you for your thoughts! The original goal of this PR was to do just that -- add DartPad to the homepage as a standalone PR. The proposal to add DartPad to the install page came as a later addition, and we have had extensive discussion about the benefits of modifying the install page in a separate PR from this one @galeyang @redbrogdon please feel free to chime in! Of the ~550 lines of code in this PR, only ~30 pertain to modifying |
|
LGTM! Ship it! (I'll let you merge it.) |
| .flutter-plugins | ||
| .packages | ||
| .dart_tool | ||
| # pubspec.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @legalcodes @johnpryan et all. Why was it decided that we'd start committing the pubspec.lock files contained in the repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey all, I created a fresh issue to discuss this (#3107) rather than only having a comment in an old PR. (Sorry for the email notification noise.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oups, my bad, I wasn't looking at this edit carefully: you just deleted a commented out line! I'm the one who commented it out in #1237 last year. I didn't realize that it had been that long. I thought that it was a change that had been done in the last 6 months or so. Apologies!
FYI, I'll still go ahead a remove the pubspec.lock files.
| <i class="fas fa-exclamation-triangle"></i> **Warning:** | ||
| end: </aside> | ||
|
|
||
| custom: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably drop this custom field/tag at some point.
Last staged 9/26/19:
https://jt-flutter-website-3.firebaseapp.com (Scroll all the way to the bottom)