-
Notifications
You must be signed in to change notification settings - Fork 210
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
Gl puppeteer #1007
Gl puppeteer #1007
Conversation
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
Well, figuring out how to run our |
Oh wow. Can you show an image output by it in node? Cool!!!
…On Thu, Apr 11, 2019, 12:56 PM Varun Gupta ***@***.***> wrote:
@tech4GT <https://github.com/tech4GT> requested your review on: #1007
<#1007> Gl puppeteer.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#1007 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ6thetA79Bfh88-D06IOEROpYn6Gks5vf3cigaJpZM4cqaMw>
.
|
Wow! How generalizable is this to the webgl module?
…On Thu, Apr 11, 2019, 1:08 PM Varun Gupta ***@***.***> wrote:
Oh, got the grid image!
[image: image_0]
<https://user-images.githubusercontent.com/25617855/55980777-d50f6200-5cb2-11e9-861a-531bd1e9ff99.png>
[image: image_1]
<https://user-images.githubusercontent.com/25617855/55980781-d6d92580-5cb2-11e9-80e6-b5bdb1839baf.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1007 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ8Rd6uuWunQBpNHzE3xDMwmvvxT9ks5vf3oEgaJpZM4cqaMw>
.
|
I think we can generalise this. Maybe have this as a part of pixelmanipulation api itself. So any module can run in headless context with a flag in options. |
@tech4GT This is awesome! The promise approach is neat, I had precisely that in mind when I was thinking of solutions to this. |
This sounds great. Yes, it'll be awesome to see webgl-distort running and a
good proof of it's generalizability. Awesome work!
…On Thu, Apr 11, 2019, 9:45 PM Vibhor Gupta ***@***.***> wrote:
@tech4GT <https://github.com/tech4GT> This is awesome! The promise
approach is neat, I had precisely that in mind when I was thinking of
solutions to this.
Perhaps this could be generalised in a separate module? Pixel manipulation
works very specifically on the pixel level, maybe the headless code could
go in a separate module inside the _nomodule folder which can be called
from all the other modules if not running in a browser environment OR if a
flag is passed.
@jywarren <https://github.com/jywarren> the webgl-distort module looks
like a nice follow-up to this, thoughts?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1007 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ-zj-Rsfyp-raDV97fkJc0I1JMiNks5vf_MXgaJpZM4cqaMw>
.
|
Okay so this makes sense. I'll make this code into an api which the module can call if it is not supported on node. if(!options.inBrowser){
this.output = require('path-to-api').runInBrowserContext(input);
callback();
}
else{
/* Actual module code here */
} |
Awesome!!!!
…On Fri, Apr 12, 2019, 9:15 AM Varun Gupta ***@***.***> wrote:
Okay so this makes sense. I'll make this code into an api which the module
can call if it is not supported on node.
if(!options.inBrowser){
this.output = require('path-to-api').runInBrowserContext(input);
callback();
}
else{
/* Actual module code here */
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1007 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ8SznAf1gLdBtI4FntFgiIaV7jSkks5vgJS9gaJpZM4cqaMw>
.
|
@jywarren I also need the dist Image sequencer script since I do not want to rely on sequencer.publiclab.org |
Oh, can you work from the npm version? We're very careful about releases
and you can peg to a semver (semver.org) version number?
…On Fri, Apr 12, 2019 at 9:27 AM Varun Gupta ***@***.***> wrote:
@jywarren <https://github.com/jywarren> I also need the dist Image
sequencer script since I do not want to rely on sequencer.publiclab.org
Is it hosted somewhere?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1007 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ1YZd6DR4mGgJwCqlXFEhIlk77f-ks5vgJexgaJpZM4cqaMw>
.
|
Uh, I am not sure. I want to get the latest dist files. How do we get them in the demo anyway? |
I mean the demo must be consuming them from somewhere? |
Also I think this might be a good time to move over to webpack, as the modules get more complex this is going to get difficult to manage with browserify. Like right now the tests are failing since grunt-browserify is trying to browserify puppeteer. I was looking at the documentation but there is no way we can ignore a require in the latest version. I'll try to figure out a workaround here. |
Oh, so we still distribute the dist files in both the stable branch AND in
npm. And since these are strictly npm version numbered, they're the stable
place to source. More here:
#773 - thanks! Did you
need us to publish a new version?
…On Fri, Apr 12, 2019 at 9:53 AM Varun Gupta ***@***.***> wrote:
Also I think this might be a good time to move over to webpack, as the
modules get more complex this is going to get difficult to manage with
browserify. Like right now the tests are failing since grunt-browserify is
trying to browserify puppeteer. I was looking at the documentation but
there is no way we can ignore a require in the latest version. I'll try to
figure out a workaround here.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1007 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ7K9x8cEy1O1r1JqrLB--1HKNXdBks5vgJ3lgaJpZM4cqaMw>
.
|
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
@jywarren Got this! So a couple of things here |
So we are basically done here, all that is left now is to serialize the options object and use it while running in browser context. 😄 |
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
Okay, this is ready to merge from my side @jywarren 🎉 |
Final api looks like: var step = this;
if (!options.inBrowser) {
require('../_nomodule/gl-context')(input, callback, step, options);
}
else {
/* browser specific code */
} |
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
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.
This is AWESOME @tech4GT !!! A few small comments below. 🎉
@tech4GT how heavy is this on the RAM? |
Hmm, we are running a full chrome tab in headless mode, so I would say about 250mb. |
That's not too much. But does running a headless browser hinder performance? |
I mean it's going to be less effective than running natively in node obviously. |
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
@jywarren Ready to merge? |
Fantastic!!! Let's do webgl-distort next! Fantastic work and thanks everyone for input! |
@jywarren I would love to work on webgl-distort! |
@jywarren Now running gl using puppeteer!! 🎉 🎉 🎉
Okay so I am doing it using the localhost demo right now but porting this to image-sequencer.min.js should be easy enough!
Also, some code cleanup is required but this works. :D
cc @Divy123