![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Async module definition for rails assets pipeline. It's simple, fast and can be used with assets pipeline manifest structure. For example you still can have your assets pipeline manifest but load several js files in async fashion base on your controller path.
Add this line to your application's Gemfile:
gem 'amd'
And then execute:
$ bundle
Or install it yourself as:
$ gem install amd
Require amd/amd
on your js manifest like this:
//application.js
//= require amd/amd
NOTE: If you're using Turbolinks
without jquery-turbolinks
make sure to add the guess_module
function to your page:changed
event handler.
and finally add this snippet to your layout's body tag:
<body ... data-action='<%= AMD::Engine.amd_module(self) %>'>
Now sit back and enjoy using AMD
.
By default amd
tries to load a js module based on your controller details for example for 'xyz/some_resource#indexcontroller and action,
amdtries to load a file with this address
/assets/xyz/amd/some_resource/index (
/assets` is the prefix of assets pipe line of rails)
the default module path construct like this:
# amd_dir is 'amd' by default
asset_path("#{controller_path}/#{amd_dir}/#{controller_name}/#{action}")
To define an AMD module you need to create file based on the described module path with .amd.(js|js.coffee)
or any lang prefix that you use.
AMD gem add these files to precompile list. AMD
gem has a simple DSL that you should use in your code in order to use a very basic dependency
injection for your module.
To define a module you can do as follow:
define('module_name', ['dependency_A', 'dependency_B'], function(dependency_a, dependency_b) {
// your module code.
return your_module_object;
});
You are probably familiar with this syntax.
NOTE: module_name should be the same as module_path, in face AMD
uses your module_name as module_path.
This is all you need but for an advance use, there is a require
function which load a module using its name.
You may need this
AMD is maintained and funded by Yellowen. Whenever a code snippet is borrowed or inspired by existing code, we try to credit the original developer/designer in our source code. Let us know if you think we have forgotten to do this, and we will do our best to locate the problem and fix it in a timely manner.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that amd 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.