Skip to content

Conversation

jpmedley
Copy link
Contributor

@welcome
Copy link

welcome bot commented Jul 13, 2018

💖 Thanks for opening this pull request! 💖
Here is a list of things that will help get it across the finish line:

  • If this is a new or updated CSS interactive example, please ensure that you followed the CSS styleguide - If this is a new or updated JavaScript interactive example, please ensure that you followed the JavaScript styleguide - If your changes affects any of the steps in our contribution docs, please also make the relevant changes there.

@jpmedley
Copy link
Contributor Author

Is there anything I can do to move this forward?

@chrisdavidmills
Copy link
Contributor

@wbamberg — flagging this one.

@schalkneethling
Copy link

Hey @jpmedley Thanks for your pull request. Apologies for how long it has taken for someone to take a look at it. Couple of items

You will need to add the following entries to the meta.json file inside live-examples/js-examples/statement. This is so that the relevant pages for the examples are built:

...
"statementAsyncForIn": {
    "baseTmpl": "tmpl/live-js-tmpl.html",
    "exampleCode":
        "live-examples/js-examples/statement/statement-async-for-in.html",
    "fileName": "statement-asyncforin.html",
    "title": "JavaScript Demo: Statement - Async For In",
    "type": "js"
},
"statementAsyncFunctionAsterisk": {
    "baseTmpl": "tmpl/live-js-tmpl.html",
    "exampleCode":
        "live-examples/js-examples/statement/statement-async-function-asterisk.html",
    "fileName": "statement-asyncfunctionasterisk.html",
    "title": "JavaScript Demo: Statement - Async Function Asterisk",
    "type": "js"
},
...

The following the general file naming conventions, and specifically the one's in this folder. I would change the filenames to the following:

statement-async-for-in.html
statement-async-function-asterisk.html

With the above you can test these examples locally by running npm start from the terminal, and then pointing your browser at http://localhost:9090/pages/js/

For the for-in example specifically, I get the following output when running the example:

> "Regular iterator"
> [object Promise]
> [object Promise]
> [object Promise]
> "Async iterator"
> 0.7360924091
> 0.7858652753
> 0.5627363239

Perhaps that is the intended output? I would recommend adding a comment to each console.log that demonstrates the expected output to the end user. Thanks again for your contribution. o/\o

Copy link

@schalkneethling schalkneethling left a comment

Choose a reason for hiding this comment

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

See comment here #1036 (comment) with requested changes.

@jpmedley
Copy link
Contributor Author

jpmedley commented Aug 7, 2018

PTAL

@jpmedley
Copy link
Contributor Author

jpmedley commented Aug 7, 2018

Now PTAL.

Copy link

@schalkneethling schalkneethling left a comment

Choose a reason for hiding this comment

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

@jpmedley One small typo, other than that, this works great! Thanks! r+w/c

<code id="static-js" data-height="taller">async function* randomNumbers() {
const url = 'https://www.random.org/decimal-fractions/?num=1&dec=10&col=1&format=plain&rnd=new';

console.log("Print randomly generated numbers until reset is clicked the random number exceeds 0.95.");

Choose a reason for hiding this comment

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

Looks to be a small typo here:

"Print randomly generated numbers until reset is clicked the random number exceeds 0.95."

to

"Print randomly generated numbers until reset is clicked, (or) the random number exceeds 0.95."

Choose a reason for hiding this comment

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

@jpmedley No worries, let me fix that one, and merge. Thanks again for your contribution.

@schalkneethling schalkneethling merged commit f238746 into mdn:master Aug 8, 2018
@welcome
Copy link

welcome bot commented Aug 8, 2018

Congrats on merging your first pull request! 🎉🎉🎉

wbamberg pushed a commit to wbamberg/interactive-examples that referenced this pull request Aug 8, 2018
* upstream/master: (47 commits)
  Revert "Use semicolon in inlined perf code" (mdn#1105)
  chore(community): add @jpmedley as a contributor (mdn#1104)
  Add examples for async iterators and generators. (mdn#1036)
  Use semicolon in inlined perf code (mdn#1103)
  Add String concat, ends/startswith, padend/start live examples (mdn#1068)
  chore(deps): update dependency eslint to v5.3.0 (mdn#1094)
  chore(deps): update dependency all-contributors-cli to v5.4.0 (mdn#1089)
  Use CC0 images in <picture> example (mdn#1086)
  chore(deps): update dependency clean-css to v4.2.0 (mdn#1084)
  chore(deps): update dependency puppeteer to v1.6.2 (mdn#1083)
  Make variable names consistent (mdn#1090)
  adding lang global attribute interactive example (mdn#1056)
  Add some squarish-cropped versions of some of the images.
  Add CC0 sample images Assorted stock images, all CC0-licensed, for use by examples.
  chore(deps): update dependency jest to v23.4.2 (mdn#1064)
  chore(deps): update dependency prettier to v1.14.0 (mdn#1066)
  adding spellcheckglobal attribute interactive example (mdn#1057)
  adding tabindex global attribute interactive example (mdn#1060)
  adding title global attribute interactive example (mdn#1061)
  adding id global attribute interactive example (mdn#1055)
  ...
@jpmedley jpmedley deleted the asyncit branch January 14, 2019 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants