{"id":13628022,"url":"https://github.com/MithrilJS/mopt","last_synced_at":"2025-04-17T00:33:02.695Z","repository":{"id":57148218,"uuid":"43401975","full_name":"MithrilJS/mopt","owner":"MithrilJS","description":"Babel plugin to optimize Mithril m() calls into simple JS objects for speed","archived":true,"fork":false,"pushed_at":"2017-06-04T20:18:48.000Z","size":257,"stargazers_count":42,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-14T13:38:34.739Z","etag":null,"topics":["babel","build","mithril","optimization"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MithrilJS.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-30T00:18:41.000Z","updated_at":"2024-12-17T11:11:09.000Z","dependencies_parsed_at":"2022-08-30T15:10:21.109Z","dependency_job_id":null,"html_url":"https://github.com/MithrilJS/mopt","commit_stats":null,"previous_names":["tivac/mithril-objectify"],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MithrilJS%2Fmopt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MithrilJS%2Fmopt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MithrilJS%2Fmopt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MithrilJS%2Fmopt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MithrilJS","download_url":"https://codeload.github.com/MithrilJS/mopt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249293153,"owners_count":21245687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["babel","build","mithril","optimization"],"created_at":"2024-08-01T22:00:43.060Z","updated_at":"2025-04-17T00:33:02.454Z","avatar_url":"https://github.com/MithrilJS.png","language":"JavaScript","readme":"mopt [![NPM Version](https://img.shields.io/npm/v/mopt.svg)](https://www.npmjs.com/package/mopt) [![NPM License](https://img.shields.io/npm/l/mopt.svg)](https://www.npmjs.com/package/mopt)\n=================\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.npmjs.com/package/mopt\" alt=\"NPM Downloads\"\u003e\n        \u003cimg src=\"https://img.shields.io/npm/dm/mopt.svg\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://travis-ci.org/MithrilJS/mopt\" alt=\"Build Status\"\u003e\n        \u003cimg src=\"https://img.shields.io/travis/MithrilJS/mopt/master.svg\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://david-dm.org/MithrilJS/mopt\" alt=\"Dependency Status\"\u003e\n        \u003cimg src=\"https://img.shields.io/david/MithrilJS/mopt.svg\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://david-dm.org/MithrilJS/mopt#info=devDependencies\" alt=\"devDependency Status\"\u003e\n        \u003cimg src=\"https://img.shields.io/david/dev/MithrilJS/mopt.svg\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nA [babel](babeljs.io) plugin to statically optimize [mithril](http://mithril.js.org) hyperscript function invocations.\n\n```js\n// This hyperscript function invocation\nm(\".fooga\");\n\n// Gets optimized into\nm.vnode(\"div\",undefined,{className:\"fooga\"},undefined,undefined,undefined);\n```\nPlease file an issue if you come across any cases that this doesn't handle, I'd love to improve the number of structures I can rewrite!\n\n## Mithril Version Warning\n\n`mopt` **only** works with `mithril@1.x`.\n\nFor optimizing `mithril@0.2.x` see [mithril-objectify](https://npmjs.com/mithril-objectify).\n\n## Installation\n\nInstall with npm\n\n`npm i mopt`\n\n## Usage with Babel\n\n### `.babelrc`\n\n```js\n// .babelrc\n{\n    \"plugins\": [ \"mopt\" ]\n}\n```\n\n### CLI\n\n`$ babel --plugins mopt script.js`\n\n### API\n\n```js\nrequire(\"babel-core\").transform(\"\u003ccode\u003e\", {\n  plugins: [ \"mopt\" ]\n});\n```\n\n## Usage with a bundler\n### Rollup - [`rollup-plugin-babel`](https://www.npmjs.com/package/rollup-plugin-babel)\n### Browserify - [`babelify`](https://www.npmjs.com/package/babelify)\n### WebPack - [`babel-loader`](https://www.npmjs.com/package/babel-loader)\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMithrilJS%2Fmopt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMithrilJS%2Fmopt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMithrilJS%2Fmopt/lists"}