![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.
@a-la/import
Advanced tools
@a-la/import
is a a set of rules for alamode
to transpile an import
statement into require
in Node.js.
À La Mode is a RegExp-based transpiler which works faster than AST-based transpilers such as @babel
, and occupies only 10KB of disk space.
yarn add -E @a-la/import
The ALaImport is the default export and an array containing a sequence of rules for Replaceable.
import ALaImport from '@a-la/import'
ALaImport
SequenceThe rule set exported as an array by ALaImport
has multiple regexes and replacer functions to match all possible cases.
/* yarn example/ */
import { Replaceable } from 'restream'
import ALaImport from '@a-la/import'
const STRING = `import aLaMode from 'alamode'
import ALaImport from "@a-la/import"
import App from 'koa'
`
;(async () => {
const stream = new Replaceable([
...ALaImport,
])
await new Promise((r, j) => {
stream.end(STRING, r)
stream.on('error', j)
})
stream.pipe(process.stdout)
})()
let aLaMode = require('alamode'); if (aLaMode && aLaMode.__esModule) aLaMode = aLaMode.default;
let ALaImport = require("@a-la/import"); if (ALaImport && ALaImport.__esModule) ALaImport = ALaImport.default;
let App = require('koa'); if (App && App.__esModule) App = App.default;
The set of rules changes import
to require
statements. When importing a default module, a check will be made to see if it was transpiled with Babel
which is indicated by the presence of the __esModule
property, and if it was, then the default
property is reassinged to the variable.
import aLaMode from 'alamode'
import scopeALaMode from "@a-la/import"
import { methodA, methodB } from 'alamode'
import { methodC, methodD as aliasD } from 'alamode'
import defaultALaMode, {
methodE, methodF,
} from 'alamode'
let aLaMode = require('alamode'); if (aLaMode && aLaMode.__esModule) aLaMode = aLaMode.default;
let scopeALaMode = require("@a-la/import"); if (scopeALaMode && scopeALaMode.__esModule) scopeALaMode = scopeALaMode.default;
const { methodA, methodB } = require('alamode')
const { methodC, methodD: aliasD } = require('alamode')
let defaultALaMode = require('alamode'); if (defaultALaMode && defaultALaMode.__esModule) defaultALaMode = defaultALaMode.default; const {
methodE, methodF,
} = defaultALaMode
The transform will attempt to preserve lines as they are for easier generation of source maps by alamode
. In future, this might change.
The named imports are only changed to replace as
into :
, otherwise the destructuring syntax is the same as for imports themselves.
import { test, test2,
test3 as alias3 }
from 'package'
const { test, test2,
test3: alias3 }
= require('package')
When there is a default import along with named once, the line numbers will be respected.
import def, {
test, test2,
test3 as alias3,
test4
as
alias4,
}
from
'package'
let def = require('package'); if (def && def.__esModule) def = def.default; const {
test, test2,
test3: alias3,
test4
:
alias4,
}
=
def
import defaultExport from "module-name"
import * as name from "module-name";
import { export } from "module-name";
import { export as alias } from "module-name";
import { export1 , export2 } from "module-name";
import { export1 , export2 as alias2 , [...] } from "module-name";
import defaultExport, { export [ , [...] ] } from "module-name";
import defaultExport, * as name from "module-name";
import "module-name";
var promise = import(module-name);
(c) À La Mode 2018
1.3.0
zoroaster@2.2
for mask testing.FAQs
RegExp rules to transpile import statements into require calls (used in ÀLaMode).
The npm package @a-la/import receives a total of 19 weekly downloads. As such, @a-la/import popularity was classified as not popular.
We found that @a-la/import 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.