Comments (4)
@magnusbakken This does not sound right...
How did you patch the array prototype?
Did you use Object.defineProperty
? Did you set the configurable
and enumerable
properties to false?
from ngrid.
I'm sorry, I should've been more explicit about what I meant by patching the prototype. No, I haven't been using Object.defineProperty. I can see that doing so solves the problem, and will rewrite my own prototype overrides to set enumerable to false. Thanks for the tip!
However I would still recommend using for (let i = 0...
, since doing Array.prototype.foo = ...
is a fairly common pattern, and not everybody is in a position to easily change it.
from ngrid.
@magnusbakken I will wait with this for now, not sure how to tackle this because I don't think this should be an issue for 99% of the users.
If I see this come up again, I'll see how we can address the issue.
While it looks like a minor patch there are several points in mind:
- Making sure performance is not effected.
- Verifying that all places it occurs in are transformed (it might be in places you didn't use, like plugins)
- Making sure it is forbidden through a linter
I understand that while patching is not common and not recommended, it might still happen here and there, however, I believe that most prototype patches done by 3rd party libraries are done using Object.defineProperty
with enumerable
set to false and when it's done locally the developer can always fix it.
Btw, even if a 3rd party lib has done this the wrong way you can always fix that by overriding the property assignment with a new one using Object.defineProperty
.
from ngrid.
No worries. I agree it's not a very important thing, and the issue actually inspired me to simply get rid of all the array prototype patching in my own project, so some good came of this.
from ngrid.
Related Issues (20)
- [Bug] material `define-...-theme` edits theme too excessive
- pbl-ngrid throwing error when changing pages on Angular project. HOT 2
- When using vScrollNone, grid is not visible when container has height unset or set to auto
- Infinite-scroll TS compile error
- Angular 13 support HOT 3
- In version 4.0 createRowEvent function sometimes crashes due to event.context == null HOT 9
- Allow positioning the paginator in the "outer top" section above the grid
- Cannot resolve type entity i31.ScrollingModule to symbol HOT 2
- Sticky columns set through directive cannot be "un-sticked" HOT 1
- In ngrid 5.0.0 resolving of PblNgridCellFactoryResolver fails in createComponent() HOT 7
- ag-grid like filter popup with ngrid
- Undefined rowContext on scroll and cell focus is not correct
- Wrong context row data in TargetEventsPlugin with vScrollAuto and RouteReuseStrategy
- invalidateColumns breaks other tables when used with RouteReuseStrategy
- columnResize subscription
- Issue double clicking column header border to 'resize' to content width HOT 1
- Dynamic template based on column configuration
- PblNgridCellEvent rowIndex not matching _rowIndex inside PblNgridRowComponent
- Getting started HOT 1
- Compatibility with Angular 16/17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngrid.