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

async ecosystem suggestion #4

Merged
merged 1 commit into from
Jan 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ <h2><code>async</code> syntax and blockers</h2>
<ul id="async-blockers"></ul>
<h3>Future extensions</h3>
<ul id="async-extensions"></ul>
<h2><code>async</code> ecosystem</h2>
<ul id="async-ecosystem"></ul>
<a class="github-ribbon" href="https://github.com/upsuper/areweasyncyet.rs">Fork me on GitHub</a>
</body>
</html>
34 changes: 26 additions & 8 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ const ASYNC_EXTENSIONS = [
},
];

const ASYNC_ECOSYSTEM = [
{
title: 'tokio',
repo: 'tokio-rs/tokio',
tracking: '804',
}
];

// The following code is modified from forge.rust-lang.org
const epochDate = new Date('2015-12-11');
const epochRelease = 5;
Expand All @@ -73,10 +81,11 @@ const betaMinorVersion = releases + epochRelease + 1;

fillList(ASYNC_BLOCKERS, 'async-blockers');
fillList(ASYNC_EXTENSIONS, 'async-extensions');
fillList(ASYNC_ECOSYSTEM, 'async-ecosystem');

function fillList(items, id) {
const $elem = document.getElementById(id);
for (const { title, rfc, tracking, stabilized, unresolved } of items) {
for (const { title, rfc, repo, tracking, stabilized, unresolved } of items) {
const $li = $c('li');
$elem.insertBefore($li, $elem.firstChild);
// Title
Expand Down Expand Up @@ -131,17 +140,26 @@ function fillList(items, id) {
if (rfc) {
$li.appendChild(rfcLink(rfc));
}
// Tracking issue link
if (tracking) {
if (!repo) {
$li.appendChild($c('a', {
className: 'tracking',
href: `https://github.com/rust-lang/rust/issues/${tracking}`,
textContent: `#${tracking}`,
title: 'Tracking issue',
}));
} else {
$li.appendChild($c('a', {
className: 'tracking',
href: `https://github.com/${repo}/issues/${tracking}`,
textContent: `${repo} #${tracking}`,
title: 'Tracking issue',
}));
}
// Tracking issue link
if (rfc) {
appendText(' / ');
}
$li.appendChild($c('a', {
className: 'tracking',
href: `https://github.com/rust-lang/rust/issues/${tracking}`,
textContent: `#${tracking}`,
title: 'Tracking issue',
}));
}
}
}
Expand Down