
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
normalize-transforms
Advanced tools
These are all the transforms available for both the normalization proxy and nlz-build
.
Unlike Component, Browserify, and other build systems,
transforms are included automatically,
and all transforms are stored in a single repository.
There are a couple of reasons for this:
This middleware system is a more complicated than other middleware systems:
The purpose of normalization is for everyone to be on the same page. It's counter productive to have different semantics for the same transform across applications.
PRs for additional transforms are welcomed as long as there's a valid use-case and people would actually use it.
Given a source file such as template.html
,
the walker transforms the file based on additional .<extensions>
.
For example, template.html.js
will export the HTML string as a JS string.
This is superior because:
For example, template.jade.js
would return a jade render function whereas template.jade.html.js
will return the jade template as a compiled string.
You can also compose multiple transforms together.
For example, .jade.html
is its own transform and so is .html.js
.
Together, .jade.html.js
has a very specific meaning.
In other words, .jade.html.js
is a composition of transforms!
Unlike other build systems and package managers,
transforms have the ability to inject required dependencies into your application,
making development easier in general.
For example, to use .jade.js
, you need to jade runtime.
The Jade transform will automatically inject the runtime by compiling your jade template to something like this:
var jade = require('https://nlz.io/github/visionmedia/jade/1/lib/runtime.js')
module.exports = function template(locals) {
// compiled jade
}
All CSS is automatically prefixed using autoprefixer. No extensions are necessary. The default options are used.
A subset of specification compliant rework plugins are included. These are essentially a subset of myth. These are:
All ES6 modules are automatically transpiled to CommonJS modules using es6-module-jstransform. This will be disabled by default once ES6 modules are widely supported by browsers.
All code that uses generators are automatically transformed using regenerator. This will be disabled by default once generators are widely supported by browsers.
.<mime:text/*>.js
All extensions whose corresponding MIME type is text/*
are automatically transformed to a JS string using JSON.stringify()
unless superceded by another transform.
This is included in normalize-walker
.
.json.js
Transforms JSON files to a JS object.
This is included in normalize-walker
.
.jade.html
Compile jade templates to an HTML string.
.jade.js
Compile jade templates to a function.
.(md|markdown).html
Compile markdown templates to an HTML string using marked.
.jsx.js
Compile React .jsx
templates to JS.
.html.domify.js
Compile an HTML string to an element using domify. This is useful for web components and templates.
var template = require('./template.html.domify.js')
document.body.appendChild(template.cloneNode(true))
FAQs
Normalize's default transforms via deps-walk
We found that normalize-transforms demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.