Skip to content
Snippets Groups Projects
Verified Commit 2c7fd167 authored by sunpoet's avatar sunpoet
Browse files

www/rubygem-importmap-rails: Add rubygem-importmap-rails 1.0.1

Import maps let you import JavaScript modules using logical names that map to
versioned/digested files -- directly from the browser. So you can build modern
JavaScript applications using JavaScript libraries made for ESM without the need
for transpiling or bundling.This frees you from needing Webpack, Yarn, npm, or
any other part of the JavaScript toolchain. All you need is the asset pipeline
that's already included in Rails.

With this approach you'll ship many small JavaScript files instead of one big
JavaScript file. Thanks to HTTP/2 that no longer carries a material performance
penalty during the initial transport, and in fact offers substantial benefits
over the long run due to better caching dynamics. Whereas before any change to
any JavaScript file included in your big bundle would invalidate the cache for
the the whole bundle, now only the cache for that single file is invalidated.

There's native support for import maps in Chrome/Edge 89+, and a shim available
for any browser with basic ESM support. So your app will be able to work with
all the evergreen browsers.

WWW: https://github.com/rails/importmap-rails
parent 1f4cc8f0
Branches
Tags
No related merge requests found
......@@ -1952,6 +1952,7 @@
SUBDIR += rubygem-httpclient
SUBDIR += rubygem-httpi
SUBDIR += rubygem-hurley
SUBDIR += rubygem-importmap-rails
SUBDIR += rubygem-innate
SUBDIR += rubygem-jekyll
SUBDIR += rubygem-jekyll-sanity
......
# Created by: Po-Chuan Hsieh <sunpoet@FreeBSD.org>
PORTNAME= importmap-rails
PORTVERSION= 1.0.1
CATEGORIES= www rubygems
MASTER_SITES= RG
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Use ESM with importmap to manage modern JavaScript in Rails without transpiling or bundling
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/MIT-LICENSE
BROKEN_RUBY26= yes
RUN_DEPENDS= rubygem-actionpack70>=6.0.0:www/rubygem-actionpack70 \
rubygem-railties70>=6.0.0:www/rubygem-railties70
USES= gem
USE_RUBY= yes
NO_ARCH= yes
.include <bsd.port.mk>
TIMESTAMP = 1641045742
SHA256 (rubygem/importmap-rails-1.0.1.gem) = ddbf08621a8db64e7680d1dd39ad3d1be4082377c48448782c3419cb545884f0
SIZE (rubygem/importmap-rails-1.0.1.gem) = 67072
Import maps let you import JavaScript modules using logical names that map to
versioned/digested files -- directly from the browser. So you can build modern
JavaScript applications using JavaScript libraries made for ESM without the need
for transpiling or bundling.This frees you from needing Webpack, Yarn, npm, or
any other part of the JavaScript toolchain. All you need is the asset pipeline
that's already included in Rails.
With this approach you'll ship many small JavaScript files instead of one big
JavaScript file. Thanks to HTTP/2 that no longer carries a material performance
penalty during the initial transport, and in fact offers substantial benefits
over the long run due to better caching dynamics. Whereas before any change to
any JavaScript file included in your big bundle would invalidate the cache for
the the whole bundle, now only the cache for that single file is invalidated.
There's native support for import maps in Chrome/Edge 89+, and a shim available
for any browser with basic ESM support. So your app will be able to work with
all the evergreen browsers.
WWW: https://github.com/rails/importmap-rails
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment