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

Migrate to ecmarkup #135

Merged
merged 2 commits into from
Feb 24, 2022
Merged

Migrate to ecmarkup #135

merged 2 commits into from
Feb 24, 2022

Conversation

Huxpro
Copy link
Contributor

@Huxpro Huxpro commented Feb 23, 2022

Summary

This is the first step to revamp this repo: ecmarkup is TC39's official tool for specifying syntax and semantics for ECMAScript. I proposed that we should adopt it because it has several favorabilities than the current approach (README.md + a gh-pages website living in the websitescript branch):

  1. The resultant index.html has a similar looks and feels with the official ECMA-262 spec.
  2. It uses Grammarkdown which is not only convenient to write but more importantly, can enforce the grammar to be more formal.
  3. It provides links to ECMA-262 out of the box (close Add links to ECMA-262 entities #112). Furthurmore, I can use <ins> to make "extension" points explicit.
  4. It can became the single source of truth and prevent from syncing issue between the README and website (close The syntax in website is missing JSXFragment as JSXChild #128)

One possible concern is that it makes this spec a bit like a ECMAScript proposal, but I think we mediate it by opting-out from the "stage-N proposal" heading, and by explicitly calling out our intention in the "Introduction" section.

In addition,

  • Parser and Transpiler implementation section is not took over.
  • Facebook, Inc. is updated to Meta Platform, Inc.

Once this is merged, we can switch to main to host Github Pages.

Test Plan

open index.html

This is the first step to revamp this repo: [ecmarkup](https://github.com/tc39/ecmarkup)
is TC39's official tool for specifying syntax and semantics for ECMAScript.
I proposed that we should adopt it because it has several favorabilities
than the current approach (`README.md` + a `gh-pages` website living in
the `websitescript` branch):
1. The resultant `index.html` has a similar looks and feels with the
   official ECMA-262 spec.
2. It uses [Grammarkdown](https://github.com/rbuckton/grammarkdown)
   which is not only convenient to write but more importantly, can
   enforce the grammar to be more formal.
3. It provides links to ECMA-262 out of the box (closed facebook#112).
   Furthurmore, I can use `<ins>` to make "extension" points explicit.

One possible concern it that it'll make this too like a ECMAScript proposal,
but I think we mediated by opting-out from the "stage-N proposal"
heading, and by explicitly calling out our intention in the
"Introduction" section.

In addition,
- Link to JXON is updated since the original link no more existed.
- Parser and Transpiler section is dropped from the "spec" website.
- Facebook, Inc. is updated to Meta Platform, Inc everywhere.

Once this is merged, we can switch to `main` to host Github Pages.
Comment on lines +71 to +73
<emu-note>
names of |JSXOpeningElement| and |JSXClosingElement| should match.
</emu-note>
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe more formal?

<emu-clause>
    <h1>Static Semantics: Early Errors</h1>
    <emu-grammar>JSXOpeningElement JSXChildren? JSXClosingElement</emu-grammar>
    <ul>
        <li>It is a Syntax Error if the JSXElementName of |JSXOpeningElement| does not have the same source text to JSXElementName of |JSXClosingElement|.</li>
    </ul>
</emu-clause>

Copy link
Contributor Author

@Huxpro Huxpro Feb 23, 2022

Choose a reason for hiding this comment

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

Yup I've been thinking of that, but wanted to see if people like this direction first.

Being able to conveniently use other ECMA-262 specification devices is definitely why this change is appealing. There are probably more static semantics hidden from implementations other than this alone.

Thanks for the review! PRs are welcomed once this is merged 😉

@Huxpro Huxpro marked this pull request as ready for review February 23, 2022 19:12
@Huxpro Huxpro merged commit 148bf2a into facebook:main Feb 24, 2022
@Huxpro
Copy link
Contributor Author

Huxpro commented Feb 24, 2022

Hey @Jack-Works this has been merged. Would you be interested in submitting a PR for the Early Errors? You may use the "Editorial" tag for that.

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.

The syntax in website is missing JSXFragment as JSXChild Add links to ECMA-262 entities
3 participants