-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
Split out server/controller process from renderer process (and more) #86
base: master
Are you sure you want to change the base?
Conversation
+1 except for the original default screen of cat. Great work!! |
@bmathews is this LGTM? |
@mafintosh I'd say so, yeah. |
@freeall do you have any final comments on this? Otherwise I'm gonna merge it tomorrow |
I'm a little conflicted on this one. It's really good to see some activity on the project, and I love the fact that it's rewritten to React. On the other hand I don't like that in the same PR the code's been rewritten to ES6 and we now use Babel. If I were to comment on just the style it's more frontend javascript than node which is probably fine in itself, but it changes the whole codebase and I would rather have that discussion in a PR for itself. Just to get more activity on this I'd say we should merge it, though. Thoughts? |
@freeall I'd be happy to remove the Babel usage for everything other than the react compilation! It'll add some code, but shouldn't be too bad. Happy to fix/change/remove anything you're not stoked on, though. Thanks! |
It's kind of scary to make changes this big on an app that doesn't have a test suite, but I agree that forward momentum is also important. I'm not really a stakeholder here; just leaving my ¢¢.
Can you elaborate on this, @freeall? |
@bmathews Can't we remove Babel altogether? @mafintosh says that electron has es6 support Edit: misspelling |
@freeall We're taking advantage of electron's ES6 support and using a few extra babel transforms for things that aren't in it yet: @zeke 💯 The tricky part with the old code base was that the server and view were really coupled, so it would have been difficult to create any tests at all. After splitting these things up, we'll be in a much better place to add tests. |
ah i didn't notice that this changes all the code to es6. i'm 👎 on that in general. |
@mafintosh @freeall Thanks for the feedback! I'll drop the babel transforms for everything but the React JSX and we'll give it another review. |
the design is looking awesome though! really wanna pull that in. great job on that @bmathews |
@mafintosh @freeall Pushed changes that remove babel compilation for everything but the React JSX and I switched the eslint config to https://github.com/feross/standard instead of airbnb's preset. |
FWIW, we're using Electron for Webtorrent.app and it supports spreads and the rest operator natively (actually pretty useful). So you shouldn't need Babel for that. Also, instead of JSX you might consider substack's hyperx which just uses ES6 template strings so there's no preprocessor required. |
I hadn't seen hyperx before. I really like it. |
Why isn't it merged? ;< |
Too complicated (should have been small PRs) and now way out of sync. |
Yeah, it was a big architectural change needed to split out the view from the 'server' and still support the 'follow' functionality. I'm happy with my changes though. :) It solves about half of the open issues, and the VLC/MKV support is nice. |
@bmathews still, it doesn't merge cleanly and should all be squashed |
It did in February and can easily be squashed. That's the least of the
|
@bmathews I know this PR has been quiet a long time and I guess is sadly not getting merged. I haven't looked through the code - obviously there's a lot of it. But one of your comments above got me intrigued - you said "the VLC/MKV support is nice". I opened an issue to discuss how to support other codecs #124. Can you elaborate on how you managed VLC/MKV support, or point me in the direction of the right bit of code please? |
The architecture I put together allowed for swappable 'players'. E.g., the normal HTML https://github.com/bmathews/playback/blob/refactor-chimera-rebase/app/players/WebChimera.js It'd probably need a bit of work to resurrect at this point though, and I'd probably go down this route to improve performance: webtorrent/webtorrent-desktop#938 (comment) |
@bmathews Thanks loads for these links. I was totally unaware of WebChimera - looks awesome. I also wonder if a similar thing could be done with FFMPEG? I'm thinking FFMPEG decoding video to raw frames which are passed to Electron and then written pixel-by-pixel into a canvas element. If I've understand correctly, this is roughly what WebChimera is doing. I have a need to play some codecs which VLC does not handle e.g. Apple Prores4444 and JPEG2000 (used in Digital Cinema DCP format). Your comment you linked to about OpenGL is also interesting. Was the high CPU usage related to rendering the canvas in JS? Please excuse my newbie questions. This is an area I'm interested in but I have no knowledge at all of OpenGL and the like. I'm trying to feel out whether it'd take a massive amount of time for me to learn enough and implement to achieve what I'm after, and to what degree the foundations are already out there in the open source world. |
There's a lot here, but I'd like to get some feedback and have people test this out. This improves code quality, manageability, and stability/behavior of the app. Browse the code here: https://github.com/bmathews/playback/tree/refactor-rebase/app
The new command to run things is
npm run dev
Changes: