Giter Site home page Giter Site logo

Eliminate shims in v2 about collections HOT 21 OPEN

montagejs avatar montagejs commented on August 28, 2024 1
Eliminate shims in v2

from collections.

Comments (21)

kriskowal avatar kriskowal commented on August 28, 2024 1

Version 2 is an alternate reality for this library, where I got rid of shims and factored out and replaced the change observer mechanism. Version 3 forks directly off of Version 1 and is a much less invasive change, which was necessary to retain a semblance of compatibility with Montage in production. V2 come from my fork https://github.com/kriskowal/collections and I maintain it.

from collections.

kriskowal avatar kriskowal commented on August 28, 2024 1

v2 was published as v2 on npm, although it is not the “latest” version. I am not an active maintainer on this project.

from collections.

kriskowal avatar kriskowal commented on August 28, 2024

The shims are pretty intrusive at the moment. I am considering an alternate design that would decouple the shims entirely, using separate modules for each of the operators like equals and compare.

I’m familiar with SES. To use Collections as is, the shim modules would need to be instantiated before initSES, and would need to be added to the table of approved globals.

from collections.

cspotcode avatar cspotcode commented on August 28, 2024

Thanks for the quick response.

Before adding the shims to the table of approved globals, I would want to audit collections's source code and make sure those shimmed methods are secure enough to be whitelisted.

I'm looking forward to seeing the alternate design with decoupled shims, if/when it sees the light of day.

Thanks again!

from collections.

cspotcode avatar cspotcode commented on August 28, 2024

Hello again, I've been working on a fork of collections that does not modify any global objects or prototypes. It's almost complete (cspotcode/collections#do-not-modify-builtins).

I noticed collections v2.0.1 is released. Is that version ready for prime time, or is it more of a beta? If it's ready for production use, I'm going to try making a version of v2 that doesn't modify any globals.

Thanks in advance.

from collections.

kriskowal avatar kriskowal commented on August 28, 2024

I intend to decouple v2 from modifying globals as much as possible. Some of this has landed in that branch. I expect that will just leave observable arrays monkey patching. The v2 branch is pre-beta and will not be published to the "latest" tag unless and until MontageJS elects to adopt it, which is unlikely and not soon. In the interim, adventurous users may npm install collections@future or collections@2.

from collections.

cspotcode avatar cspotcode commented on August 28, 2024

Ok, thanks for the info.

from collections.

dashed avatar dashed commented on August 28, 2024

+1. The shims are off putting which made me reconsider using this library.

from collections.

dantman avatar dantman commented on August 28, 2024

+1 the clone shim breaks Sequelize and I'm going to have to find a way to work around it.

from collections.

kriskowal avatar kriskowal commented on August 28, 2024

@dantman, try collections@2.

from collections.

dantman avatar dantman commented on August 28, 2024

@kriskowal Nope, it appears that array.clone still exists in 2.0.1 and Sequelize still dies in the same way.

from collections.

kriskowal avatar kriskowal commented on August 28, 2024

Ah, I see. There are unreleased changes in the v2 branch. Thanks.

from collections.

kriskowal avatar kriskowal commented on August 28, 2024

Try now. 2.0.2 does not have shims. Let me know how it goes; this is a pretty big change, and change observers are factored into another package.

from collections.

dantman avatar dantman commented on August 28, 2024

It looks like it works.

from collections.

Bazze avatar Bazze commented on August 28, 2024

So what is this 2.0.2 version actually? It's available through npm but I can't find any tag or similar for it here. How old is that version? What's missing compared to latest version? Is 2.0.2 actually the only way to get the collections package without the shims at the moment? Using the latest version, 5.0.5, breaks stuff in sails as mentioned in #162 and balderdashy/sails#2524 so I need to decide how to move forward.

from collections.

Bazze avatar Bazze commented on August 28, 2024

Thank you @kriskowal for the info!

from collections.

kriskowal avatar kriskowal commented on August 28, 2024

@marchant please consider closing this issue (I am not a collaborator on this repository). v2 exists and does not have shims. I’ll continue to maintain backward compatible minor and patch releases of v2, but v3 and forward are designed for Montage and do not break compatibility with v1 as much.

from collections.

AIRTucha avatar AIRTucha commented on August 28, 2024

I am sorry to trouble you, but I can not find the v2 at all. Is it removed?

from collections.

codebling avatar codebling commented on August 28, 2024

See also issues #36 #70 #94 #95 #116 #139 #145 #162 #165 #169 #178 #182 #185 #197 #215 #220 and PRs #94 #95 #116 #173 #189 #212. Branch v2 fixes these issues by avoiding global object modification.

from collections.

sgronblo avatar sgronblo commented on August 28, 2024

What's the latest status on this v2 branch being published officially? And what is the maintenance status of this project?

from collections.

hthetiot avatar hthetiot commented on August 28, 2024

For latest V2 update see PR here #189

from collections.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.