Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
require-lazy
Advanced tools
A RequireJS plugin for lazy loading AMD modules packaged with r.js, automatically splitting packaged code in bundles, cache-breaking the bundles only when the code changes, and defining module metadata and module discovery in Javascript applications.
A RequireJS plugin for lazy loading AMD modules packaged with r.js, automatically splitting packaged code in bundles, cache-breaking the bundles only when the code changes, and defining module metadata and module discovery in Javascript applications.
Main module (main.js
):
define(["lazy!modules/m1", "lazy!modules/m2", "lazy!text!templates/faq.html"],
function(m1, m2, faq) {
...
});
In the simplest case where the modules main
, m1
, m2
have no common dependencies, Require-Lazy
build scripts will create 4 separate bundles. One will contain main.js
and lazy.js
, one m1.js
and all its dependencies, one m2.js
and all its dependencies and one text.js
and faq.html
.
The URL for each module will look like:
/scripts/app/m1-built.js?v=684beaf379a164c2d4044a74f22ffc6d
The v
request parameter is a hash of the contents of the built file, used as cache-breaker.
The lazy plugin will replace each lazy module with a lazy stub. The stub has (for the time)
one method, get()
that returns a promise for the real module:
m1.get().done(function(m) {
// here m is the real module
});
A more detailed discussion and an example project setup can be found in the examples/simple
directory.
This project requires, includes, or uses code from:
This project is an idea under development. While many things work, it is expected that many more will not. Even worse, some things may not work as expected. Moreover the code is not thoroughly tested yet.
However, I am quite satisfied with how things work at the moment; I do not expect any radical API/usage changes. This means that this project can be considered fairly stable API/usage-wise.
Ideas, critisism, comments, code contributions are all welcome!
FAQs
A RequireJS plugin for lazy loading AMD modules packaged with r.js, automatically splitting packaged code in bundles, cache-breaking the bundles only when the code changes, and defining module metadata and module discovery in Javascript applications.
We found that require-lazy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.