MithrilJS / mithril.js

A JavaScript Framework for Building Brilliant Applications

Home Page:https://mithril.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

babel@7.20.7 breaks our JSX fragments

pdfabbro opened this issue · comments

Hi There,

Based on this issue babel/babel#15353 (comment) the mithril documentation found here needs an update https://mithril.js.org/jsx.html. The single quotes should be removed from around the bracket. My working file is as follows:

module.exports = {
	presets: ["@babel/preset-env"],
	plugins: [
		"@babel/plugin-proposal-object-rest-spread",
		["babel-plugin-root-import", { rootPathSuffix: "src" }],
		[
			"@babel/plugin-transform-react-jsx",
			{
				pragma: "m",
				pragmaFrag: "["
			}
		]
	],
	sourceMaps: true,
	retainLines: true,
	env: {
		test: {
			plugins: ["@babel/plugin-transform-modules-commonjs"]
		}
	}
};

Thanks for the heads up @pdfabbro. Let's wait for babel/babel#15353 to settle before we act on this.

They'll be reverting the breaking change. They haven't committed yet to enshrine passing a string there. I'll ping them again in a few days (if I forget, please ping me here).

It turns out we already have m.Fragment = '[' defined... I've been out of the loop and didn't know about it.