| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
`require.path` property and `require.registerExtension` function have been throwing errors when used. They both are like this for years now. This patch removes them from the system.
Sorry, something went wrong.
|
Bump! |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
I'll land this tomorrow if there are no objections. cc @nodejs/collaborators |
Sorry, something went wrong.
|
cc @rvagg what does our deprecation policy says on this? |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
Why semver-major though? It was already removed. It's not like any application will break because of this change. |
Sorry, something went wrong.
|
@thefourtheye It was require.paths, not require.path. |
Sorry, something went wrong.
There was a problem hiding this comment.
Nit: Can you add a test to confirm that require.paths returns undefined or whatever the expected value is?
Sorry, something went wrong.
There was a problem hiding this comment.
Nit: Probably good to do the same for require.registerExtension().
Sorry, something went wrong.
There was a problem hiding this comment.
@Trott Do we really need that? There will be no reference to that in code, but there will be a test which will check if paths is undefined.
Sorry, something went wrong.
There was a problem hiding this comment.
My thinking is this PR changes the behavior of the code and there ought to be a test for that change. So a test that the property has, in fact, been successfully removed seems appropriate. But if you think it's overkill, I'm OK without it. (I'll edit my comments above to indicate they are nits.)
Sorry, something went wrong.
There was a problem hiding this comment.
@Trott Hmmm, whenever we remove something from the system we don't add tests to make sure that they are really removed, right? So, I feel that it is not necessary. Let's see what others feel.
Sorry, something went wrong.
|
@ChALkeR Ah, thanks for pointing out. I edited the PR description. I'll update the commit log when I am landing this. |
Sorry, something went wrong.
|
@seishun It changes the behavior by removing a throw. If anyone did a feature detection checking whenether require.paths throws or not, it would be broken by this commit. While the likehood of such situation is near zero, it still makes this PR a semver-major IMO. |
Sorry, something went wrong.
|
require.registerExtension( usage: amdify-0.0.26.tgz/jam/ejs/lib/ejs.js:350: require.registerExtension('.ejs', function(src) {
backbone-revisited-0.1.2.tgz/node_mods/ejs.js:353: require.registerExtension('.ejs', function(src) {
blitzLib-0.1.0.tgz/Lib/coffee-script-debug.js:14330: }: require.registerExtension && require.registerExtension(".coffee",
bluebutton-0.4.2.tgz/_site/spec/javascripts/helpers/ejs.js:411: require.registerExtension('.ejs', function(src) {
clientexpress-0.7.7.tgz/lib/ejs.js:301: require.registerExtension('.ejs', function(src) {
coffeete-0.0.4.tgz/src/coffeete.js:22: require.registerExtension('.coffeete', function (content) {
contracts.coffee-0.3.4.tgz/lib/coffee-script/coffee-script.js:24: require.registerExtension('.coffee', function(content) {
ejs-harmony-1.0.1.tgz/lib/ejs.js:413: require.registerExtension('.ejs', function(src) {
ejs-i-1.2.3.tgz/ejs.js:417: require.registerExtension('.ejs', function (src) {
ejs-i-1.2.3.tgz/lib/ejs.js:399: require.registerExtension('.ejs', function (src) {
ejs-remix-0.1.1.tgz/ejs.js:346: require.registerExtension('.ejs', function(src) {
ejs-remix-0.1.1.tgz/lib/ejs.js:504: require.registerExtension('.ejs', function(src) {
ejs-template-0.1.0.tgz/ejs/ejs.js:376: require.registerExtension('.ejs', function(src) {
ejs-var-1.0.0.tgz/ejs.js:411: require.registerExtension('.ejs', function(src) {
ejs-var-1.0.0.tgz/lib/ejs.js:374: require.registerExtension('.ejs', function(src) {
ender-ejs-0.6.1.tgz/ejs.js:334: require.registerExtension('.ejs', function(src) {
funtang.compiler-0.0.1.tgz/reference/jashkenas-coffee-script-60c9b94/lib/coffee-script/coffee-script.js:25: require.registerExtension('.coffee', function(content) {
gorillascript-0.9.10.tgz/extras/gorillascript.js:30580: require.registerExtension(".gs", function (content) {
gorillascript-0.9.10.tgz/lib/gorilla.js:435: require.registerExtension(".gs", function (content) {
imba-0.13.0.tgz/register.js:39: require.registerExtension('.imba',function (content){
logmonger-0.1.0.tgz/contrib/coffee-script/coffee-script.js:14: require.registerExtension('.coffee', function(content) {
mochiscript-0.6.16.tgz/lib/mochiscript/mochiscript.js:1280: require.registerExtension('.ms', function(content, filename) {
neode-0.0.0.tgz/coffee-script/lib/coffee-script/coffee-script.js:25: require.registerExtension('.coffee', function(content) {
ngine-0.0.2.tgz/lib/ejs.js:387: require.registerExtension('.ejs', function(src) {
periodic.component.list-view-scroll-0.1.1.tgz/example/scripts/example.js:2827: require.registerExtension('.ejs', function(src) {
sdejs-0.0.2.tgz/lib/sdejs.js:376: require.registerExtension('.ejs', function(src) {
sdejs-0.0.2.tgz/sdejs.js:420: require.registerExtension('.ejs', function(src) {
springbokejs-0.0.1.tgz/ejs.js:346: require.registerExtension('.ejs', function(src) {
springbokejs-0.0.1.tgz/lib/ejs.js:378: require.registerExtension('.ejs', function(src) {
tinyliquid-0.2.29.tgz/other/ejs.js:411: require.registerExtension('.ejs', function(src) {
toffee-0.1.12.tgz/lib/coffee-script/coffee-script.js:25: require.registerExtension('.coffee', function(content) {
TwigJS-0.0.2.tgz/support/coffee-script/lib/coffee-script/coffee-script.js:17: require.registerExtension('.coffee', function(content) {
twigjs-0.0.4.tgz/support/coffee-script/lib/coffee-script/coffee-script.js:17: require.registerExtension('.coffee', function(content) {
utml-0.2.0.tgz/utml.js:224: require.registerExtension('.utml', function(src){
vork-0.0.12.tgz/exampleApp/app/requirejsBuilder/plugins/ejs.js:333: require.registerExtension('.ejs', function(src) {
wsi-ejs-1.2.0.tgz/ejs.js:413: require.registerExtension('.ejs', function(src) {
wsi-ejs-1.2.0.tgz/lib/ejs.js:361: require.registerExtension('.ejs', function(src) {
yerbascript-0.0.1.tgz/lib/coffee-script/coffee-script.js:31: require.registerExtension('.yerba', function(content) {
yerbascript-0.0.1.tgz/lib/coffee-script/coffee-script.js:34: require.registerExtension('.coffee', function(content) {Most of them do an } else if (require.registerExtension) { check before calling require.registerExtension. |
Sorry, something went wrong.
|
IMHO I would just remove them both, they have been deprecated for a long time now, at least since 2011. It's not like it was a soft deprecation either. |
Sorry, something went wrong.
|
require.paths usage: https://gist.github.com/ChALkeR/4d1f25b54e5786dcca81 |
Sorry, something went wrong.
|
@ChALkeR Are all those packages latest? |
Sorry, something went wrong.
|
hmmm, I wonder how they are really working. |
Sorry, something went wrong.
|
There could be a lot of false positives for require.paths — the code could be performing feature detection to be compatible with old versions, «require» and «paths» are common words, so it might be a different «require», some lines are actually comments or strings. Also some modules are not used by anybody. |
Sorry, something went wrong.
|
@thefourtheye Also note that those are only 1100 lines in 442 modules for require.paths. From 186231 modules on npm. That's actually 0.2%. Together with the false positives. |
Sorry, something went wrong.
Not sure we have coverage of this kind of situation because it's not even deprecated, it's flat-out broken. I could imagine a situation where you're using the exception in some upstream workflow but you'd have to be more than a little crazy to be doing that I think.. I bet lot of those packages are either not attempting to use that functionality (notice how many have ejs.js or coffee-script.js in a lib directory?) or are simply abandonware. I'm +0.5 on this as long as it's only for v5+. |
Sorry, something went wrong.
|
@thefourtheye Also, most of those require.paths usage lines are throwing an error without this PR (in 4.x) and will throw an error (though a different one) with this PR (in 5.x), as they attempt to do require.paths.something(…), for example require.paths.unshift(…). |
Sorry, something went wrong.
|
LGTM for v5 |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
`require.paths` property and `require.registerExtension` function have been throwing errors when used. They both are like this for years now. This patch removes them from the system. PR-URL: #2922 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
| Back | FazBrowse Home | New Git URL |
require.paths property and require.registerExtension function have
been throwing errors when used. They both are like this for years now.
This patch removes them from the system.
require.paths: 7f0047c#diff-d1234a869b3d648ebfcdce5a76747d71R359
require.registerExtension was removed even before that.