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

Idea: Make merged/landed proposals redirect to corresponding parts of the ES current draft #360

Open
sideshowbarker opened this issue Jun 10, 2021 · 7 comments

Comments

@sideshowbarker
Copy link

sideshowbarker commented Jun 10, 2021

After a proposal has gone through all the stages and gets merged into the spec, change the body start tag in the HTML source of the proposal to this:

<body onload='(function() { if (location.hash) { location.href = "https://tc39.es/ecma262/" + location.hash; }})()'>

…or better yet — now that there’s a multipage version:

<body onload='(function() { if (location.hash) { location.href = "https://tc39.es/ecma262/multipage/" + location.hash; }})()'>

In other words, make the proposal document redirect to the corresponding fragment of the current ES draft.

That way, any existing links anywhere to the proposal that have fragment parts will get redirected to the corresponding anchors in the current ES draft (while fragment-less links to the proposal itself won’t get redirected).

For example, https://tc39.es/proposal-class-fields/#prod-PrivateIdentifier would redirect to https://tc39.es/ecma262/#prod-PrivateIdentifier — or preferably, to https://tc39.es/ecma262/multipage/ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier.

This would work because y’all seem to have a policy/practice/convention of all id attributes in the proposal source being preserved as-is when you merge them into the ES spec source.

@bakkot
Copy link
Contributor

bakkot commented Jun 10, 2021

There's not usually a single fragment of the ES spec to which a given proposal corresponds - most proposals touch parts across many sections.

@sideshowbarker
Copy link
Author

There's not usually a single fragment of the ES spec to which a given proposal corresponds - most proposals touch parts across many sections.

Yes, I understand that. What my suggestion would cause is that all the fragment IDs for all parts of the proposal would redirect to the exact same fragment IDs in the current ES draft.

For example, https://tc39.es/proposal-class-fields/#prod-PrivateIdentifier would redirect to https://tc39.es/ecma262/#prod-PrivateIdentifier — or preferably, to https://tc39.es/ecma262/multipage/ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier.

This would work because y’all seem to have a policy/practice/convention of all id attributes in the proposal source being preserved as-is when you merge them into the ES spec source.

(I’ve edited/updated the issue description to include the info from this comment.)

@mpcsh
Copy link
Member

mpcsh commented Jun 10, 2021

personally, I get a lot of value from the diff view on the proposal pages - I wouldn't want to see that go away. for example, if someone links me to the PrivateIdentifier section that you've been using as an example, I really like seeing what additions were made by the proposal. I think it's important to keep that functionality around even after a proposal lands.

@ljharb
Copy link
Member

ljharb commented Jun 10, 2021

(separately, the single-page, not the multi page, version of the spec is the canonical one and ideally everyone external only links to the single-page version)

@bakkot
Copy link
Contributor

bakkot commented Jun 10, 2021

(separately, the single-page, not the multi page, version of the spec is the canonical one and ideally everyone external only links to the single-page version)

It's true that the single-page version is canonical, but I disagree strongly with the claim that this implies everyone ought to link to it. The two documents have the same content, by construction, and the multi-page one is friendlier for many users.

@sideshowbarker
Copy link
Author

sideshowbarker commented Jun 10, 2021

(separately, the single-page, not the multi page, version of the spec is the canonical one and ideally everyone external only links to the single-page version)

In places such as https://github.com/w3c/browser-specs/blob/master/specs.json#L67 and https://github.com/tobie/specref/blob/main/refs/biblio.json#L1098, we’re now very intentionally referencing the multipage ES spec rather than the single-page.

And for MDN, we’re following a policy of only linking to the multipage version — just as for links to the HTML spec, we have a policy of only linking to the similar multipage version of that.

In the cases of both specs, the primary reason for linking to the multipage versions is better user experience:

  • The published single-page HTML spec is 11MB, and loads slowly even for users with a relatively high-bandwidth connection — let alone for users on lower-bandwidth connections. The multipage sections load much more quickly.

  • The published single-page ES spec is 5.8MB but has a similar issue with not loading nearly as quickly for users as the multipage sections do.

I suspect you’d likely not have great success getting third-party sites to avoid linking to the multipage version.

@ljharb
Copy link
Member

ljharb commented Jun 11, 2021

@sideshowbarker thats not my experience outside of chrome, which has a particularly poor experience for the single-page version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@ljharb @sideshowbarker @bakkot @mpcsh and others