Skip to content

Commit 89838b6

Browse files
committed
Website
1 parent 64c780f commit 89838b6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+8044
-1
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
* text eol=lf
2+
3+
*.png binary
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build web pages for branch
2+
3+
on:
4+
push:
5+
branches:
6+
- web-3
7+
workflow_dispatch:
8+
9+
jobs:
10+
run-on-server:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Extract branch name
15+
shell: bash
16+
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
17+
id: extract_branch
18+
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
with:
22+
ref: ${{ steps.extract_branch.outputs.branch }}
23+
24+
- name: Copy runner file to remote server
25+
uses: garygrossgarten/github-action-scp@0.9.0
26+
with:
27+
local: website/scripts/runner.mjs
28+
remote: /var/www/core-js/runner.mjs
29+
host: ${{ secrets.REMOTE_HOST }}
30+
username: ci
31+
privateKey: ${{ secrets.CI_SSH_KEY }}
32+
33+
- name: Copy runner wrapper file to remote server
34+
uses: garygrossgarten/github-action-scp@0.9.0
35+
with:
36+
local: website/scripts/runner.sh
37+
remote: /var/www/core-js/runner.sh
38+
host: ${{ secrets.REMOTE_HOST }}
39+
username: ci
40+
privateKey: ${{ secrets.CI_SSH_KEY }}
41+
42+
- name: Setup SSH
43+
uses: webfactory/ssh-agent@v0.9.1
44+
with:
45+
ssh-private-key: ${{ secrets.CI_SSH_KEY }}
46+
47+
- name: Make runner.sh executable on remote
48+
run: |
49+
ssh -o StrictHostKeyChecking=no ci@${{ secrets.REMOTE_HOST }} "chmod +x /var/www/core-js/runner.sh"
50+
51+
- name: Run node runner.mjs on remote server
52+
run: |
53+
ssh -o StrictHostKeyChecking=no ci@${{ secrets.REMOTE_HOST }} "cd /var/www/core-js/ && ./runner.sh"
54+
55+
- name: Run node runner.mjs on remote server
56+
run: |
57+
ssh -o StrictHostKeyChecking=no ci@${{ secrets.REMOTE_HOST }} "cd /var/www/core-js/ && ./runner.sh ${{ steps.extract_branch.outputs.branch }}"

