-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Use setPrototypeOf #4
Comments
When @dougwilson has previously tested this, @wesleytodd what browsers don't support |
IE10 was the main one, but I guess since MS just dropped support for anything below 11, maybe this is a moot point. Technically according to MDN
The original issue I linked to was about a year ago, and I was trying to support back to IE9 with the router. Anyway, totally understand if you want to close this. EDIT: Or maybe if we are sure the perf is better I could switch that module to prefer the |
@wesleytodd what exactly are you trying to run in a browser that requires this functionality? |
Hopefully most what what express is doing. I am currently running just the router, but in the future I would love to be able to run something that looks and functions just like an express app on the backend. That is the only reason I even mentioned this issue here is because I assume this module will take over this (https://github.com/strongloop/express/blob/5.0/lib/express.js#L43-L44) in the future. Am I correct in assuming that? |
Correct. If you make a PR I'll review it but I don't really make any guarantees about browser support from myself. |
Thats what I'm here for, browser support :) And FWIW, just ran this jsperf and the perf is comparable in up to date chrome: http://jsperf.com/new-vs-mutable-proto/2 |
@wesleytodd Two things:
|
|
@wesleytodd Currently in express: no, but that is what this library does because it makes this a usable API. Some background: From what I can tell |
Yeah, I guess its newish, here is the best source for info on it that I know of: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf It was spec'd out in es2015, but that was the point of that module I linked to originally. To get the new feature while keeping backward compat. For reference, I am currently working on building a express compatible implementation for the browser. It would hopefully encompass as much of the express api surface area as makes sense run in the browser. So supporting the ability to customize req/res in the same way express allows would be awesome. That is why I care about this. |
@wesleytodd are you interested in making a PR for it? :) |
Absolutely, sorry, I got distracted and on other things. I can do that tonight or tomorrow when I get home. |
See #6 :) |
As far as my opinion on this, I'm more aligned with @wesleytodd, as that is the more up-to-date consensus since the last time you were around, @Fishrock123 :) The |
Hey, just perusing the repo's around here and noticed in this one it is setting
__proto__
. Not sure what the end use of this module will be, but we had a discussion around this here because that breaks some browser support. Also, there is a new and standardized api to do this,Object.setPrototypeOf
. So the router is using this module to get a nice fallback.If you want I can PR that in, but I wanted to open this to make sure I wasn't misunderstanding the use case for this module :)
The text was updated successfully, but these errors were encountered: