• This repository has been archived on 16/Sep/2021
  • Stars
    star
    371
  • Rank 111,009 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A lightweight, IE8+ JavaScript loader

NOTICE:

This repository has been archived and is not supported.

No Maintenance Intended


NOTICE: SUPPORT FOR THIS PROJECT HAS ENDED

This projected was owned and maintained by Walmart. This project has reached its end of life and Walmart no longer supports this project.

We will no longer be monitoring the issues for this project or reviewing pull requests. You are free to continue using this project under the license terms or forks of this project at your own risk. This project is no longer subject to Walmart's bug bounty program or other security monitoring.

Actions you can take

We recommend you take the following action:

  • Review any configuration files used for build automation and make appropriate updates to remove or replace this project
  • Notify other members of your team and/or organization of this change
  • Notify your security team to help you evaluate alternative options

Forking and transition of ownership

For security reasons, Walmart does not transfer the ownership of our primary repos on Github or other platforms to other individuals/organizations. Further, we do not transfer ownership of packages for public package management systems.

If you would like to fork this package and continue development, you should choose a new name for the project and create your own packages, build automation, etc.

Please review the licensing terms of this project, which continue to be in effect even after decommission.

Little Loader

A lightweight, IE8+ JavaScript loader that is actually tested...

Travis Status Coverage Status size size (gz)

Sauce Test Status

... with a very narrow set of objectives:

  • Tested all the way down to IE8
  • Reliably calls back after script loads
  • Captures script load errors down to IE8
  • Really, really small (clocking in at ~519 minified + gzipped bytes)
  • ... and that's it!

We currently test:

  • Karma - Travis: PhantomJS, Firefox
  • Selenium - Travis: PhantomJS, Firefox
  • Selenium - Sauce Labs:
    • Windows: Firefox, Chrome, IE8-11
    • Mac: Safari

Usage

Integration

Alone, little loader attaches to window._lload for loading your Javascript:

<script>
  window._lload("http://example.com/foo.js", function (err) {
    // `err` is script load error.
    // otherwise, foo.js is loaded!
  }/*, [optional context (`this`) variable here] */);
</script>

If you use an AMD bundling tool (like RequireJS):

define(["little-loader"], function (load) {
  load("http://example.com/foo.js", function (err) {
    // ... your code ...
  });
});

If you use a CommonJS bundling tool (like Webpack):

var load = require("little-loader");

load("http://example.com/foo.js", function (err) {
  // ... your code ...
});

Calling

Little loader can be called in a number of ways:

// Load a script and don't worry about a callback
load("http://foo.com/foo.js");

// Load, then callback (and optionally with context.)
load("http://foo.com/foo.js", callback);
load("http://foo.com/foo.js", callback, this);

// Load, call `setup(script)` on the script tag before insertion, no callback
load("http://foo.com/foo.js", {
  setup: setup,         // setup(script)
  context: this         // (optional)
});

// Load, call `setup(script)` on the script tag before insertion, then
// callback with context (two ways)
load("http://foo.com/foo.js", {
  setup: setup,         // setup(script)
  callback: callback,   // callback(err)
  context: this
});
load("http://foo.com/foo.js", {
  setup: setup,         // setup(script)
  callback: callback    // callback(err)
}, this);

Installation

CDN

For the ready-to-use version from CDN, use

<!-- Minified, production version -->
<script src="https://unpkg.com/little-loader@VERSION/dist/little-loader.min.js"></script>
<!-- Development version -->
<script src="https://unpkg.com/little-loader@VERSION/lib/little-loader.js"></script>

NPM

To include little-loader as part of your own build, first install from npm:

$ npm install --save little-loader

The library has a UMD wrapper and should work like any other AMD or CommonJS module with your favorite bundling tool (Webpack, RequireJS, etc.).

If you do not use a CommonJS or AMD loader tool, then little loader will be exposed as the window._lload variable.

Development

Development requires two installation steps:

$ npm install
$ npm run install-dev

After that, run the full lint + tests:

$ npm run check

You can try out the live functional tests fixtures with our static server:

$ npm run server

and navigate to: http://127.0.0.1:3001/test/func/fixtures/

Tests

We run both Karma (client-side) and Selenium (functional) tests.

The Karma tests are faster and more flexible, but slightly "off" from real-world use because of their execution environment. We use Karma tests to kick the tires on our AMD and CommonJS abstractions and little, one-off use case scenarios.

The Selenium tests are slower and klunky, but they are the "real deal" executing little-loader in exactly the same manner as would be used on a real web page. We use Selenium to test a core set of fundamental use cases across all browsers in our matrix.

Parallel Local Tests

Our CI is setup with a specific optimized parallel workflow. To run parallel functional tests in development, here are some helper tasks...

Local Browsers

$ TEST_PARALLEL=true \
  builder envs test-func-local \
  --setup=setup-local \
  --buffer \
  '[ { "TEST_FUNC_PORT": 3030, "ROWDY_SETTINGS":"local.phantomjs" },
     { "TEST_FUNC_PORT": 3040, "ROWDY_SETTINGS":"local.firefox" },
     { "TEST_FUNC_PORT": 3050, "ROWDY_SETTINGS":"local.chrome" }
   ]'

The TEST_PARALLEL flag indicates to not do in-test setup which would conflict with other test processes. We also rely on setting TEST_FUNC_PORT specifically to non-conflicting ports with at least 3 ports total from the starting number for the two separate static servers we run during tests.

Sauce Labs

To run Sauce Labs tests in parallel from a local machine, you'll need the sc binary, which can be force installed with:

$ SAUCE_CONNECT_DOWNLOAD_ON_INSTALL=true npm install sauce-connect-launcher

After this, the module is available at: node_modules/sauce-connect-launcher/sc/*/bin/sc

From there, you can invoke our helper local commands:

$ TEST_PARALLEL=true \
  SAUCE_USERNAME=<INSERT_USERNAME> \
  SAUCE_ACCESS_KEY=<INSERT_ACCESS_KEY> \
  builder envs test-func-sauce \
  --setup=setup-sauce \
  --buffer \
  '[ { "TEST_FUNC_PORT": 3030, "ROWDY_SETTINGS":"sauceLabs.IE_8_Windows_2008_Desktop" },
     { "TEST_FUNC_PORT": 3040, "ROWDY_SETTINGS":"sauceLabs.IE_9_Windows_2008_Desktop" },
     { "TEST_FUNC_PORT": 3050, "ROWDY_SETTINGS":"sauceLabs.IE_10_Windows_2012_Desktop" }
   ]'

Releases

IMPORTANT - NPM: To correctly run preversion your first step is to make sure that you have a very modern npm binary:

$ npm install -g npm

First, you can optionally edit and commit the project history.

$ vim HISTORY.md
$ git add HISTORY.md
$ git commit -m "Update history for VERSION"

Now we're ready to publish. Choose a semantic update for the new version. If you're unsure, read about semantic versioning at http://semver.org/

$ npm version VERSION|major|minor|patch -m "Version %s - INSERT_REASONS"

Now postversion will push to git and publish to NPM.

More Repositories

1

lacinia

GraphQL implementation in pure Clojure
Clojure
1,798
star
2

thorax

Strengthening your Backbone
JavaScript
1,324
star
3

react-ssr-optimization

React.js server-side rendering optimization with component memoization and templatization
JavaScript
821
star
4

electrode

Electrode - Application Platform on React/Node.js powering Walmart.com
446
star
5

json-to-simple-graphql-schema

Transforms JSON input into a GraphQL schema
JavaScript
279
star
6

eslint-config-defaults

A composable set of ESLint defaults
JavaScript
229
star
7

lumbar

Modular javascript build tool
JavaScript
226
star
8

datascope

Visualization of Clojure data structures using Graphviz
Clojure
206
star
9

lacinia-pedestal

Expose Lacinia GraphQL as Pedestal endpoints
Clojure
197
star
10

bigben

BigBen - a generic, multi-tenant, time-based event scheduler and cron scheduling framework
Kotlin
196
star
11

concord

Concord - workflow orchestration and continuous deployment management
Java
195
star
12

kubeman

The Hero that Kubernetes deserves
TypeScript
164
star
13

system-viz

Graphviz visualization of a component system
Clojure
159
star
14

react-native-orientation-listener

A react-native library for obtaining current device orientation
Java
151
star
15

thorax-seed

JavaScript
131
star
16

vizdeps

Visualize Leiningen dependencies using Graphviz
Clojure
130
star
17

mupd8

Muppet
Scala
126
star
18

active-status

Present status of mulitple 'jobs' in a command line tool, using terminal capability codes
Clojure
118
star
19

schematic

Combine configuration with building a Component system
Clojure
104
star
20

easy-fix

easy-fix: run integration tests like unit tests
JavaScript
101
star
21

dyn-edn

Dynamic properties in EDN content
Clojure
94
star
22

fruit-loops

Server-side jQuery API renderer.
JavaScript
89
star
23

generator-thorax

Thorax yeoman generator
JavaScript
87
star
24

walmart-cla

Walmart Contributor License Agreement Information
85
star
25

react-native-cropping

Cropping components for react-native
JavaScript
68
star
26

curved-carousel

An infinitely scrolling carousel with configurable curvature
JavaScript
64
star
27

walmart-api

API wrapper for the public Walmart Labs API
JavaScript
62
star
28

gozer

Open source library to parse various X12 file formats for retail/supply chain
Java
60
star
29

cookie-cutter

An opinionated micro-services framework for TypeScript
TypeScript
57
star
30

mock-server

SPA application debug proxy server
JavaScript
56
star
31

test-reporting

Tiny library to assist with reporting some context when a test fails
Clojure
53
star
32

container-query

A responsive layout helper based on the width of the container
JavaScript
52
star
33

react-native-platform-visible

A very simple component visibility switch based on Platform
JavaScript
49
star
34

eslint-config-walmart

A set of default eslint configurations, Walmart Labs style.
JavaScript
48
star
35

clojure-game-geek

Example source code for the Lacinia tutorial
Clojure
47
star
36

babel-plugin-react-cssmoduleify

Babel plugin to transform traditional React element classNames to CSS Modules
JavaScript
45
star
37

generator-release

Yeoman generator for handling Bower/NPM releases.
JavaScript
45
star
38

costanza

Frontend error tracking toolkit: Own your own domain
JavaScript
35
star
39

zFAM

z/OS-based File Access Manager
Assembly
35
star
40

nightcall

Automated Enumeration Script for Pentesting
Python
34
star
41

cond-let

A useful merge of cond and let
Clojure
30
star
42

static

JavaScript
26
star
43

bolt

[DEPRECATED] an opinionated meta task runner for components.
JavaScript
24
star
44

shared-deps

Leiningen plugin to allow sub-modules to more easily share common dependencies
Clojure
24
star
45

ridicule

Mocking everything
JavaScript
22
star
46

linearroad

Walmart version of the Linear Road streaming benchmark.
Java
22
star
47

backbone-historytracker

Backbone plugin for navigation direction tracking
JavaScript
22
star
48

zECS

z/OS-based Enterprise Cache Service
COBOL
21
star
49

pulsar

Text-based dashboard for Elixir CLIs
Elixir
20
star
50

react-native-image-progressbar

An image based progress bar
JavaScript
20
star
51

layout

A simple responsive layout helper
CSS
17
star
52

zUID

z/OS-based Unique Identifier generator
Assembly
16
star
53

showcase-template

A starter template for a showcase of React components
CSS
16
star
54

grunt-release-component

Grunt release helper for bower components
JavaScript
15
star
55

anomaly-detection-walmart

Python
14
star
56

partnerapi_sdk_dotnet

Walmart Partner API SDK for .NET
C#
14
star
57

circus

External Webpack Component Plugin
JavaScript
13
star
58

concord-website

Documentation website source code for Concord
JavaScript
13
star
59

concord-plugins

Java
12
star
60

strati-functional

A lightweight collection of functional classes used to complement core Java.
Java
12
star
61

thorax-boilerplate

A boilerplate project for Thoroax
JavaScript
11
star
62

nocktor

nocktor - your nock doctor
JavaScript
11
star
63

getting-started

How to get started with the WalmartLabs API and tooling
9
star
64

LinearGenerator

Reworked data generator for LinearRoad streaming benchmark that no longer needs mitsim or any database.
Java
9
star
65

json-patchwork

JavaScript
9
star
66

object-diff

A Go library implementing object wise diff and patch.
Go
8
star
67

small-world-graph

Graphing as in Data
C++
8
star
68

chai-shallowly

A chai assertion plugin for enzyme.
JavaScript
8
star
69

typeahead.js-legacy

typeahead.js is a fast and fully-featured autocomplete library
JavaScript
8
star
70

child-pool

child_process pool implementation
JavaScript
7
star
71

thorax-todos

JavaScript
6
star
72

hula-hoop

Server-side rendering components for Thorax + Hapi stacks.
JavaScript
6
star
73

apache-http-client

A Clojure ring compatible http interface for Apache HttpClient
Clojure
5
star
74

lumbar-loader

JavaScript
5
star
75

krabby

JavaScript
4
star
76

js-conceptualizer

JS Conceptualizer is a bit of client-side Javascript that parses out concepts, particularly proper nouns, from HTML on a web page.
JavaScript
4
star
77

babel-plugin-i18n-id-hashing

Namespace the ID of React-Intl keys
JavaScript
4
star
78

express-example

A crazy simple example of using the Walmart API with express
JavaScript
4
star
79

wml-coding-std

A module for keeping consistent JS coding standards at WML
JavaScript
3
star
80

nativedriver

native driver for UI automation
Objective-C
3
star
81

was

Go
3
star
82

thorax-rails

Ruby
3
star
83

hapi-example

A crazy simple example of using the Walmart API with hapi
JavaScript
3
star
84

lumbar-long-expires

Long expires cache buster plugin for Lumbar
JavaScript
3
star
85

component-scan

A component scanner for React
JavaScript
3
star
86

scanomatic-server

Scan-O-Matic Node Server
JavaScript
3
star
87

hadoop-openstack-swifta

hadoop-openstack-swifta
Java
3
star
88

SDJSBridge

Native/Hybrid Javascript Bridge
Objective-C
2
star
89

cordova-starter-kit

A starter kit for using Cordova and the Walmart API
JavaScript
2
star
90

priorityY

Priority Based Connected Components
Python
2
star
91

bolt-standard-flux

electrode bolt standard configs and tasks for flux architecture.
JavaScript
1
star
92

github-util

Github utility methods.
JavaScript
1
star
93

lumbar-tester

Unit testing plugin for Lumbar
JavaScript
1
star
94

apidocs

HTML
1
star
95

circus-stylus

Stylus linker for Circus components
JavaScript
1
star
96

SDUserActivity

An simplified interface for NSUserActivity for apps that want to participate in handoff.
Objective-C
1
star
97

walmartlabs.github.io

Helper to redirect to code.walmartlabs.com
HTML
1
star
98

BurpSuiteDynamicSessionTracker

BurpSuite extension for tracking and manipulating dynamic session cookies
Java
1
star
99

bolt-cli

[DEPRECATED] bolt command line interface.
JavaScript
1
star
100

phoenix-build

Common build libraries for Phoenix projects
JavaScript
1
star