-
Notifications
You must be signed in to change notification settings - Fork 102
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
Bankai rewrite #241
Bankai rewrite #241
Conversation
lib/http-server.js
Outdated
var os = require('os') | ||
|
||
var selfsigned = require('selfsigned') | ||
var getPort = require('getPort') |
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.
$ node ../../choojs/bankai/bin.js app.js
module.js:529
throw err;
^
Error: Cannot find module 'getPort'
This require should be all lowercase getport
for case sensitive file systems
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.
Good catch; thanks!
Seems like tests are not passing for node 4 |
lib/reload-client.js
Outdated
|
||
function handleScripts () { | ||
log.info('scripts', 'reloading') | ||
window.location.reload() |
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.
Reloading causes a SSE connection broken error in console, at least in Firefox.
How about adding this?
window.addEventListener('beforeunload', function (event) {
source.close()
})
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.
Good call, fixed! :D
681fb7f
to
2cee009
Compare
Looks like this is caused by |
With this and @goto-bus-stop's work, Browserify is becoming the best choice again, like it used to be :) Big thanks Yosh, I can't wait to try this out. |
I may have the solution for your cursor problem. Wrote this a while back when I ran into similar problems. Not sure if it'll handle |
@thlorenz thanks for the pointer, fixed the cursor issue :D |
FWIW this doesn't work great with ~/oss/bankai $ ./bin.js build -d example
14:30:17 ✨ created: ./dist
14:30:17 🚨 bankai.asset: could not find a file for
14:30:17 ✨ created: ./dist/manifest.json
~/oss/bankai ±pr/241 $ echo $?
0 |
@jbergstroem !!! that's great news; I thought it might be a missing file, but |
There are some options that now are not supported by bankai. Are they completly erased now? for instance the |
This is also a bit concerning imo (slow): $ time node bin.js
Please specify a bankai command:
$ bankai <command>
For example:
$ bankai start index.js
Run bankai --help to see all options.
node bin.js 0.84s user 0.11s system 101% cpu 0.940 total
$ time npm help
<snip>
npm help 0.19s user 0.07s system 76% cpu 0.337 total |
@YerkoPalma Ports are now automatically generated ( @jbergstroem made the imports in |
I seem to be getting different hashing (clean repo). MacOS 10.13 17A362a, node 8.5.0: not ok 34 ·· ·· <script src="/scripts/c4bc18653915ae8c/bundle.js" defer>
---
operator: equal
expected: '<script src="/scripts/c4bc18653915ae8c/bundle.js" defer>'
actual: '<script src="/scripts/75023dc608219a4e/bundle.js" defer>'
at: assertHtml (/Users/jbergstroem/wrk/oss/bankai/node_modules/assert-html/index.js:82:15) |
I'm cool with conventions, I just didn't see it in the readme so I had to dig into the code to find out that the cli use by default |
@jbergstroem bizarre; that could only be if for some reason WASM is acting up, the input files have changed, or like the algo isn't working. Dep for that is in https://github.com/yoshuawuyts/buffer-graph/ and https://github.com/mafintosh/siphash24 - we might need to switch to blake2b tbh; will probably be more stable edit: it definitely sounds as if the files have somehow changed; looked at the WASM function and it should be deterministic. Urgh, I'm not sure why the input files would change tho :/ |
@yoshuawuyts you probs want this: --- a/test/service-worker.js 2017-09-20 18:39:16.000000000 -0300
+++ b/test/service-worker.js 2017-09-20 18:39:11.000000000 -0300
@@ -47,7 +47,7 @@
assert.ok(res.hash, 'output hash exists')
})
- compiler.script('bundle.js', function (err, res) {
+ compiler.scripts('bundle.js', function (err, res) {
assert.error(err, 'no error writing script')
rimraf.sync(tmpDirname)
})
@@ -72,7 +72,7 @@
assert.ok(res, 'output exists')
})
- compiler.script('bundle.js', function (err, res) {
+ compiler.scripts('bundle.js', function (err, res) {
assert.error(err, 'no error writing script')
rimraf.sync(tmpDirname)
}) ..and add it to |
At least the repo is intact: $ rm -rf node_modules && npm i -q && git reset --hard && node test/document.js
> [email protected] install /Users/jbergstroem/wrk/oss/bankai/node_modules/fsevents
> node install
[fsevents] Success: "/Users/jbergstroem/wrk/oss/bankai/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
added 885 packages in 46.893s
HEAD is now at e6f1152 make it fast
<snip>
not ok 31 ·· ·· <script src="/scripts/c4bc18653915ae8c/bundle.js" defer>
---
operator: equal
expected: '<script src="/scripts/c4bc18653915ae8c/bundle.js" defer>'
actual: '<script src="/scripts/75023dc608219a4e/bundle.js" defer>'
at: assertHtml (/Users/jbergstroem/wrk/oss/bankai/node_modules/assert-html/index.js:82:15)
stack: |-
Error: ·· ·· <script src="/scripts/c4bc18653915ae8c/bundle.js" defer>
at Test.assert [as _assert] (/Users/jbergstroem/wrk/oss/bankai/node_modules/tape/lib/test.js:212:54)
at Test.bound [as _assert] (/Users/jbergstroem/wrk/oss/bankai/node_modules/tape/lib/test.js:64:32)
at Test.equal.Test.equals.Test.isEqual.Test.is.Test.strictEqual.Test.strictEquals (/Users/jbergstroem/wrk/oss/bankai/node_modules/tape/lib/test.js:347:10)
at Test.bound [as equal] (/Users/jbergstroem/wrk/oss/bankai/node_modules/tape/lib/test.js:64:32)
at assertHtml (/Users/jbergstroem/wrk/oss/bankai/node_modules/assert-html/index.js:82:15)
at /Users/jbergstroem/wrk/oss/bankai/test/document.js:99:5
at /Users/jbergstroem/wrk/oss/bankai/index.js:127:5
at /Users/jbergstroem/wrk/oss/bankai/lib/queue.js:24:5
at Array.forEach (<anonymous>)
at Queue.ready (/Users/jbergstroem/wrk/oss/bankai/lib/queue.js:23:13)
... |
This looks amazing! So excited to swap it out in my current projects. Would be nice if there was a quick JS API migration guide... should I just copy over the contents of |
@s3ththompson oh boy; yeah so the whole API was rewritten from scratch. I'm not sure how much of a migration guide could exist, I'd mostly just suggest to read the docs. That said, we should probably document the different directories we look for; same for files. Probably also document some of the flags that aren't documented yet ( |
@jondashkyle thanks for pointing these out!
Hope this makes sense; thanks again for chiming in! ✨ |
Hmmmmm, we definitely seem to be having some sort of race condition in our test somewhere. Something is throwing off the hash of |
var url = req.url | ||
compiler.documents(url, function (err, node) { | ||
if (err) { | ||
return compiler.documents('/404', function (err, node) { |
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.
i was just looking this over trying to implement a default: you've got two err
, the other one should probably be error
or something
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.
o/ Thanks for reporting - this is fine tho! The closures work alright in this case; there's no bugs here (:
Soooo, all boxes are ticked for an initial beta release? Can people please verify this works on their code? Biggest follow ups for next patches in the beta will be:
Holler if I've missed anything! Thanks all 😁 |
TESTS ARE PASSING. SSR RELOADING WORKS. The time for final reviews is now. Unless something is totally broken for someone here, we should be good to merge and put out an initial beta release! 🎉 |
@yoshuawuyts errors are still not being outputted, both for |
@yoshuawuyts same wasm RangeError with blake2b (will open issue). can we start with a pure JS solution and upgrade to wasm when the kinks are worked out? i think there are still some subtle issues with wasm heap size that require some investigation... FWIW, @jbergstroem's original PR worked for me with |
@yoshuawuyts sorry to say that hashing still seems to be a problem. I don't have too much time to dedicate to this but I'll make an attempt at debugging it soon. Edit: I guess this doesn't have too big a significance seeing how its primary job is bundling assets, not consistently naming folders. I'd expect an issue to be opened though. |
@ajoslin you're totally right; hope this is better! |
0976974
to
8aef434
Compare
Okay, so I'm not thrilled about the lastest pass on errors - but getting it 100% right means implementing proper progress bar logic, more control over re-rendering, and a partial rewrite of the way we create UI (might need to ditch So kinda feel that for now error handling is good enough for a beta; going to fix the blake2b error and then we should be good! |
@s3ththompson reverted the change, range error should be fixed again! time to releaseWelp, that concludes this lil episode. Gonna merge this patch and publish as a beta release. Any feedback can be sent to #246. Thanks! |
📦 |
@yoshuawuyts RangeError fixed! thank you! |
Everything is new! Would be cool if people could take this for a test ride so we can fix bugs. Thanks!
Bankai start
Bankai build
Known issues
SIGTERM
can leave the cursor as hiddendocument
can crash, causing stale builds