Skip to content

Commit b3b1b61

Browse files
authored
pkg: Switch from @js-temporal/polyfill to temporal-polyfill (#3815)
temporal-polyfill is 60% smaller (19.8 KB vs 51.9 KB gzip), same spec compliance, and avoids JSBI. Website playground now uses native Temporal API when available (Chrome/Firefox/Edge) with polyfill fallback for Safari and older browsers. Made-with: Cursor
1 parent e6f05d7 commit b3b1b61

File tree

38 files changed

+273
-236
lines changed

38 files changed

+273
-236
lines changed

__tests__/new.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Temporal } from '@js-temporal/polyfill';
21
import React, { createContext, useContext } from 'react';
2+
import { Temporal } from 'temporal-polyfill';
33

44
import {
55
Endpoint,

docs/rest/api/schema.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ We have two nested [entity](./Entity.md) types within our `article`: `users` and
4646

4747
```typescript
4848
import { schema, Entity } from '@data-client/endpoint';
49-
import { Temporal } from '@js-temporal/polyfill';
49+
import { Temporal } from 'temporal-polyfill';
5050

5151
class User extends Entity {
5252
id = '';
@@ -79,7 +79,7 @@ class Article extends Entity {
7979

8080
```javascript
8181
import { schema, Entity } from '@data-client/endpoint';
82-
import { Temporal } from '@js-temporal/polyfill';
82+
import { Temporal } from 'temporal-polyfill';
8383

8484
class User extends Entity { }
8585

examples/github-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"@data-client/img": "0.15.0",
5959
"@data-client/react": "0.15.7",
6060
"@data-client/rest": "0.15.7",
61-
"@js-temporal/polyfill": "^0.5.1",
61+
"temporal-polyfill": "^0.3.0",
6262
"antd": "6.3.3",
6363
"core-js": "^3.48.0",
6464
"history": "^5.3.0",

examples/github-app/src/components/human.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Temporal } from '@js-temporal/polyfill';
1+
import { Temporal } from 'temporal-polyfill';
22

33
export function humanTime(date: Temporal.Instant, language: string) {
44
const REL = new Intl.RelativeTimeFormat(language, {

examples/github-app/src/pages/IssueDetail/CommentInline.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { useNavigator } from '@anansi/core';
22
import { Link, useRoutes } from '@anansi/router';
33
import { EllipsisOutlined } from '@ant-design/icons';
44
import { useCache, useController } from '@data-client/react';
5-
import { Intl } from '@js-temporal/polyfill';
65
import { css } from '@linaria/core';
76
import { Card, Avatar, Button, Tag, Popover } from 'antd';
87
import React, { memo, useCallback, useState } from 'react';
98
import Markdown from 'react-markdown';
109
import rehypeHighlight from 'rehype-highlight';
1110
import remarkGfm from 'remark-gfm';
1211
import remarkRemoveComments from 'remark-remove-comments';
12+
import { Intl } from 'temporal-polyfill';
1313

1414
import FlexRow from '@/components/FlexRow';
1515
import { CommentResource, Comment } from '@/resources/Comment';

examples/github-app/src/pages/ProfileDetail/UserEvents.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { useNavigator } from '@anansi/core';
22
import { Link } from '@anansi/router';
33
import { BranchesOutlined, PullRequestOutlined } from '@ant-design/icons';
44
import { useSuspense } from '@data-client/react';
5-
import { Intl } from '@js-temporal/polyfill';
65
import { Timeline, Typography, Divider } from 'antd';
76
import { groupBy } from 'lodash';
87
import { useMemo } from 'react';
8+
import { Intl } from 'temporal-polyfill';
99

1010
import {
1111
EventResource,

examples/github-app/src/pages/ProfileDetail/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useNavigator } from '@anansi/core';
22
import { useSuspense } from '@data-client/react';
3-
import { Intl } from '@js-temporal/polyfill';
43
import { Card, Layout } from 'antd';
54
import Markdown from 'react-markdown';
5+
import { Intl } from 'temporal-polyfill';
66

77
import { UserResource } from '@/resources/User';
88

examples/github-app/src/resources/Comment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Temporal } from '@js-temporal/polyfill';
1+
import { Temporal } from 'temporal-polyfill';
22

33
import { GithubEntity, githubResource } from './Base';
44
import { User } from './User';

examples/github-app/src/resources/Event.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
ForkOutlined,
88
} from '@ant-design/icons';
99
import { schema } from '@data-client/rest';
10-
import { Temporal } from '@js-temporal/polyfill';
1110
import type { JSX } from 'react';
11+
import { Temporal } from 'temporal-polyfill';
1212

1313
import { githubResource, GithubEntity } from './Base';
1414
import { Issue } from './Issue';

examples/github-app/src/resources/Issue.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Temporal } from '@js-temporal/polyfill';
1+
import { Temporal } from 'temporal-polyfill';
22

33
import { GithubEntity, githubResource } from './Base';
44
import { Label } from './Label';

0 commit comments

Comments
 (0)