-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build LABjs string from source #846
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Future Loading and Blocking JS | ||
|
||
This is based on the awesome [LABjs](https://github.com/getify/LABjs) package. | ||
|
||
TODO: Flesh out this README. :grin: | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
src: require("./string/src"), | ||
min: require("./string/min"), | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
console.log( | ||
"\n"+ | ||
"/*! LAB.js (LABjs :: Loading And Blocking JavaScript)\n"+ | ||
" v2.0.3 (c) Kyle Simpson\n"+ | ||
" MIT License\n"+ | ||
"*/\n"+ | ||
require("uglify-js").minify( | ||
require("fs").readFileSync("/dev/stdin", "utf-8") | ||
.replace(/\/\*!START_DEBUG(?:.|[\n\r])*?END_DEBUG\*\//g, ""), | ||
{fromString: true} | ||
).code | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"name": "flab", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😆 |
||
"version": "0.0.1", | ||
"description": "Future Loading and Blocking JS", | ||
"main": "index.js", | ||
"files": [ | ||
"index.js", | ||
"string" | ||
], | ||
"scripts": { | ||
"prepublish": "mkdir -p string && npm run build-src && npm run build-min", | ||
"build-src": "node stringify.js < LAB.src.js > string/src.js", | ||
"build-min": "node minify.js < LAB.src.js | node stringify.js > string/min.js", | ||
"clean": "rimraf string", | ||
"test": "echo \"No tests yet...\"" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/redfin/react-server.git" | ||
}, | ||
"keywords": [ | ||
"loading", | ||
"blocking", | ||
"js", | ||
"asynchronous", | ||
"loader" | ||
], | ||
"author": "Bo Borgerson", | ||
"license": "MIT", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apache 2? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LABjs is MIT. Can MIT be converted to Apache 2? |
||
"bugs": { | ||
"url": "https://github.com/redfin/react-server/issues" | ||
}, | ||
"homepage": "https://github.com/redfin/react-server#readme", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. out-of-scope: should we update all of the modules to point to react-server.io as their homepage? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, maybe... 🤔 |
||
"devDependencies": { | ||
"rimraf": "^2.5.4", | ||
"uglify-js": "^2.7.5" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
console.log( | ||
'module.exports = '+ | ||
require("fs").readFileSync("/dev/stdin", "utf-8") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like I should know this, but... do we officially support windows? Seems like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ugh... this is only at build time. Do we need to support windows even for that? 😩 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ignore the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
.replace(/\\/g, '\\\\') | ||
.replace(/"/g, '\\"') | ||
.replace(/^/gm, '"') | ||
.replace(/$/gm, '\\n"+')+ | ||
'"";' | ||
); |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😆