Coder Social home page Coder Social logo

meteor-lodash's People

Contributors

erasaur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

meteor-lodash's Issues

Can't use third parameter (thisArg) in lodash.forEach

The following code which should show a instead shows global this (e.g. Window).

        var self = "a";
        lodash.forEach([1], function() {
            console.log(this);
        }, self);

I inspected the definition of lodash.forEach via a script tag, then I found the following definition.

/**                                                                                                                    // 1
 * @license                                                                                                            // 2
 * lodash 3.10.1 <https://lodash.com/>                                                                                 // 3
 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>                                                // 4
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>                                                      // 5
 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors                            // 6
 * Available under MIT license <https://lodash.com/license>                                                            // 7
 */                                                                                                                    // 8

... snip ...

    function forEach(collection, iteratee) {                                                                           // 5987
      return (typeof iteratee == 'function' && isArray(collection))                                                    // 5988
        ? arrayEach(collection, iteratee)                                                                              // 5989
        : baseEach(collection, toFunction(iteratee));                                                                  // 5990
    }                                                                                                                  // 5991

The above code seems not to be included in https://github.com/lodash/lodash/blob/master/lodash.js.
So I'm confusing. I'm not sure about where I should report this issue ... anyway I report it to you.

lodash imports css rules

This package includes css files in '\lodash\vendor\firebug-lite\skin\xp' specifically 'firebug-1.3a2.css' includes rules for body and html that leads to unexpected behavior. Is there a particular reason for including the vendor skins?

The specific rule

html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: Lucida Grande, Tahoma, sans-serif;
    font-size: 11px;
    background: #fff;    
}

Force don't overwrite underscore

Hi,
Is there a way to not overwrite the _ of underscore package ?
I just want lodash calling lodash, and still use underscore calling _
Is it possible with your wrapper ?
Thanks

Update lodash version?

Seems the version of lodash is pretty out-dated .. any plans of updating this at all?

Hello there,

May I convince you to try rocket:module? It will share your lodash from NPM with all the Meteor packages of a given Meteor application at the same time so you don't have to wrap lodash from NPM inside of your meteor-lodash package.

This reduces the amount of maintenance that you need to do to publish new versions of lodash by 100%, while affording other Meteor package developers the freedom to use other NPM packages that may also depend on lodash from NPM.

There's no way you'd want to wrap all the NPM packages that depend on lodash from NPM into your meteor-lodash package.

rocket:module allows for Meteor packages to get and share external libraries from NPM, avoiding the pollution of the Atmosphere caused by Meteor packages that depend on the same NPM packages. Meteor's default behavior is to compile, save, and store an NPM package into each Meteor package during publication of the Meteor packages onto Atmosphere.

For example, if 10 Meteor packages in your application depend on 10 libraries from NPM, and those 10 NPM libraries all depend on React from NPM, then your application now has 10 copies of the React library...

That's 10 singleton React objects in your application.

React isn't meant to be used that way. That's way worse than having 10 versions of jQuery in the same application: $, $1, $2, $3, $4, $5, $6, $7, $8, $9, and $10.

To help the cause, use rocket:module to specify all your NPM dependencies. Once you've done that, rocket:module will handle the sharing of those NPM modules across your app's Meteor packages.

Small typo

... still possible for _ to be redefiend as underscore ...

Slightly unclear description of lodash in README.md

"A wrapper for Lo-Dash v3.1.0, a utility library built on top of Underscore.js."

implies that lodash uses underscore, rather than replaces it. It might be clearer if it was changed to something like:

"A wrapper for Lo-Dash v3.1.0, a replacement for the Underscore.js utility library."

Don't try to override _ by default

Hey,

In the discussion of "Investigate swapping underscore with Lo-dash in meteor", it's mentioned that meteor doesn't touch the existing underscore version because it may introduce bugs.

Though overriding _ is intended as the package exports an _, but it doesn't work and I think that's why everything is working correctly, else things could break if meteor code started to use lodash.
So for safety, I think recommended way to include lodash should be just declaring var _ = lodash in your js files , so the declaration is limited to file scope and that way you get to use lodash and meteor code gets to use underscore.

Thoughts?

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.