Nativescript hot reload JS code - nativescript

While i can hot reload XML in Nativescript i am unable to hot reload JS changes. Is this even possible?
I run 'tns livesync ios --emulator --watch'.
My editor is Visual Source Code and I use the NS plugin for it.
Thanks!

NativeScript itself does not yet support hot-reloading of JS files as of version 2.20.
There is a plugin called nativescript-liveedit that allows hot reloading of JS on the Android platform. The plugin is not "perfect" but; it works in the majority of the cases and allows you to configure related files and files to auto-restart on (i.e. if you change a singleton)
(Disclaimer: I'm the author of the plugin)

Related

HMR does not work for some projects in nrwl nx

I have a react application with some libraries like a seperate UI components library configured with nx. HMR doesnt work for ui library project.
When I make a change to the components in the folder declared as projectType:"application" in workspace.json, I just see the changes in browser. But when I make a change to the ones declared as projectType:"library", the page refreshes (after I see the [HMR] bundle rebuilding message in the console)`
I've attached the sample configuration: https://gist.github.com/trkaplan/33e93e7cfd46c8a8690dfdecfe3ab63e

Creating custom builds of Mozilla Firefox

I am trying to build my own version of Firefox with slight UI changes and by adding some addons(extensions) to the build.
I have downloaded the source code from repo. Where would I start to achieve this?
Which all codes hold the UI structuring? Where do I put my addon xpi files?
PS: I tried to read the Mozilla documentation. Its either kinda outdated or I am not really getting it? A detailed insight would be much appreciated.
Addons
To do this, simply place the extensions in the distribution/extensions
directory in the application's distribution directory.
Here are the extension
https://dxr.mozilla.org/aviary101branch/source/browser/extensions
Flags In firefox
https://dxr.mozilla.org/aviary101branch/source/browser/config/mozconfig
Do more with themes
https://dxr.mozilla.org/aviary101branch/source/themes/modern
https://dxr.mozilla.org/aviary101branch/source/browser/themes
For Editing you may need XUL
https://www.xul.fr/tutorial/
Components
Go here and customize every component you need
https://dxr.mozilla.org/aviary101branch/source/browser/components

Loading PCL sourced HTML page in Cross Browser project (Xamarin)

I am using Xamarin to support
Android
iOS
Windows 8.1
WPF
I can create a PCL project that each of those platforms can see from their platform specific project.
What I want to be able to do is host a HTML page and associated javascript files in the PCL.
All the examples I have seen for loading Local Html files are when there is a copy of the HTML in each platform specific project. I don't want 4 copies of the HTML I want one copy in the PCL.
Can this be done?
We tried to do the same thing a few months ago and as far as I remember we couldn't. The solution for us to make it work was downloading (or extracting in your case) html files to the local directory for each platform using PCLStorage nuget and load directly from local path with custom renderers.
We used custom renderers for each platform for WebView instead of crossx webview. One thing to note that instead of using UIWebView you must use WKWebView if you're targeting iOS9+.
Simply pass your main directory of html files to each renderer and try native controls to use local content. Unfortunately xamarin's crossx WebView does not provide flexible actions when it comes to local content.

xcode 4 + phonegap + sencha touch … not update JS upon build?

I have a similar issue to xcode 4 + phonegap ... not update JS upon build? but with the inclusion of Sencha Touch.
The problem is html changes are recognized but changes to javascript files are not seen when running the app in the simulator. Here's a quick list of suggestions made in the post listed above, none of which worked for me:
update and save .plist
touch www
clean project (Command+Shift+K)
clean build folder (Command+Shift+Option+K)
Deleting the app from the ios simulator and relaunching works but that quickly becomes a hassle. Sencha Touch takes care of its own caching using localstorage. Even though they give you the ability to define the caching strategy in app.json, I haven't found a configuration that works.
Here are the versions I'm using.
XCode - 4.3.2
PhoneGap - 1.6.1
Sencha Touch - 2.0.1 FINAL
If i understand your problem correctly i think it has something to do with HTML5 application cache. Take some time to study a little on how HTML5 Application Cache works here.
The reason your changes are not being reflected is maybe because the hash values in the app.cache file is not being changed... For the js file you wish to get changed change the hash value in comments to anything you want... This would ensure that the browser does not read the HTML & JS files from the cache but would rather download the new updated version...
When you are reloading the page in browser open the console you would get an idea of the updating process...
Hope it helps...

Compass (sass) and web developer extension

Often times I use "edit css" functionality in web developer extension to edit my style sheets.
It's a great feature but it takes time to edit the css and copy it back to an editor to save it.
I am planning to use Compass for my next project and I am wondering how I can use "edit css" functionality with SASS/Compass.
There's no way to do this the way you're expecting.
The flow will have to work like the following ->
Write Compass/SCSS -> Refresh Page -> Edit CSS to get results -> Re-Edit SCSS with previous step and or copy/paste.
Because it compiles down, there's no solution I know of yet that hooks it back in to the SCSS layer.
I don't think it will be much different from what you're doing now..
Compass will precompile the stylesheet written with Sass/SCSS, it will be a regular stylesheet by the time it reaches the browser, so if you then use the "edit CSS" function of your browser toolbar it will work the same way as you do now only you will need to go back to the SASS/SCSS file and insert the changes into the right place (e.g. it could be in a nested rule or mixin or function, depending on how you've written the SASS/SCSS file) - then Compass can recompile the stylesheet
Codekit
Codekit is a great product for OSX that will allow you to edit your local files and as you hit save it will automatically inject the new compiled stylesheet into your browser without a page refresh, so it will at least save you that step. However, as of yet there is no Windows counterpart that I'm aware of.
I've used Codekit on a pretty large project recently where we were using SCSS and it was certainly helpful. Although sadly, like you, I'm used to the "Edit CSS" Web Developer Toolbar workflow, and I've yet to find an exact translation over into the SASS world.
Web Putty
One other option that has some potential (but some SERIOUS drawbacks) is a open source framework from Fog Creek called Web Putty. It was a service they offered that allowed you to live edit CSS in the browser, including SASS and SCSS flavored CSS, but they stopped the service and simply open sourced the software so getting it setup is entirely on you and requires quite some effort (THATs the drawback).
This is possible now with experimental support for Sass in the Chrome dev tools.
First enable the support for Sass:
Then make sure you're compiling to anything other than compressed and enable debug info in Sass. If you're compiling from the command line, pass the --debug-info flag, if you're using Compass, add this to your config.rb:
sass_options = { :debug_info => true }
Presto, you have access to the Sass source in the dev tools:
Clicking on the line number in the dev tools will allow you to edit and apply the local changes:
Personally, I prefer to use compass watch in conjunction with LiveReload and edit in my editor, but for those of you that like to edit in the browser, you can now edit the Sass files directly.
Don't forget to compile to compressed before deploying.

Resources