.github/workflows/build-web.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build web pages
2+
3+
on:
4+
push:
5+
branches:
6+
- web-3-not-exists
7+
workflow_dispatch:
8+
9+
jobs:
10+
run-on-server:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Extract branch name
15+
shell: bash
16+
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
17+
id: extract_branch
18+
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
with:
22+
ref: ${{ steps.extract_branch.outputs.branch }}
23+
24+
- name: Copy runner file to remote server
25+
uses: garygrossgarten/github-action-scp@0.9.0
26+
with:
27+
local: website/scripts/runner.mjs
28+
remote: /var/www/core-js/runner.mjs
29+
host: ${{ secrets.REMOTE_HOST }}
30+
username: ci
31+
privateKey: ${{ secrets.CI_SSH_KEY }}
32+
33+
- name: Copy runner wrapper file to remote server
34+
uses: garygrossgarten/github-action-scp@0.9.0
35+
with:
36+
local: website/scripts/runner.sh
37+
remote: /var/www/core-js/runner.sh
38+
host: ${{ secrets.REMOTE_HOST }}
39+
username: ci
40+
privateKey: ${{ secrets.CI_SSH_KEY }}
41+
42+
- name: Setup SSH
43+
uses: webfactory/ssh-agent@v0.9.1
44+
with:
45+
ssh-private-key: ${{ secrets.CI_SSH_KEY }}
46+
47+
- name: Make runner.sh executable on remote
48+
run: |
49+
ssh -o StrictHostKeyChecking=no ci@${{ secrets.REMOTE_HOST }} "chmod +x /var/www/core-js/runner.sh"
50+
51+
- name: Run node runner.mjs on remote server
52+
run: |
53+
ssh -o StrictHostKeyChecking=no ci@${{ secrets.REMOTE_HOST }} "cd /var/www/core-js/ && ./runner.sh"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,7 @@ node_modules/
4444
/tests/compat/compat-data.js
4545
/tests/unit-global/index.js
4646
/tests/unit-pure/index.js
47+
/website/templates
48+
/website/dist
49+
/website/src/public/*
50+
/docs/web/blog/index.md

docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
preview: After more than 1.5 years of development, dozens of pre-releases, many sleepless nights, **[`core-js@3`](https://github.com/zloirock/core-js)** is finally released. It's the largest set of changes in `core-js` and polyfilling-related **[`babel`](https://babeljs.io)** features of all time.
3+
---
4+
15
# core-js@3, babel and a look into the future
26

37
After more than 1.5 years of development, dozens of pre-releases, many sleepless nights, **[`core-js@3`](https://github.com/zloirock/core-js)** is finally released. It's the largest set of changes in `core-js` and polyfilling-related **[`babel`](https://babeljs.io)** features of all time.

docs/2023-02-14-so-whats-next.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
preview: Hi. I am (**[@zloirock](https://github.com/zloirock)**), a full-time open-source developer. I don't like to write long posts, but it seems it is high time to do it. Initially, this post was supposed to be a post about the start of active development of the new major version of `core-js` and the roadmap (it was moved to the second half), however, due to recent events, it became a really long post about many different things... I'm fucking tired. Free open-source software is fundamentally broken. I could stop working on this silently, but I want to give open-source one last chance.
3+
---
4+
15
<p align="center"><img alt="core-js" src="https://user-images.githubusercontent.com/2213682/146607186-8e13ddef-26a4-4ebf-befd-5aac9d77c090.png" /></p>
26

37
# So, what's next?
@@ -382,7 +386,7 @@ I still hope for the first outcome since `core-js` is one of the key components
382386

383387
Now let's move away from the negative to the second half of this post where we will talk about things that would be nice to implement in `core-js` and the problems of polyfilling in general.
384388

385-
# Roadmap
389+
## Roadmap
386390

387391
JavaScript, browsers, and web development are evolving at an amazing speed. The time when almost all of the `core-js` modules were required for all browsers is gone. The latest browsers have good standards support and, in the common use cases, they need only some percentage of the `core-js` modules for the most recent language features and bug fixes. Some companies are already dropping support for IE11 which was recently "buried" once more. However, even without IE, old browsers will always be there, bugs will happen in modern browsers too, and new language features will appear regularly and they will appear in browsers with a delay anyway; so, if we want to use modern JS in development and minimize possible problems, polyfills stay with us for a long time, but they should continue to evolve.
388392

docs/web/404.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# 404 Not found

docs/web/blog/.gitkeep

Whitespace-only changes.

docs/web/index.md

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
<div align="center">
2+
3+
[![fundraising](https://opencollective.com/core-js/all/badge.svg?label=fundraising)](https://opencollective.com/core-js) [![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/zloirock/core-js/blob/master/CONTRIBUTING.md) [![version](https://img.shields.io/npm/v/core-js.svg)](https://www.npmjs.com/package/core-js) [![core-js downloads](https://img.shields.io/npm/dm/core-js.svg?label=npm%20i%20core-js)](https://npm-stat.com/charts.html?package=core-js&package=core-js-pure&package=core-js-compat&from=2014-11-18) [![core-js-pure downloads](https://img.shields.io/npm/dm/core-js-pure.svg?label=npm%20i%20core-js-pure)](https://npm-stat.com/charts.html?package=core-js&package=core-js-pure&package=core-js-compat&from=2014-11-18) [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/core-js-bundle/badge?style=rounded)](https://www.jsdelivr.com/package/npm/core-js-bundle)
4+
5+
</div>
6+
7+
> Modular standard library for JavaScript. Includes polyfills for ECMAScript up to 2025, ECMAScript proposals and some cross-platform WHATWG / W3C features.
8+
9+
<div class="features">
10+
<div class="feature">
11+
<div class="title">
12+
<span class="icon"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
13+
<path stroke-linecap="round" stroke-linejoin="round" d="M15.362 5.214A8.252 8.252 0 0 1 12 21 8.25 8.25 0 0 1 6.038 7.047 8.287 8.287 0 0 0 9 9.601a8.983 8.983 0 0 1 3.361-6.867 8.21 8.21 0 0 0 3 2.48Z"></path>
14+
<path stroke-linecap="round" stroke-linejoin="round" d="M12 18a3.75 3.75 0 0 0 .495-7.468 5.99 5.99 0 0 0-1.925 3.547 5.975 5.975 0 0 1-2.133-1.001A3.75 3.75 0 0 0 12 18Z"></path>
15+
</svg></span>
16+
<span>Maximum Coverage</span>
17+
</div>
18+
<div class="desc">Delivers the most complete support for modern and upcoming JavaScript features</div>
19+
</div>
20+
<div class="feature">
21+
<div class="title">
22+
<span class="icon"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
23+
<path stroke-linecap="round" stroke-linejoin="round" d="M12 12.75c1.148 0 2.278.08 3.383.237 1.037.146 1.866.966 1.866 2.013 0 3.728-2.35 6.75-5.25 6.75S6.75 18.728 6.75 15c0-1.046.83-1.867 1.866-2.013A24.204 24.204 0 0 1 12 12.75Zm0 0c2.883 0 5.647.508 8.207 1.44a23.91 23.91 0 0 1-1.152 6.06M12 12.75c-2.883 0-5.647.508-8.208 1.44.125 2.104.52 4.136 1.153 6.06M12 12.75a2.25 2.25 0 0 0 2.248-2.354M12 12.75a2.25 2.25 0 0 1-2.248-2.354M12 8.25c.995 0 1.971-.08 2.922-.236.403-.066.74-.358.795-.762a3.778 3.778 0 0 0-.399-2.25M12 8.25c-.995 0-1.97-.08-2.922-.236-.402-.066-.74-.358-.795-.762a3.734 3.734 0 0 1 .4-2.253M12 8.25a2.25 2.25 0 0 0-2.248 2.146M12 8.25a2.25 2.25 0 0 1 2.248 2.146M8.683 5a6.032 6.032 0 0 1-1.155-1.002c.07-.63.27-1.222.574-1.747m.581 2.749A3.75 3.75 0 0 1 15.318 5m0 0c.427-.283.815-.62 1.155-.999a4.471 4.471 0 0 0-.575-1.752M4.921 6a24.048 24.048 0 0 0-.392 3.314c1.668.546 3.416.914 5.223 1.082M19.08 6c.205 1.08.337 2.187.392 3.314a23.882 23.882 0 0 1-5.223 1.082"></path>
24+
</svg></span>
25+
<span>Spec Compliance</span>
26+
</div>
27+
<div class="desc">Strictly follows ECMAScript standards and fixes engine bugs for consistent behavior</div>
28+
</div>
29+
<div class="feature">
30+
<div class="title">
31+
<span class="icon"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
32+
<path stroke-linecap="round" stroke-linejoin="round" d="M6.429 9.75 2.25 12l4.179 2.25m0-4.5 5.571 3 5.571-3m-11.142 0L2.25 7.5 12 2.25l9.75 5.25-4.179 2.25m0 0L21.75 12l-4.179 2.25m0 0 4.179 2.25L12 21.75 2.25 16.5l4.179-2.25m11.142 0-5.571 3-5.571-3"></path>
33+
</svg></span>
34+
<span>Modularity</span>
35+
</div>
36+
<div class="desc">Import only the polyfills you need for smaller bundles and faster loading</div>
37+
</div>
38+
<div class="feature">
39+
<div class="title">
40+
<span class="icon"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
41+
<path stroke-linecap="round" stroke-linejoin="round" d="M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"></path>
42+
</svg></span>
43+
<span>Easy to Optimize</span>
44+
</div>
45+
<div class="desc">It can be automatically injected and optimized by tools like Babel and SWC</div>
46+
</div>
47+
<div class="feature">
48+
<div class="title">
49+
<span class="icon"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
50+
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"></path>
51+
</svg></span>
52+
<span>Pure Version</span>
53+
</div>
54+
<div class="desc">It can be used without global pollution to avoid conflicts</div>
55+
</div>
56+
<div class="feature">
57+
<div class="title">
58+
<span class="icon"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
59+
<path stroke-linecap="round" stroke-linejoin="round" d="M16.5 18.75h-9m9 0a3 3 0 0 1 3 3h-15a3 3 0 0 1 3-3m9 0v-3.375c0-.621-.503-1.125-1.125-1.125h-.871M7.5 18.75v-3.375c0-.621.504-1.125 1.125-1.125h.872m5.007 0H9.497m5.007 0a7.454 7.454 0 0 1-.982-3.172M9.497 14.25a7.454 7.454 0 0 0 .981-3.172M5.25 4.236c-.982.143-1.954.317-2.916.52A6.003 6.003 0 0 0 7.73 9.728M5.25 4.236V4.5c0 2.108.966 3.99 2.48 5.228M5.25 4.236V2.721C7.456 2.41 9.71 2.25 12 2.25c2.291 0 4.545.16 6.75.47v1.516M7.73 9.728a6.726 6.726 0 0 0 2.748 1.35m8.272-6.842V4.5c0 2.108-.966 3.99-2.48 5.228m2.48-5.492a46.32 46.32 0 0 1 2.916.52 6.003 6.003 0 0 1-5.395 4.972m0 0a6.726 6.726 0 0 1-2.749 1.35m0 0a6.772 6.772 0 0 1-3.044 0"></path>
60+
</svg></span>
61+
<span>Widely Used</span>
62+
</div>
63+
<div class="desc">Trusted by most of the popular websites for ensuring cross-browser compatibility</div>
64+
</div>
65+
</div>
66+
67+
---
68+
69+
Example of usage:
70+
71+
```js
72+
import 'core-js/actual';
73+
74+
await Promise.try(() => 42); // => 42
75+
76+
Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
77+
78+
[1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2]
79+
80+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
81+
.drop(1).take(5)
82+
.filter(it => it % 2)
83+
.map(it => it ** 2)
84+
.toArray(); // => [9, 25]
85+
86+
structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
87+
```
88+
89+
You can load only required features:
90+
91+
```js
92+
import 'core-js/actual/promise';
93+
import 'core-js/actual/set';
94+
import 'core-js/actual/iterator';
95+
import 'core-js/actual/array/from';
96+
import 'core-js/actual/array/flat-map';
97+
import 'core-js/actual/structured-clone';
98+
99+
await Promise.try(() => 42); // => 42
100+
101+
Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
102+
103+
[1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2]
104+
105+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
106+
.drop(1).take(5)
107+
.filter(it => it % 2)
108+
.map(it => it ** 2)
109+
.toArray(); // => [9, 25]
110+
111+
structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
112+
```
113+
114+
or use it without global namespace pollution:
115+
116+
```ts
117+
import Promise from 'core-js-pure/actual/promise';
118+
import Set from 'core-js-pure/actual/set';
119+
import Iterator from 'core-js-pure/actual/iterator';
120+
import from from 'core-js-pure/actual/array/from';
121+
import flatMap from 'core-js-pure/actual/array/flat-map';
122+
import structuredClone from 'core-js-pure/actual/structured-clone';
123+
124+
await Promise.try(() => 42); // => 42
125+
126+
from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
127+
128+
flatMap([1, 2], it => [it, it]); // => [1, 1, 2, 2]
129+
130+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
131+
.drop(1).take(5)
132+
.filter(it => it % 2)
133+
.map(it => it ** 2)
134+
.toArray(); // => [9, 25]
135+
136+
structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
137+
```
138+
139+
## Raising funds
140+
141+
`core-js` isn't backed by a company, so the future of this project depends on you. Become a sponsor or a backer if you are interested in `core-js`: [**Open Collective**](https://opencollective.com/core-js), [**Patreon**](https://patreon.com/zloirock), [**Boosty**](https://boosty.to/zloirock), **Bitcoin ( bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz )**, [**Alipay**](https://user-images.githubusercontent.com/2213682/219464783-c17ad329-17ce-4795-82a7-f609493345ed.png).
142+
143+
---
144+
145+
<div class="sponsors">
146+
<a href="https://opencollective.com/core-js/sponsor/0/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/0/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/1/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/1/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/2/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/2/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/3/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/3/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/4/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/4/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/5/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/5/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/6/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/6/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/7/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/7/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/8/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/8/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/9/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/9/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/10/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/10/avatar.svg"></a><a href="https://opencollective.com/core-js/sponsor/11/website" target="_blank"><img src="https://opencollective.com/core-js/sponsor/11/avatar.svg"></a>
147+
</div>
148+
149+
---
150+
151+
<div align="center">
152+
<details>
153+
<summary>More backers</summary>
154+
<a href="https://opencollective.com/core-js#backers" target="_blank"><img src="https://opencollective.com/core-js/backers.svg?width=890"></a>
155+
</details>
156+
</div>
157+
158+
---

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"zxi": "zx scripts/zxi.mjs",
1818
"prepare": "npm run zxi scripts/prepare.mjs",
1919
"build-compat": "npm run zxi scripts/build-compat/index.mjs",
20+
"build-web": "npm run zxi time website/index.mjs",
2021
"bundle": "run-s bundle-package bundle-tests",
2122
"bundle-package": "npm run zxi time scripts/bundle-package/bundle-package.mjs",
2223
"bundle-tests": "npm run zxi time cd scripts/bundle-tests/bundle-tests.mjs",

0 commit comments

Comments
 (0)