elm-habitat
Advanced tools
Comparing version 0.0.1 to 0.1.0
@@ -1,2 +0,2 @@ | ||
var e=function(e){var r=e.selector,t=[];if(!r)throw Error("Please specify a selector.");return[].forEach.call(document.querySelectorAll(r),function(e){t.push(e)}),t};module.exports=function(r){var t=r;return{render:function(r){void 0===r&&(r={});var n=r.selector;void 0===n&&(n=null);var o=e({selector:n}),c=function(){if(o.length>0){var r=e({selector:n});return preactRender(t,r)}};c(),document.addEventListener("DOMContentLoaded",c),document.addEventListener("load",c)}}}; | ||
var e={selector:"",clean:!1,clientSelect:!1},n=function(e){var n=e.selector,t=[];if(!n||""===n)throw Error("Please specify a selector.");return document.querySelectorAll(n).forEach(function(e){t.push(e)}),t},t=function(e,n,t){if(!e||!e.init)throw Error("You did not pass in an Elm app, or there is no init function for the Elm app you passed in. This commonly happens when you pass in the Elm topmost import directly, but you should be passing in Elm.Main or Elm.Elm.Main.");var r=[];return n.forEach(function(n){var i=n;if(console.log({hostNode:i}),!("_habitat"in i)){i._habitat=!0;var a=o(n,t)||t,l=e.init({node:i,flags:a});r.push(l)}}),r},o=function(e,n){return{}};module.exports=function(o){var r=o;return{render:function(o){var i=void 0===o?e:o,a=i.selector,l=i.defaultFlags,s=n({selector:a}),u=function(){if(s.length>0){var e=n({selector:a});return console.log("Will render"),t(r,e,l)}return[]};return document.addEventListener("DOMContentLoaded",u),document.addEventListener("load",u),u()}}}; | ||
//# sourceMappingURL=elm-habitat.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.elmHabitat=t()}(this,function(){var e=function(e){var t=e.selector,n=[];if(!t)throw Error("Please specify a selector.");return[].forEach.call(document.querySelectorAll(t),function(e){n.push(e)}),n};return function(t){var n=t;return{render:function(t){void 0===t&&(t={});var r=t.selector;void 0===r&&(r=null);var o=e({selector:r}),c=function(){if(o.length>0){var t=e({selector:r});return preactRender(n,t)}};c(),document.addEventListener("DOMContentLoaded",c),document.addEventListener("load",c)}}}}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.elmHabitat=n()}(this,function(){var e={selector:"",clean:!1,clientSelect:!1},n=function(e){var n=e.selector,t=[];if(!n||""===n)throw Error("Please specify a selector.");return document.querySelectorAll(n).forEach(function(e){t.push(e)}),t},t=function(e,n,t){if(!e||!e.init)throw Error("You did not pass in an Elm app, or there is no init function for the Elm app you passed in. This commonly happens when you pass in the Elm topmost import directly, but you should be passing in Elm.Main or Elm.Elm.Main.");var r=[];return n.forEach(function(n){var i=n;if(console.log({hostNode:i}),!("_habitat"in i)){i._habitat=!0;var a=o(n,t)||t,l=e.init({node:i,flags:a});r.push(l)}}),r},o=function(e,n){return{}};return function(o){var r=o;return{render:function(o){var i=void 0===o?e:o,a=i.selector,l=i.defaultFlags,u=n({selector:a}),c=function(){if(u.length>0){var e=n({selector:a});return console.log("Will render"),t(r,e,l)}return[]};return document.addEventListener("DOMContentLoaded",c),document.addEventListener("load",c),c()}}}}); | ||
//# sourceMappingURL=elm-habitat.umd.js.map |
{ | ||
"name": "elm-habitat", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "Helpers for mounting Elm applications in specific parts of the DOM.", | ||
@@ -8,5 +8,6 @@ "main": "dist/elm-habitat.js", | ||
"module": "dist/elm-habitat.mjs", | ||
"source": "src/index.js", | ||
"source": "src/index.ts", | ||
"scripts": { | ||
"build": "npm-run-all clean bundle:prod size", | ||
"link-example": "cp dist/elm-habitat.js example/src/lib/elm-habitat.js", | ||
"clean": "rimraf dist/", | ||
@@ -17,3 +18,4 @@ "bundle:prod": "microbundle build", | ||
"release": "npm t && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish", | ||
"test": "npm run build" | ||
"test": "npm run build", | ||
"watch": "tsc --watch" | ||
}, | ||
@@ -66,3 +68,6 @@ "bundlesize": [ | ||
"rimraf": "^2.6.2" | ||
}, | ||
"dependencies": { | ||
"typescript": "^3.1.4" | ||
} | ||
} |
@@ -9,4 +9,11 @@ # elm-habitat | ||
## Credits, Thanks, Inpsiration | ||
## Common Runtime | ||
By default, bundling separate Elm Applications will have otherwise "shared runtime" code be separate. | ||
To avoid that, you can use the elm-webpack-loader. | ||
## Examples | ||
## Credits, Thanks, Inspiration | ||
- Inspired by [preact-habitat](https://github.com/zouhir/preact-habitat) | ||
@@ -13,0 +20,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24255
13
172
23
1
1
+ Addedtypescript@^3.1.4
+ Addedtypescript@3.9.10(transitive)