ReSpec's website and RESTful API
w3c / respec-web-services Goto Github PK
View Code? Open in Web Editor NEWReSpec's website and RESTful APIs
Home Page: https://respec.org/
ReSpec's website and RESTful APIs
Home Page: https://respec.org/
ReSpec's website and RESTful API
express deprecated res.redirect(url, status)
. Use res.redirect(status, url)
.
@msporny pointed out that the docs were missing a link (or the actual) developer guide...
We can probably just include it directly.
A few issues with auto-complete on the client...
CodeByDefault
wit the type and what spec a term declared in, etc. directly in the autocomplete).We should allow the server to stream autocomplete results.
What happened (e.g., it crashed)?:
Given:
<section id="abstract" data-cite="dom">
<p>[=elements=] [=attributes=]</p>
</section>
Expected behavior (e.g., it shouldn't crash):
Expected xref to work on those, as they are just concepts.
My issue paragraphs pull in old labels and text instead of the updated labels and content, when I update my issues on github, see here https://dcat-ap-ch-def.clients.liip.ch/releases/2.0/dcat-ap-ch.html#issue-summary
Issue Nr,19 gets the wrong label. Can that be changed?
Maybe use morgan
Is your feature request related to a problem? Please describe.
TAG and AB are authorized to publish in /TR.
Describe the solution you'd like
One should be able to specify one of
group: "ab"
group: "other/ab"
group: "tag"
group: "other/tag"
For that, the following links would need to work:
https://respec.org/w3c/groups/ab
https://respec.org/w3c/groups/ab/other
https://respec.org/w3c/groups/tag
https://respec.org/w3c/groups/tag/other
Note that
https://respec.org/w3c/groups/tag
but returns the wrong type (should be 'other', and not 'misc')
Describe alternatives you've considered
Not supporting the following forms could be considered:
group: "other/ab"
group: "other/tag"
https://respec.org/w3c/groups/ab/other
https://respec.org/w3c/groups/tag/other
but it would be impossible to disambiguate if a CG adopts 'tag' or 'ab' for their shortname.
Can you or your organization fund the work or help with development?
Sure
Additional context
Process 2021 deployment.
Add a promise queue, which ensures the the exec
calls in /xref/update
are run in series of request, and not simultaneously (to prevent race conditions and data corruption and reduce server load)
When searching, we should return return things marked as "task-source"
Same with permission
Create a GitHub action to run every 5 min or so to check the status of respec.org and send a message on Slack if server is down. Earlier, we were using webtask.io, but it's deprecated.
Code from webtask lambda function:
const fetch = require("node-fetch");
const { URL } = require("url");
const BASE = "https://respec.org/";
/**
* @param context {WebtaskContext}
*/
module.exports = async (context, cb) => {
const urls = ["/xref/meta/version", "/xref"];
const results = await Promise.all(urls.map(test));
if (results.some(result => !result.ok)) {
await postToSlack(context.secrets.slack_webhook_url, results);
cb(null, 'not cool');
} else {
cb(null, 'ok');
}
};
async function test(pathname) {
const url = new URL(pathname, BASE);
url.searchParams.append("healthcheck", true);
const { ok, status } = await fetch(url, { method: "HEAD" });
return { pathname, ok, status, };
}
async function postToSlack(url, results) {
const body = {
text: results.map(e => `${e.ok ? '๐ข' : '๐ด'} HEAD ${e.status} ${new URL(e.pathname, BASE)}`).join("\n")
};
await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(body)
});
}
It would be nice to allow, for instance:
"show me the enum values for the X spec" without needing to put in a search term.
Likewise, it would be nice to retrieve by type... e.g., "show me 'permissions' for all specs"
RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: undefined
at ServerResponse.writeHead (_http_server.js:249:11)
at ServerResponse.writeHead (/home/dh_ie5g4j/respec.org/node_modules/on-headers/index.js:44:26)
at ServerResponse.writeHead (/home/dh_ie5g4j/respec.org/node_modules/on-headers/index.js:44:26)
at ServerResponse.writeHead (/home/dh_ie5g4j/respec.org/node_modules/on-headers/index.js:44:26)
at ServerResponse._implicitHeader (_http_server.js:240:8)
at ServerResponse.end (/home/dh_ie5g4j/respec.org/node_modules/compression/index.js:103:14)
at ServerResponse.send (/home/dh_ie5g4j/respec.org/node_modules/express/lib/response.js:221:10)
at route (/home/dh_ie5g4j/respec.org/routes/w3c/group.js:65:28)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at:
res.json(groupInfo);
} catch (error) {
const { statusCode, message } = error;
res.set("Content-Type", "text/plain");
>> res.status(statusCode).send(message);
}
};
The "how to cite" shouldn't have spaces for the micro syntax... as it makes a mess when tidy is run.
The following entry for "external now visible algorithm" is not showing up in xref for some reason:
Running on a new device is overwhelming. We should:
mkdir -p
related issuesupdate-data-sources
work properly (no need to run w3c update script separately)/docs/
on first start alsoNeed to add to express, so automatically upgrades connection to tls
Also improve language for multi-status ('yd'
/ 'ad'
) titles.
We can cache the preflight requests with cors({ maxAge })
.
What happened (e.g., it crashed)?:
The i18n WG is chartered under the Patent Policy 2020, but ReSpec generates the Patent Policy 2017 link, which blocks the publication of the spec:
This document was produced by a group operating under the 1 August 2017 W3C Patent Policy.
Expected behavior (e.g., it shouldn't crash):
It should use PP 2020.
Optional, steps to reproduce:
Should I add the wgPatentPolicy configuration option to the spec?
Terms like link type "manifest"
are used often, but they're not exported (Shepherd data allowed them, but reffy correctly doesn't). This cases some xref errors. We should add a way to support some exceptions to the current scraper rules.
Was failing:
https://github.com/marcoscaceres/respec.org/actions/runs/103077881
So was getting emails every 5 mins
We should look at using a weighted trie for the searches based on most commonly searched for...
As a bonus, we could show the most popular searches :) .... or the "term of the day" of the day ๐น
npm run fails crashes if data
dir is missing. We should create it if not there.
Need to add all community groups to w3c/groups.json and also add a distinction between WGs and CGs in API response so it can be used for https://github.com/w3c/respec/issues/3017
TypeError: Cannot read property 'padStart' of undefined
at formatter (/home/dh_ie5g4j/respec.org/utils/logging.js:76:27)
at Array.logRequest (/home/dh_ie5g4j/respec.org/node_modules/morgan/index.js:122:18)
at listener (/home/dh_ie5g4j/respec.org/node_modules/on-finished/index.js:169:15)
at onFinish (/home/dh_ie5g4j/respec.org/node_modules/on-finished/index.js:100:5)
at callback (/home/dh_ie5g4j/respec.org/node_modules/ee-first/index.js:55:10)
at Socket.onevent (/home/dh_ie5g4j/respec.org/node_modules/ee-first/index.js:93:5)
at Socket.emit (events.js:327:22)
at TCP. (net.js:670:12)
At:
const unknown = chalk.dim.gray("-");
return [
chalk.gray(date),
>> chalk.gray(remoteAddr.padStart(15)),
request,
referrer ? formattedReferrer : unknown,
contentLength ? chalk.cyan(prettyBytes(contentLength)) : unknown,
chalk.cyan(responseTime + " ms"),
Throws:
[Error] Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'specs.length')
getFormData (script.js:91)
(anonymous function) (script.js:98)
asyncFunctionResume
handleSubmit (script.js:97)
(anonymous function) (script.js:183)
https://respec.org/w3c/groups/webrtc says the WebRTC WG is under PP2017, but it was switched to PP2020 last Friday. The data returned by the W3C API is uptodate - not sure what needs to be put in motion to update the respec data.
For example, <link rel=manifest>
is exported from html, and should be citable as [^link/rel/manifest^]
.
Similarly, we want:
[^html-global/role/button^]
I need to check this in more detail, but see:
https://respec.org/xref/?term=TypeError
And:
https://respec.org/xref/?term=SyntaxError
DOMExceptions
can be a "SyntaxError", but ECMAScript define {{ SyntaxError }} as an object too.
Caniuse data contains entries like 11.3-11.4
which when grouped with same-support entries appear like 11.3-11.4-13.4-13.7
. We should split 11.3-11.4
entries into 11.3, 11.4
in the scraper, so the end-result becomes:
- 11.3-11.4-13.4-13.7
+ 11.3-13.7
We should add robot.txt:
User-agent: *
Disallow: /
Here are some active CGs that might be useful to add to w3c/groups:
We should also figure out the name convention for the WG-CG groups like:
WebRef switched to using "main" as its primary branch, so service not longer updating.
In my work towards facilitating transition to Process 2020 in w3c/respec#3086, I'm proposing to add a new configuration option wgPatentPolicy
that determines whether a group is operating under Patent Policy 2017 or the newly approved Patent Policy 2020.
Ideally, that information would be determined automatically for specs where the group info is retrieved from the W3C API. It is exposed in the route https://api.w3.org/groups/<id>/charters
(when embed is set to true) on the last charter, as a property named "patent-policy".
So it would be great if the respec.org cache could expose that value so that the configuration option in ReSpec be determined automatically.
Looks like req.headers
can sometimes be missing at:
TypeError: Cannot read property 'includes' of undefined
at route (/home/dh_ie5g4j/respec.org/routes/w3c/group.js:43:28)
at Layer.handle [as handle_request] (/home/dh_ie5g4j/respec.org/node_modules/express/lib/router/layer.js:95:5)
at next (/home/dh_ie5g4j/respec.org/node_modules/express/lib/router/route.js:137:13)
at cors (/home/dh_ie5g4j/respec.org/node_modules/cors/lib/index.js:188:7)
at /home/dh_ie5g4j/respec.org/node_modules/cors/lib/index.js:224:17
at originCallback (/home/dh_ie5g4j/respec.org/node_modules/cors/lib/index.js:214:15)
at /home/dh_ie5g4j/respec.org/node_modules/cors/lib/index.js:219:13
at optionsCallback (/home/dh_ie5g4j/respec.org/node_modules/cors/lib/index.js:199:9)
at corsMiddleware (/home/dh_ie5g4j/respec.org/node_modules/cors/lib/index.js:204:7)
at Layer.handle [as handle_request] (/home/dh_ie5g4j/respec.org/node_modules/express/lib/router/layer.js:95:5)
PaymentAddress.postalCode
shows up as a suggestion in xref, thus implying that xref has its its definition. @sidvishnoi confirms that xref has the correct definition.
PaymentAddress.postalCode
in the Terms, concept, or WebIDL
field on xref locates the correct spec and shows the result.PaymentAddress.postalCode
in the Terms, concept, or WebIDL
field on xref does not locate any specs and shows No results found.
postalCode
in the Terms, concept, or WebIDL
field, PaymentAddress
in the for
field and check the Advanced Search
box.@sidvishnoi confirms that this is because the standard search UI only finds terms without .
. Ideally, if a term shows up as suggested on xref, one should be able to click it and get the result as normal.
Thank you for helping me debug this, Sid!
ReSpec makes use of specref for spec URLs, while xref-ui uses data from webref, adding confusion.
The "spec id" field in search results should show the one available in specref, or specref should be updated to ensure consistency.
e.g. HAVE_METADATA isn't exposed in xref, despite the definition in the HTML spec being correctly identified as public in webref; I havent' done a thorough check, but it looks like none of the IDL constants are exposed.
see also w3c/mediacapture-main#792 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.