core-js icon indicating copy to clipboard operation
core-js copied to clipboard

docs: rebuild with Vuepress v2

Open DreamOfIce opened this issue 1 year ago • 46 comments

The documentation site is still under construction and contributions are welcome 😃 Site preview: https://corejs-doc.netlify.app

This pull request will move from draft to ready when all of the following todos are completed:

  • [x] Complete the basic layout
  • [x] Porting compatibility page
  • [x] Splitting and optimising the user guide (reuse https://github.com/zloirock/core-js/pull/1095 )
  • [x] Splitting and optimising contributions guide
  • [x] Convert types into TypeScript
  • [x] Update the links to the documentation in the project
  • [x] Complete i18n system
  • [x] Chinese translation

close #1053 #1064 #1095

DreamOfIce avatar Mar 04 '23 17:03 DreamOfIce

One note about the compatibility page: unlike the site, it should work in IE9+ to allow testing those engines, but with Vuepress it does not work in IE. It makes sense to add it to this site, however, for testing, it's required to save the current simple table that works everywhere.

zloirock avatar Mar 04 '23 22:03 zloirock

Can't we just use the version in tests/compat/?

DreamOfIce avatar Mar 05 '23 08:03 DreamOfIce

It's not built and not published on gh-pages, so you should clone the repo, install dependencies, build it, and if you wanna test not a browser locally installed on your computer, upload it to the hosting or VM where you wanna test it - it's not a trivial task for users who wanna check the compatibility of the browser.

zloirock avatar Mar 05 '23 11:03 zloirock

It's not built and not published on gh-pages, so you should clone the repo, install dependencies, build it, and if you wanna test not a browser locally installed on your computer, upload it to the hosting or VM where you wanna test it - it's not a trivial task for users who wanna check the compatibility of the browser.

The browser-runner.js in tests/compat should work in IE8, right? I'm going to add it with <script nomodule> to use as a fallback

DreamOfIce avatar Mar 05 '23 13:03 DreamOfIce

One note about the compatibility page: unlike the site, it should work in IE9+ to allow testing those engines, but with Vuepress it does not work in IE. It makes sense to add it to this site, however, for testing, it's required to save the current simple table that works everywhere.

It should work with IE now

DreamOfIce avatar Mar 05 '23 16:03 DreamOfIce

@zloirock Can you help me test the current compat page in IE8~10? I don't have a test environment.

DreamOfIce avatar Mar 06 '23 16:03 DreamOfIce

@DreamOfIce you could use https://ieonchrome.com/ as the simplest way or Sauce Labs / BrowserStack. I'll check it a little later.

zloirock avatar Mar 06 '23 16:03 zloirock

I've merged and formatted all of @Rudxain ‘s contributions, and the feature section is almost complete. @zloirock Could you review it to check if there are errors?

DreamOfIce avatar Mar 07 '23 10:03 DreamOfIce

BTW, does core-js has a domain name? Using subdomain.netlify.app in a production environment doesn't seem good

DreamOfIce avatar Mar 07 '23 16:03 DreamOfIce

Initially, I wanted to use just core-js.zloirock.ru - that also doesn't seem good, so most likely I'll buy a new 2LD for that - I'm looking for the best option.

zloirock avatar Mar 07 '23 19:03 zloirock

If we don't know which one to choose for now, maybe we can apply for a js.org subdomain first (like core.js.org?)

DreamOfIce avatar Mar 08 '23 02:03 DreamOfIce

@zloirock Is the domain name confirmed? The document is basically done, it's time to change the link to the document

DreamOfIce avatar Mar 09 '23 16:03 DreamOfIce

Glancing over the preview, I noticed that the section for DOMException has a trailing colon, i.e. it looks like DOMException:.

ehoogeveen-medweb avatar Mar 09 '23 20:03 ehoogeveen-medweb

I'm not sure that it's required to add all images to the repo, current links to githubusercontent could be enough, need to think.

zloirock avatar Mar 09 '23 20:03 zloirock

Something recently added to the README just missed. For example, https://github.com/zloirock/core-js/blob/master/ORIGINAL_README.md#jsonparse-source-text-access

zloirock avatar Mar 09 '23 20:03 zloirock

Compat table somehow works in IE, but...

image

image

zloirock avatar Mar 09 '23 21:03 zloirock

That's great work, thanks! A little later, I will review this in more detail.

zloirock avatar Mar 09 '23 21:03 zloirock

I'm not sure that it's required to add all images to the repo, current links to githubusercontent could be enough, need to think.

Because user-images.githubusercontent.com is intermittently blocked in China, even if it is accessible, it is very slow (e.g. https://user-images.githubusercontent.com/2213682/146607186-8e13ddef-26a4-4ebf-befd-5aac9d77c090.png can take tens of seconds)

DreamOfIce avatar Mar 10 '23 06:03 DreamOfIce

I am considering using jpg/webp format instead of png to reduce the size

DreamOfIce avatar Mar 10 '23 06:03 DreamOfIce

Glancing over the preview, I noticed that the section for DOMException has a trailing colon, i.e. it looks like DOMException:.

Thanks for the feedback, it has been fixed

DreamOfIce avatar Mar 10 '23 06:03 DreamOfIce

Compat table somehow works in IE, but...

image

image

Yes, I only wrote a script for nomodule and did not polyfill the style I'll look into it later

DreamOfIce avatar Mar 10 '23 06:03 DreamOfIce

@zloirock Also, is there an SVG version of the core-js logo?

DreamOfIce avatar Mar 10 '23 06:03 DreamOfIce

@DreamOfIce I'll take a look.

zloirock avatar Mar 10 '23 06:03 zloirock

It looks like type annotations are not standard typescript. let's add the conversion to the todo

DreamOfIce avatar Mar 11 '23 17:03 DreamOfIce

@zloirock The documentation is almost done, how is the domain name?

DreamOfIce avatar Mar 14 '23 16:03 DreamOfIce

image logo can hardly be seen in dark mode

stydxm avatar Mar 16 '23 15:03 stydxm

logo can hardly be seen in dark mode

I think I can fix it. I'll add a ~grey~ white background (it already has a thin white outline). This would be just a temporary patch. The proper way to do it, is to detect color-scheme, and swap logos appropriately (or use an SVG that does that media query)

Rudxain avatar Mar 18 '23 19:03 Rudxain

@zloirock Any progress on the domain name yet?

DreamOfIce avatar Mar 27 '23 01:03 DreamOfIce

All types have been converted to TypeScript and verified

DreamOfIce avatar Mar 31 '23 15:03 DreamOfIce

Thanks to @stydxm for completing the Chinese translation 😄

DreamOfIce avatar Apr 01 '23 14:04 DreamOfIce