React-Native: Downloading and Running external Javascript files - javascript

I'm very new to React-Native. I've moved from CoronaSDK. There, in CoronaSDK, there's a plugin that allows you to download and run external lua files or lua strings and run them.
I was wondering if there was a similar feature, whether internal or external, to allow for downloading and running Javascript(React) files and run them after app build?
I saw services like CodePush, that allows for full app updates deployment. However, I wanted to see if there was something similar to downloading and running individual files.

Related

One of my js files is not being bundled in my production build (dist folder)

I am creating a Vue app (using Vite), and I like to have my .js functions in different files inside a scripts folder. I have started recently so for the time being I only have one .js file appart from the main.js that comes with Vue.
When I build the application to deploy it, it seems that this .js file is not included in the bundle, so the deployed app cannot use it's functions.
How could I make the npm run build command include this local .js file that I am using (and it works when running the app in localhost), so that the deployed app works as expected? Am I missing something in where local files should be put inside the project files tree?
I have checked other questions regarding this, and also the official documentation, but maybe due to my lack of experience with Vue I haven't found the answer or haven't understood it.

App to access file system and run in browser

I am willing to make a portable app using HTML CSS JS and similar languages that doesn't need any installation and can be accessed via a browser.
The app should be able to access the file system and create, write and delete files.
The required files will be on the local machine.
I have tried
Applets but the performance is too inconsistent and depends on browsers.
I have also tried using electron but the end result needs installation (correct me if I am wrong)
I am open to all suggestions
Electron's apps can be portable. Copy the electron build resulted folder into a pendrive and execute the main .exe file from there. Everything should work

How to use Gulp to fetch external javascript files

I'm fairly new to using Gulp, but i've been starting to play around with it and the fact that I can run a server with livereload just by typing 'gulp' makes me wonder where it's been my whole life.
I tend to use CDN's for external libraries but am now working on a project that doesn't allow calls outside the network, meaning I have to include the js files. Is there a way with gulp that will fetch all external javascript files, place it in one single file and minified?
I'm pretty sure you are looking for an asset like this:
gulp-bundle-assets
https://www.npmjs.org/package/gulp-bundle-assets
You can also look at these Gulp plugins for help with CDNs:
gulp-s3: With this you can uploads your static files to Amazon S3 at build time.
gulp-google-cdn: This will replace all references to 3rd party libraries with Google CDNs

hooking into Google App Engine's deploy

The Google App Engine Launcher has a nice little "Deploy" button that will push my changes to prod. However, I'd like to be able to minify/obfuscate my JavaScript before deploying.
I've read about several tools that can do this: Google Closure Compiler, Uglify.js, YUI Compressor. Of course, I could do this manually before deploying, but I'd much rather be able to have this run automatically.
Is there a way to hook into App Engine's deploy process, and run a minification/obfuscation task on my JavaScript? If not, any suggestions on other approaches?
As already mentioned minifying and obfuscating the code depends on the specific setup of your app and has to be done before deploying on App Engine.
That was one of the main reasons that I started the gae-init project. Among other things it has a custom script that combines and minifies all the static files (JS/CSS) before deploying, while when running locally keeping them as they are.
Not sure if there's a way to hook to "App Engine Launcher" but all it does is run a appcfg.py update myapp/ command where myapp/ is your app directory. You could simply create your own shell/batch file where you first minify the files and then deploy them by running the command above.
Also, take a look at Google's Pagespeed service that comes with paid App Engine projects where css/js/etc is minified automatically on Google's servers.

How do I execute custom build script when deploying node.js application to Heroku

How do I execute custom build script when deploying node.js application to Heroku?
For example, I want to minify JavaScript files.
I highly recommend the use of asset-rack, which will minify files when your server first starts up, as well as providing fingerprinted versions of the files that can be cached forever.
https://github.com/techpines/asset-rack

Categories

Resources