Unverified Commit 7848615b authored by Janicklas Ralph's avatar Janicklas Ralph Committed by GitHub

Fix url-polyfill dep and re-enable native-url (#10726)

* Adding native-url package

* Bumping native-url version

* Upgrading native-url

* Logging stats object for debugging

* Logging stats object for debugging

* Adding try catch to the error lines

* Experimenting with regex

* Experimenting with regex

* Experimenting with regex

* Testing regex changes

* Fixing defer-script test case to not include polyfill.js

* Meging changes with existing polyfill work

* Bumping version

* adjust webpack config

* Reduce size in size test

* Remove 1kb from legacy

* Bumping native-url version, includes fix for IE11

* Update lock file

* Updating native-url, fixes issue on IE11

* Fix sourcemap being added in document

* Adding Router as an app level dep. Fixes Router not being added as a dep to pages without Link when granularChunks is enabled

* Fix typescript error

* Fix modern + granularChunks hydration failing

* Fix TS error

* Update native-url version

* Adding native-url with safari fix

* Update url-polyfill in polyfill-nomodule package

* Remove url-polyfill from next package.json
Co-authored-by: 's avatarTim Neutkens <tim@timneutkens.nl>
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
Co-authored-by: 's avatarJoe Haddad <timer150@gmail.com>
parent 5b5d72ba
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"microbundle": "0.11.0", "microbundle": "0.11.0",
"object-assign": "4.1.1", "object-assign": "4.1.1",
"promise-polyfill": "8.1.3", "promise-polyfill": "8.1.3",
"url-polyfill": "1.1.7", "url-polyfill": "1.1.8",
"whatwg-fetch": "3.0.0" "whatwg-fetch": "3.0.0"
} }
} }
...@@ -88,9 +88,8 @@ function getOptimizedAliases(isServer: boolean): { [pkg: string]: string } { ...@@ -88,9 +88,8 @@ function getOptimizedAliases(isServer: boolean): { [pkg: string]: string } {
'object.assign/polyfill': path.join(shimAssign, 'polyfill.js'), 'object.assign/polyfill': path.join(shimAssign, 'polyfill.js'),
'object.assign/shim': path.join(shimAssign, 'shim.js'), 'object.assign/shim': path.join(shimAssign, 'shim.js'),
// TODO: re-enable when `native-url` supports Safari 10 // Replace: full URL polyfill with platform-based polyfill
// // Replace: full URL polyfill with platform-based polyfill url: require.resolve('native-url'),
// url: require.resolve('native-url'),
} }
) )
} }
......
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
"lru-cache": "5.1.1", "lru-cache": "5.1.1",
"mini-css-extract-plugin": "0.8.0", "mini-css-extract-plugin": "0.8.0",
"mkdirp": "0.5.1", "mkdirp": "0.5.1",
"native-url": "0.2.6",
"node-fetch": "2.6.0", "node-fetch": "2.6.0",
"ora": "3.4.0", "ora": "3.4.0",
"path-to-regexp": "6.1.0", "path-to-regexp": "6.1.0",
...@@ -140,7 +141,6 @@ ...@@ -140,7 +141,6 @@
"thread-loader": "2.1.3", "thread-loader": "2.1.3",
"unfetch": "4.1.0", "unfetch": "4.1.0",
"url": "0.11.0", "url": "0.11.0",
"url-polyfill": "1.1.7",
"use-subscription": "1.1.1", "use-subscription": "1.1.1",
"watchpack": "2.0.0-beta.13", "watchpack": "2.0.0-beta.13",
"webpack": "4.41.2", "webpack": "4.41.2",
......
...@@ -80,7 +80,7 @@ describe('Production response size', () => { ...@@ -80,7 +80,7 @@ describe('Production response size', () => {
) )
// These numbers are without gzip compression! // These numbers are without gzip compression!
const delta = responseSizesBytes - 237 * 1024 const delta = responseSizesBytes - 230 * 1024
expect(delta).toBeLessThanOrEqual(1024) // don't increase size more than 1kb expect(delta).toBeLessThanOrEqual(1024) // don't increase size more than 1kb
expect(delta).toBeGreaterThanOrEqual(-1024) // don't decrease size more than 1kb without updating target expect(delta).toBeGreaterThanOrEqual(-1024) // don't decrease size more than 1kb without updating target
}) })
...@@ -100,7 +100,7 @@ describe('Production response size', () => { ...@@ -100,7 +100,7 @@ describe('Production response size', () => {
) )
// These numbers are without gzip compression! // These numbers are without gzip compression!
const delta = responseSizesBytes - 171 * 1024 const delta = responseSizesBytes - 163 * 1024
expect(delta).toBeLessThanOrEqual(1024) // don't increase size more than 1kb expect(delta).toBeLessThanOrEqual(1024) // don't increase size more than 1kb
expect(delta).toBeGreaterThanOrEqual(-1024) // don't decrease size more than 1kb without updating target expect(delta).toBeGreaterThanOrEqual(-1024) // don't decrease size more than 1kb without updating target
}) })
......
...@@ -10953,6 +10953,13 @@ native-or-bluebird@^1.2.0: ...@@ -10953,6 +10953,13 @@ native-or-bluebird@^1.2.0:
resolved "https://registry.yarnpkg.com/native-or-bluebird/-/native-or-bluebird-1.2.0.tgz#39c47bfd7825d1fb9ffad32210ae25daadf101c9" resolved "https://registry.yarnpkg.com/native-or-bluebird/-/native-or-bluebird-1.2.0.tgz#39c47bfd7825d1fb9ffad32210ae25daadf101c9"
integrity sha1-OcR7/Xgl0fuf+tMiEK4l2q3xAck= integrity sha1-OcR7/Xgl0fuf+tMiEK4l2q3xAck=
native-url@0.2.6:
version "0.2.6"
resolved "https://registry.yarnpkg.com/native-url/-/native-url-0.2.6.tgz#ca1258f5ace169c716ff44eccbddb674e10399ae"
integrity sha512-k4bDC87WtgrdD362gZz6zoiXQrl40kYlBmpfmSjwRO1VU0V5ccwJTlxuE72F6m3V0vc1xOf6n3UCP9QyerRqmA==
dependencies:
querystring "^0.2.0"
natural-compare@^1.4.0: natural-compare@^1.4.0:
version "1.4.0" version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
...@@ -16552,10 +16559,10 @@ url-parse-lax@^3.0.0: ...@@ -16552,10 +16559,10 @@ url-parse-lax@^3.0.0:
dependencies: dependencies:
prepend-http "^2.0.0" prepend-http "^2.0.0"
url-polyfill@1.1.7: url-polyfill@1.1.8:
version "1.1.7" version "1.1.8"
resolved "https://registry.yarnpkg.com/url-polyfill/-/url-polyfill-1.1.7.tgz#402ee84360eb549bbeb585f4c7971e79a31de9e3" resolved "https://registry.yarnpkg.com/url-polyfill/-/url-polyfill-1.1.8.tgz#21eb58ad61192f52b77dcac8ab5293ae7bc67060"
integrity sha512-ZrAxYWCREjmMtL8gSbSiKKLZZticgihCvVBtrFbUVpyoETt8GQJeG2okMWA8XryDAaHMjJfhnc+rnhXRbI4DXA== integrity sha512-Ey61F4FEqhcu1vHSOMmjl0Vd/RPRLEjMj402qszD/dhMBrVfoUsnIj8KSZo2yj+eIlxJGKFdnm6ES+7UzMgZ3Q==
url-template@^2.0.8: url-template@^2.0.8:
version "2.0.8" version "2.0.8"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment