automated screenshots of React application with PhantomJs/Webshot (or other) - meteor

Given you have a ReactJS web application
And want to take scripted snapshots of it.
How do you do it? What's your method?
What I've attempted:
I have a React app with the stack managed by the Meteor frameworkwebpack.
I've attempted to use [WebShot][1] (via [bryanmorgan:webshot meteor smart package][2] which works great...outside of react components.
When react components are involved it seems to fail silently--plain HTML will be captured, but components are missed. (I've attempted page delays, and also triggered the snapshot on a onLoadFinished callback, none of which work.)
Request
Any suggestions on making this work?
Otherwise,
I've lost enough time on it, I'm perfectly happy to use a different strategy.

Related

Is anyone running the new Next.JS 12 middleware functions on Cloudflare's edge using workers?

Cloudflare's workers are an edge based Javascript execution environment. They seem to me to be the perfect place for executing Next.JS 12's middleware concept.
It surprises me therefore that I can't find much evidence of people doing this despite extensive searching. I'm particularly interested in the idea of using Cloudflare just to execute the middleware and potentially to hold the static elements of a Next.JS build, but then to fall back to a separate (full Node) hosting environment where a getServerSideProps or similar needs to be executed.
One of the drawbacks of Next's middleware is that to really take advantage of it, you need to be on Vercel's platform and whilst I've nothing against that platform, I'd like to at least feel like my app is portable.

Configure Onesignal with Nativescript (with javascript)

I´m creating an app with nativescript and i need push notifications, so i read about onesignal and it looks promissing, so i have created an account with them, follow the instructions for ios, then they sent you here where you are suppose to configure the nativescript SDK for your mobile app. Well, i´m not using typescript, so my first question is:
Where is the javascript version to configure the nativescript SDK,
does anyone knows?
My second question is related with the data that my app receives, which is throught a database, i have a webapp and everytime a user INSERTS in the database, a listview in the nativescript app is "fed"...but when this happens, i need the script from onesginal to send the push does anyone ever used it?
Thanks for your time
Regards
TypeScript makes it easy to maintain large scale JavaScript applications, NativeScript or Angular itself is written in TypeScript for same reason. So personally I would recommend getting started with TypeScript for better.
If you want to convert TypeScript into JavaScript, simply remove all typings from your code, replace import statements with require. At least this should work in NativeScript environment as it supports most of ES6 syntaxes. If you prefer ES5, simply use any online compiler to get JS version of same code, TypeScript Playground for instance.
Also NativeScript docs got examples for extending app delegate in JavaScript if you need further guidance on this.
I don't think the plugin provides any interface to handle notification data at the moment. If you are familiar with the native apis, you may directly access them from JavaScript to access the data sent from server. If possible, I would recommend migrating to Firebase which supports end to end integration with proper examples.

How to structure a single page meteor app with pixijs?

So I'm trying to port this fantastic tutorial -https://goo.gl/rTZA0d - on using pixi.js within meteor, and I'm rather stuck on how I can modularize the code outside of onRendered. Here's the gist - https://gist.github.com/anonymous/4502af95ce67465550fa.
What I want to be able to do is handle events via meteor and pass it into the pixi framework, and of course build the business logic around the framework inside of meteor and/or meteor packages. For example, a package module to handle the loading of assets, etc. I feel like I'm going up a creek without a paddle here, any ideas if this is a valid approach, and/or I'm wasting my time marrying the two. The thought of having a real-time framework using pixijs excites me, yet I'm not familiar with the how part.

How to turn a flex online application into a desktop application?

I we have been working for some years in a flex (cairgorn)+spring+blazeDataservice application using blazeDataservice to connect to the back end, now its getting kind of big and takes too much time too load, and people who use it, normally need it to use it regulary.
My country's internet bandwith is not getting better, actually it´s getting worse, so the app gets bigger and bandwith gets worse so loading it it's getting slower by the day.
I was wondering how could I get the client to be installed on peoples computers, I would be turning a flex online app into a desktop app WITHOUT REWRITING IT. I only need someone to point me in the right direction, i was thinking about 2 options:
1.- Can it be turned into adobe air ? is in´t adobe air desktop ?
2.- Maybe a flash that runs in peoples desktop ?
I need everything to work against the host spring backend just like it does today
Thank you very much!
Just to be clear:
If it is the size of the app (SWF) itself, rather than the queries being performed, an another alternative to speed things up, without building a Desktop (AIR) version, would be to use what Flex calls Modules.
Basically you would be breaking your app into smaller pieces that get loaded only as necessary.
If you do go the Desktop (AIR) route, you may also want to explore a local SQLite database that Syncs with your server only as needed, thus further reducing the internet connectivity issues.
This would of course add to your development time, but it seems like it might be a good bet given the situation you describe.
As for where to start, switching from a Web to a Desktop (AIR) app can be as simple as changing the main MXML tag from (in Flex 3) mx:Application to mx:WindowedApplication and launching your app.
UPDATE in response to follow up question:
Hard to say how much rewriting would be involved without knowing how your code is currently structured, but doubtful it would be a major rewrite.
As an experiment, I would suggest the following:
Create a new Flex application.
Create a new Module.
Add some simple MXML and Actionscript to the Module.
Add an instance of the Module to your Main view.
Run/Compile.
What you should see is that you might as well have not wrapped it in a Module at all, from a functionality or coding perspective, but the Module will have been compiled into a separate SWF, and Flex will handle loading it as needed.
If that all works and makes sense, I would start breaking up pieces of your code into Modules and see if that begins to solve your problem.
Adobe AIR is the right way to go. It is essentially #2, and often you can pretty much just publish exactly what you have straight to AIR instead of the web, and it just works. Fancy!

API For Flex Apps To Interact

I have a large flex application (the app) running on one server, and many small flex applications (widgets) running on another server, which are to be included in the app so that visually the user see's one continuous application. Due to proprietary third party software, this structure cannot be changed. I am looking for some way to allow the app and the widgets to communicate, allowing the app to make changes to the widgets and the the widgets to notify the app when events are triggered, so that user interaction is fluid and continuous.
There are a few related questions which indicate it's possible to do this by setting up event triggers and listeners. I am wondering if there is any standardized way to do this (the answers aren't very clear) or if anyone has developed a library or API to make this easier.
Something I've had success with is using javascript as a bridge between the swf files. It's a nightmare to debug but it works quite well. Check out the tutorial here for a quick discussion of how to interact with javascript from within flash and vice versa
I assume you are running your Flex apps on a client, not a server; is that correct? You want to swfs from multiple servers to act as single application, correct?
I believe that you can communicate between two swfs using LocalConnection:
http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/net/LocalConnection.html
The other questions you link to seem to talk about loading onw swf inside the oher; which is a separate approach.
Use Modules and ModuleLoaders. You'll be able to set the security context, and if you sublcass the Module class and add your own API, you can have a consistent way to communicate with your modules.
Check here for a simple Module:
http://blog.flexexamples.com/2007/08/06/building-a-simple-flex-module/

Resources