Will Expo OTA updates work with new libraries? - javascript

I am looking into Expo OTA Updates and realizing how crucial it is for production builds on standalone apps.
I am wondering though, this seems to be a good fix for minor JavaScript changes to your app, what if you publish an update having added new library's and dependencies?
Will I have to build another binary for my standalone app or will expo publish take care of that?

As long as the update only involves changes to the JS bundle, and not the native binaries, you should be fine. If the library is pure JS, the update will work. If the library has both a native and JS side to it, the update will be fine as long as the update is only to the JS side. If the native side changed, it won't work.
This article goes into a bit more: How To Use React Native Over The Air (OTA) Updates

After testing this out, it seems that any additions to new libraries does work.
I did notice you need a new build if you change project files like app.json for example.

Related

Compiling Node.js into an executeable without putting the entirety of Node.js in there

So, I'm trying to pack a simple hello world script into an executeable, yet when using pkg or nexe, it looks like the entirety of Node.js get's packed in there, as they are way bigger than they need to be (around 30 MB). I did stumble upon EncloseJS, however, it was last updated in 2017 and no longer works (and the owner themself advices you to switch to pkg).
So, are there any other things out there that can compile it better than that?
Thanks in advance!
Also: This is the stunningly complex script that needs to run
console.log("StackOverflow is amazing!");
setTimeout(() => {
process.exit(0);
}, 2000);
And my locally installed versions:
NPM
Node
6.14.12
14.16.1
No, pkg and nexe works like that - they melting your code and NodeJS in one executable. Because, basically, you need NodeJS to run nodejs scripts - there is some specific methods like fs, for example, witch not exist in regular js.
Anyway, on this moment there is some projects to view:
NectarJS - project with actual dev status, basically compiles JS to C. But their main objectives is pretty interesting.
There is small JS engine called QuickJS witch compiles JS to C.
Another option is ts2c witch translate JS to C, but it does not
support much features.
But keep in mind, that non of them works as good as pkg, witch fully support latest JS features and all NodeJS methods.

JS: How to serve up vanialla JS, HTML and CSS without static html pages?

I want to prototype a quick app but don't want to go down the road of using a framework like React or Vue. I'd also prefer not just creating an html file and a js file that is imported within the html.
Is there a way I can make use of npm packages, SCSS and still write vanilla Javascript without the usage of a framework?
Without using a framework, the most straightforward way to using NPM packages in the browser would be using Browserify. Check out https://medium.com/jeremy-keeshin/hello-world-for-javascript-with-npm-modules-in-the-browser-6020f82d1072 for instance.
Otherwise you can use Gulp,which helps running Browserify, SCSS etc, and use BrowserSync to refresh on changes. But I personally wouldn't go this way: while this is a great way to understand how stuff works, it takes a bit of time to setup properly, and isn't used that much anymore.
My advice is:
Go with Webpack or Rollup. Seems harder to grasp than Gulp but at the end of the day, learning Webpack is very useful (much more than learning Gulp), for instance if you happen to work on a project that uses it (and there are so many).
Use a backend framework that bundles all this kind of stuff. Like Laravel which uses Mix - you can even use Mix without Laravel but there will be a point at which you'll probably need some static data, some routing, interactions... So if you need something more than just hardcoded JSON data, go with a framework. Laravel is great for prototyping but it's not the only one.

Setting up reactjs environemt for production

I have followed below link to set up first react Js project.
https://medium.com/#vikasharry03/react-setup-on-local-computer-912f9a551af3
Now my question is.
Do I need to setup all this process again for my next app or there is some thing like some same environment setup and then we can use that in our apps?
Yes,
You will every time you have to follow same steps because react and other helping module frequently updated by vendors, but you can paste same code files and public folder files.
and if you use this steps every time for new project, you will be aware for new changes done by vendors eg: by facebook , bable, webpack , redux etc...
Yes you would have but then agen you could use an application like visual studio to do the job for you.

How to alter a javascript extension and use it in my project without waiting for approvals?

I'm using an extension in my project called cytoscape in my Ember.js project and along with it, cytoscape-context-menushttps. I needed to make one tiny change to it to accommodate the needs of my project. I have done so and it works great (I tested it locally by simply monkey-patching the code in the relevant JS file in the extension and confirming it works).
I just want to know, how am I supposed to incorporate this change into my project, without having to manually change that bit of code every time we build our project? I know that I can pull down the repo and make a PR on it and get it approved, but that could take days/weeks/months. There must be a way I can manage this myself.
Fork the repository and use your own fork as the dependency. Maintain your fork and keep it up to date with the upstream repository. Switch back whenever your pull request is incorporated.

is it possible to run two different versions of ReactJS on the same page?

Hello everyone I am wondering if is possible to run two version of ReactJS on the same page , something similar to jQuery.noConflict().
With a bit of research i have found two interesting things :
Two Reacts Won’t Be Friends
While I’m happy that everybody seems to be converging on NPM in 2015 and NPM wants developers to use it for managing front-end dependencies, it still has rough edges. The biggest problem with using NPM for front-end dependencies is that if two packages specify a library like React as a dependency, they might get two separate copies of React. Even worse, they might get different versions of it. This works fine for something like Node, but not for browser libraries that want to mess with the same global mutable DOM! NPM tried to solve this with peerDependencies but all hell broke loose and they’re backing out.
https://medium.com/#dan_abramov/two-weird-tricks-that-fix-react-7cf9bbdef375#.hfx35f6hl
And an issue on github: https://github.com/facebook/react/issues/1939
However is not clear for me how we could wrap & delivery our ReactJS widgets in order they could run without conflicts on a page using other version of ReactJS .
thanks
However is not clear for me how we could wrap & delivery our ReactJS widgets in order they could run without conflicts on a page using other version of ReactJS.
You can use Browserify with reactify to load your JS and version of ReactJS without conflicting with another ReactJS version that may be loaded on the page.
More information is available here:
Embeddable JavaScript widget with React

Categories

Resources