Skip to content

Commit 23be63d

Browse files
ijjkkodiakhq[bot]
andauthored
Update to pre-compile use-subscription (#35746)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 2269f03 commit 23be63d

File tree

6 files changed

+68
-3
lines changed

6 files changed

+68
-3
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Facebook, Inc. and its affiliates.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/next/compiled/use-subscription/index.js

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"name":"use-subscription","main":"index.js","license":"MIT"}

packages/next/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@
7272
"@next/env": "12.1.3-canary.3",
7373
"caniuse-lite": "^1.0.30001283",
7474
"postcss": "8.4.5",
75-
"styled-jsx": "5.0.1",
76-
"use-subscription": "1.5.1"
75+
"styled-jsx": "5.0.1"
7776
},
7877
"peerDependencies": {
7978
"fibers": ">= 3.1.0",
@@ -261,6 +260,7 @@
261260
"tty-browserify": "0.0.1",
262261
"ua-parser-js": "0.7.28",
263262
"unistore": "3.4.1",
263+
"use-subscription": "1.5.1",
264264
"util": "0.12.4",
265265
"uuid": "8.3.2",
266266
"vm-browserify": "1.1.2",

packages/next/shared/lib/loadable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
2222
// Modified to be compatible with webpack 4 / Next.js
2323

2424
import React from 'react'
25-
import { useSubscription } from 'use-subscription'
25+
import { useSubscription } from 'next/dist/compiled/use-subscription'
2626
import { LoadableContext } from './loadable-context'
2727

2828
const ALL_INITIALIZERS = []

packages/next/taskfile.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,23 @@ export async function ncc_react_refresh_utils(task, opts) {
300300
}
301301
}
302302

303+
// eslint-disable-next-line camelcase
304+
export async function ncc_use_subscription(task, opts) {
305+
await task
306+
.source(
307+
opts.src || relative(__dirname, require.resolve('use-subscription'))
308+
)
309+
.ncc({
310+
packageName: 'use-subscription',
311+
externals: {
312+
...externals,
313+
react: 'react',
314+
'react-dom': 'react-dom',
315+
},
316+
})
317+
.target('compiled/use-subscription')
318+
}
319+
303320
// eslint-disable-next-line camelcase
304321
externals['chalk'] = 'next/dist/compiled/chalk'
305322
export async function ncc_chalk(task, opts) {
@@ -1618,6 +1635,7 @@ export async function ncc(task, opts) {
16181635
'ncc_node_html_parser',
16191636
'ncc_watchpack',
16201637
'ncc_chalk',
1638+
'ncc_use_subscription',
16211639
'ncc_napirs_triples',
16221640
'ncc_etag',
16231641
'ncc_p_limit',

0 commit comments

Comments
 (0)