-
Notifications
You must be signed in to change notification settings - Fork 27.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix import next from "next"
#9216
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Peeja
requested review from
ijjk,
lfades,
Timer and
timneutkens
as code owners
October 27, 2019 20:37
Peeja
force-pushed
the
fix-import-next
branch
from
October 30, 2019 18:22
2b067af
to
074e090
Compare
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall decrease ✓
Client Bundles (main, webpack, commons) Overall decrease ✓
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
Client Pages
Client Pages Modern
Client Build Manifests
Rendered Page Sizes
DiffsDiff for main-HASH.js@@ -340,7 +340,7 @@ if (!window.Promise) {
var data = JSON.parse(document.getElementById('__NEXT_DATA__').textContent);
window.__NEXT_DATA__ = data;
-var version = "9.1.3-canary.0";
+var version = "9.1.2";
exports.version = version;
var props = data.props,
err = data.err,
@@ -719,23 +719,20 @@ function _renderError() {
}
var isInitialRender = typeof _reactDom["default"].hydrate === 'function';
-var reactRoot = null;
function renderReactElement(reactEl, domEl) {
// mark start of hydrate/render
if (_utils.SUPPORTS_PERFORMANCE_USER_TIMING) {
performance.mark('beforeRender');
- }
+ } // The check for `.hydrate` is there to support React alternatives like preact
- if (false) { var opts, callback; } else {
- // The check for `.hydrate` is there to support React alternatives like preact
- if (isInitialRender) {
- _reactDom["default"].hydrate(reactEl, domEl, markHydrateComplete);
- isInitialRender = false;
- } else {
- _reactDom["default"].render(reactEl, domEl, markRenderComplete);
- }
+ if (isInitialRender) {
+ _reactDom["default"].hydrate(reactEl, domEl, markHydrateComplete);
+
+ isInitialRender = false;
+ } else {
+ _reactDom["default"].render(reactEl, domEl, markRenderComplete);
}
if (onPerfEntry) {
@@ -1456,7 +1453,7 @@ function () {
scriptRoute = scriptRoute.replace(/\.js$/, '.module.js');
}
- url = _this2.assetPrefix + (isDependency ? route : "/_next/static/" + encodeURIComponent(_this2.buildId) + "/pages" + scriptRoute); // n.b. If preload is not supported, we fall back to `loadPage` which has
+ url = isDependency ? route : _this2.assetPrefix + "/_next/static/" + encodeURIComponent(_this2.buildId) + "/pages" + scriptRoute; // n.b. If preload is not supported, we fall back to `loadPage` which has
// its own deduping mechanism.
if (!document.querySelector("link[rel=\"preload\"][href^=\"" + url + "\"], script[data-next-page=\"" + route + "\"]")) { Diff for main-HASH.module.js@@ -339,7 +339,7 @@ if (!window.Promise) {
var data = JSON.parse(document.getElementById('__NEXT_DATA__').textContent);
window.__NEXT_DATA__ = data;
-var version = "9.1.3-canary.0";
+var version = "9.1.2";
exports.version = version;
var {
props,
@@ -591,23 +591,20 @@ function _renderError() {
}
var isInitialRender = typeof _reactDom.default.hydrate === 'function';
-var reactRoot = null;
function renderReactElement(reactEl, domEl) {
// mark start of hydrate/render
if (_utils.SUPPORTS_PERFORMANCE_USER_TIMING) {
performance.mark('beforeRender');
- }
+ } // The check for `.hydrate` is there to support React alternatives like preact
- if (false) { var opts, callback; } else {
- // The check for `.hydrate` is there to support React alternatives like preact
- if (isInitialRender) {
- _reactDom.default.hydrate(reactEl, domEl, markHydrateComplete);
- isInitialRender = false;
- } else {
- _reactDom.default.render(reactEl, domEl, markRenderComplete);
- }
+ if (isInitialRender) {
+ _reactDom.default.hydrate(reactEl, domEl, markHydrateComplete);
+
+ isInitialRender = false;
+ } else {
+ _reactDom.default.render(reactEl, domEl, markRenderComplete);
}
if (onPerfEntry) {
@@ -1252,7 +1249,7 @@ class PageLoader {
scriptRoute = scriptRoute.replace(/\.js$/, '.module.js');
}
- var url = _this2.assetPrefix + (isDependency ? route : "/_next/static/" + encodeURIComponent(_this2.buildId) + "/pages" + scriptRoute); // n.b. If preload is not supported, we fall back to `loadPage` which has
+ var url = isDependency ? route : _this2.assetPrefix + "/_next/static/" + encodeURIComponent(_this2.buildId) + "/pages" + scriptRoute; // n.b. If preload is not supported, we fall back to `loadPage` which has
// its own deduping mechanism.
if (document.querySelector("link[rel=\"preload\"][href^=\"" + url + "\"], script[data-next-page=\"" + route + "\"]")) { Diff for _buildManifest.js@@ -1 +1 @@
-self.__BUILD_MANIFEST = (function(a){return {"/link":[a],"/routerDirect":[a],"/withRouter":[a]}}("static\u002Fchunks\u002F16b1a72255206b7853bf6603dc58ec83de39b142.b45ed1163cffb8de5382.js"));self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()
\ No newline at end of file
+self.__BUILD_MANIFEST = (function(a){return {"/link":[a],"/routerDirect":[a],"/withRouter":[a]}}("static\u002Fchunks\u002F16b1a72255206b7853bf6603dc58ec83de39b142.a1936a21395e34d00ee0.js"));self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()
\ No newline at end of file Diff for _buildManifest.module.js@@ -1 +1 @@
-self.__BUILD_MANIFEST = (function(a){return {"/link":[a],"/routerDirect":[a],"/withRouter":[a]}}("static\u002Fchunks\u002F16b1a72255206b7853bf6603dc58ec83de39b142.6676b8996c653de03131.module.js"));self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()
\ No newline at end of file
+self.__BUILD_MANIFEST = (function(a){return {"/link":[a],"/routerDirect":[a],"/withRouter":[a]}}("static\u002Fchunks\u002F16b1a72255206b7853bf6603dc58ec83de39b142.8d1caa0eed52bc802a38.module.js"));self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()
\ No newline at end of file Diff for index.html@@ -12,7 +12,7 @@
as="script" crossorigin="anonymous" />
<link rel="preload" href="/_next/static/runtime/webpack-7928590be3ef2e55b835.module.js"
as="script" crossorigin="anonymous" />
- <link rel="preload" href="/_next/static/runtime/main-f59e55f2f069a03aa793.module.js"
+ <link rel="preload" href="/_next/static/runtime/main-ae31e9c8523198185767.module.js"
as="script" crossorigin="anonymous" />
<link rel="preload" href="/_next/static/chunks/framework.cdb73e402d876d4ac87f.module.js"
as="script" crossorigin="anonymous" />
@@ -43,9 +43,9 @@
async="" crossorigin="anonymous" nomodule=""></script>
<script src="/_next/static/runtime/webpack-7928590be3ef2e55b835.module.js"
async="" crossorigin="anonymous" type="module"></script>
- <script src="/_next/static/runtime/main-30f56449cfbe7044b21b.js"
+ <script src="/_next/static/runtime/main-8c312b58ba8dc0eeb4e2.js"
async="" crossorigin="anonymous" nomodule=""></script>
- <script src="/_next/static/runtime/main-f59e55f2f069a03aa793.module.js"
+ <script src="/_next/static/runtime/main-ae31e9c8523198185767.module.js"
async="" crossorigin="anonymous" type="module"></script>
<script src="/_next/static/chunks/framework.219514909c9db8a9ff76.js"
async="" crossorigin="anonymous" nomodule=""></script> Diff for link.html@@ -18,9 +18,9 @@
as="script" crossorigin="anonymous" />
<link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.710f68a91537b45d6153.module.js"
as="script" crossorigin="anonymous" />
- <link rel="preload" href="/_next/static/chunks/16b1a72255206b7853bf6603dc58ec83de39b142.6676b8996c653de03131.module.js"
+ <link rel="preload" href="/_next/static/chunks/16b1a72255206b7853bf6603dc58ec83de39b142.8d1caa0eed52bc802a38.module.js"
as="script" crossorigin="anonymous" />
- <link rel="preload" href="/_next/static/runtime/main-f59e55f2f069a03aa793.module.js"
+ <link rel="preload" href="/_next/static/runtime/main-ae31e9c8523198185767.module.js"
as="script" crossorigin="anonymous" />
</head>
@@ -62,13 +62,13 @@
async="" crossorigin="anonymous" nomodule=""></script>
<script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.710f68a91537b45d6153.module.js"
async="" crossorigin="anonymous" type="module"></script>
- <script src="/_next/static/chunks/16b1a72255206b7853bf6603dc58ec83de39b142.b45ed1163cffb8de5382.js"
+ <script src="/_next/static/chunks/16b1a72255206b7853bf6603dc58ec83de39b142.a1936a21395e34d00ee0.js"
async="" crossorigin="anonymous" nomodule=""></script>
- <script src="/_next/static/chunks/16b1a72255206b7853bf6603dc58ec83de39b142.6676b8996c653de03131.module.js"
+ <script src="/_next/static/chunks/16b1a72255206b7853bf6603dc58ec83de39b142.8d1caa0eed52bc802a38.module.js"
async="" crossorigin="anonymous" type="module"></script>
- <script src="/_next/static/runtime/main-30f56449cfbe7044b21b.js"
+ <script src="/_next/static/runtime/main-8c312b58ba8dc0eeb4e2.js"
async="" crossorigin="anonymous" nomodule=""></script>
- <script src="/_next/static/runtime/main-f59e55f2f069a03aa793.module.js"
+ <script src="/_next/static/runtime/main-ae31e9c8523198185767.module.js"
async="" crossorigin="anonymous" type="module"></script>
<script src="/_next/static/BUILD_ID/_buildManifest.js" async=""
crossorigin="anonymous" nomodule=""></script> Diff for withRouter.html@@ -18,9 +18,9 @@
as="script" crossorigin="anonymous" />
<link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.710f68a91537b45d6153.module.js"
as="script" crossorigin="anonymous" />
- <link rel="preload" href="/_next/static/chunks/16b1a72255206b7853bf6603dc58ec83de39b142.6676b8996c653de03131.module.js"
+ <link rel="preload" href="/_next/static/chunks/16b1a72255206b7853bf6603dc58ec83de39b142.8d1caa0eed52bc802a38.module.js"
as="script" crossorigin="anonymous" />
- <link rel="preload" href="/_next/static/runtime/main-f59e55f2f069a03aa793.module.js"
+ <link rel="preload" href="/_next/static/runtime/main-ae31e9c8523198185767.module.js"
as="script" crossorigin="anonymous" />
</head>
@@ -60,13 +60,13 @@
async="" crossorigin="anonymous" nomodule=""></script>
<script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.710f68a91537b45d6153.module.js"
async="" crossorigin="anonymous" type="module"></script>
- <script src="/_next/static/chunks/16b1a72255206b7853bf6603dc58ec83de39b142.b45ed1163cffb8de5382.js"
+ <script src="/_next/static/chunks/16b1a72255206b7853bf6603dc58ec83de39b142.a1936a21395e34d00ee0.js"
async="" crossorigin="anonymous" nomodule=""></script>
- <script src="/_next/static/chunks/16b1a72255206b7853bf6603dc58ec83de39b142.6676b8996c653de03131.module.js"
+ <script src="/_next/static/chunks/16b1a72255206b7853bf6603dc58ec83de39b142.8d1caa0eed52bc802a38.module.js"
async="" crossorigin="anonymous" type="module"></script>
- <script src="/_next/static/runtime/main-30f56449cfbe7044b21b.js"
+ <script src="/_next/static/runtime/main-8c312b58ba8dc0eeb4e2.js"
async="" crossorigin="anonymous" nomodule=""></script>
- <script src="/_next/static/runtime/main-f59e55f2f069a03aa793.module.js"
+ <script src="/_next/static/runtime/main-ae31e9c8523198185767.module.js"
async="" crossorigin="anonymous" type="module"></script>
<script src="/_next/static/BUILD_ID/_buildManifest.js" async=""
crossorigin="anonymous" nomodule=""></script> Serverless Mode (Decrease detected ✓)General Overall decrease ✓
Client Bundles (main, webpack, commons) Overall decrease ✓
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
Client Pages
Client Pages Modern
Client Build Manifests
Serverless bundles Overall decrease ✓
Commit: 074e090 |
timneutkens
approved these changes
Oct 31, 2019
Thank you @Peeja 🎉 Great first PR 🚀 |
Thanks, @timneutkens! |
This was referenced Nov 19, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #9208.
I wanted to add a test to demonstrate the problem, but I couldn't find a suitable place for one. Happy to do it with a pointer, if desired. Otherwise ,
yarn demonstrate
in this repo will demonstrate the issue; you can useyarn link
to run against this branch and see the problem fixed.