-
Notifications
You must be signed in to change notification settings - Fork 961
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Remove support for deprecated import/require"
This reverts commit baac270.
- Loading branch information
Showing
19 changed files
with
161 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
require('./warnAboutDeprecatedCJSRequire.js')('DOMUtils'); | ||
module.exports = require('./index.js').DOMUtils; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
require('./warnAboutDeprecatedCJSRequire.js')('ExecutionEnvironment'); | ||
module.exports = require('./index.js').ExecutionEnvironment; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
require('./warnAboutDeprecatedCJSRequire.js')('LocationUtils'); | ||
module.exports = require('./index.js').LocationUtils; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
require('./warnAboutDeprecatedCJSRequire.js')('PathUtils'); | ||
module.exports = require('./index.js').PathUtils; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
require('./warnAboutDeprecatedCJSRequire.js')('createBrowserHistory'); | ||
module.exports = require('./index.js').createBrowserHistory; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
require('./warnAboutDeprecatedCJSRequire.js')('createHashHistory'); | ||
module.exports = require('./index.js').createHashHistory; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
require('./warnAboutDeprecatedCJSRequire.js')('createMemoryHistory'); | ||
module.exports = require('./index.js').createMemoryHistory; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
require('./warnAboutDeprecatedCJSRequire.js')('createTransitionManager'); | ||
module.exports = require('./index.js').createTransitionManager; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
import warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js'; | ||
warnAboutDeprecatedESMImport('DOMUtils'); | ||
|
||
import { DOMUtils } from '../esm/history.js'; | ||
export default DOMUtils; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
import warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js'; | ||
warnAboutDeprecatedESMImport('ExecutionEnvironment'); | ||
|
||
import { ExecutionEnvironment } from '../esm/history.js'; | ||
export default ExecutionEnvironment; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
import warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js'; | ||
warnAboutDeprecatedESMImport('LocationUtils'); | ||
|
||
import { LocationUtils } from '../esm/history.js'; | ||
export default LocationUtils; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
import warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js'; | ||
warnAboutDeprecatedESMImport('PathUtils'); | ||
|
||
import { PathUtils } from '../esm/history.js'; | ||
export default PathUtils; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
import warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js'; | ||
warnAboutDeprecatedESMImport('createBrowserHistory'); | ||
|
||
import { createBrowserHistory } from '../esm/history.js'; | ||
export default createBrowserHistory; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
import warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js'; | ||
warnAboutDeprecatedESMImport('createHashHistory'); | ||
|
||
import { createHashHistory } from '../esm/history.js'; | ||
export default createHashHistory; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
import warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js'; | ||
warnAboutDeprecatedESMImport('createMemoryHistory'); | ||
|
||
import { createMemoryHistory } from '../esm/history.js'; | ||
export default createMemoryHistory; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
import warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js'; | ||
warnAboutDeprecatedESMImport('createTransitionManager'); | ||
|
||
import { createTransitionManager } from '../esm/history.js'; | ||
export default createTransitionManager; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use strict'; | ||
|
||
var printWarning = function() {}; | ||
|
||
if (process.env.NODE_ENV !== 'production') { | ||
printWarning = function(format, subs) { | ||
var index = 0; | ||
var message = | ||
'Warning: ' + | ||
(subs.length > 0 | ||
? format.replace(/%s/g, function() { | ||
return subs[index++]; | ||
}) | ||
: format); | ||
|
||
if (typeof console !== 'undefined') { | ||
console.error(message); | ||
} | ||
|
||
try { | ||
// --- Welcome to debugging history --- | ||
// This error was thrown as a convenience so that you can use the | ||
// stack trace to find the callsite that triggered this warning. | ||
throw new Error(message); | ||
} catch (e) {} | ||
}; | ||
} | ||
|
||
export default function(member) { | ||
printWarning( | ||
'Please use `import { %s } from "history"` instead of `import %s from "history/es/%s"`. ' + | ||
'Support for the latter will be removed in the next major release.', | ||
[member, member] | ||
); | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use strict'; | ||
|
||
var printWarning = function() {}; | ||
|
||
if (process.env.NODE_ENV !== 'production') { | ||
printWarning = function(format, subs) { | ||
var index = 0; | ||
var message = | ||
'Warning: ' + | ||
(subs.length > 0 | ||
? format.replace(/%s/g, function() { | ||
return subs[index++]; | ||
}) | ||
: format); | ||
|
||
if (typeof console !== 'undefined') { | ||
console.error(message); | ||
} | ||
|
||
try { | ||
// --- Welcome to debugging history --- | ||
// This error was thrown as a convenience so that you can use the | ||
// stack trace to find the callsite that triggered this warning. | ||
throw new Error(message); | ||
} catch (e) {} | ||
}; | ||
} | ||
|
||
module.exports = function(member) { | ||
printWarning( | ||
'Please use `require("history").%s` instead of `require("history/%s")`. ' + | ||
'Support for the latter will be removed in the next major release.', | ||
[member, member] | ||
); | ||
}; |