unable to make it work on lazy load modules ngx-bootstrap-product-tour - lazy-loading

bootstrap-product-tour in my app. and i was imported this module in my app.module,
NgxBootstrapProductTourModule.forRoot(),
and initilized in app.component .ts
But this service is not working in the lazy loaded modules. and not getting any error. Later i tried to import module in lazy loaded module and re initialized in the lazy loaded component with no luck.
can any one help me on how to implement this feature in lazy loaded modules.

Related

loading .so file react-native

I'm trying to load a .so file with my react-native project using the Native Modules.
I'm loading the library with the LoadLibrary func and i am not able to envoke the funtions inside.
However, i have opened a regular java project in android studio and i was able to load the library perfectly.
Any ideas?
I had the same problem and what worked for me was adding this two files where is the MainActivity.java class. You have to change the package name of both classes to com.solo_test
1- https://github.com/CassieLuoli/react-native-smartconnection/blob/master/android/src/main/java/com/luoli/smartconnection/SmartConfigHelper.java
2- https://github.com/CassieLuoli/react-native-smartconnection/blob/master/android/src/main/java/com/mediatek/demo/smartconnection/JniLoader.java
don't forget to change de name of the library on JniLoader.java class
Finally you need to invoke SmartConfigHelper.init(); in MainActivity for load the library

Vue or Webpack compiled JS Cache Management

I have a question about webpack or compiled vue files and its cache management.
Somehow the browser knows when to fetch the app.js files when there is a new compiled version. When none then uses the Cache (or theres a 200B only download to it).
I would like to know the mechanism behind the automatic detecting of the js file.
Is it a feature of webpack? or vue?
Thanks IA
Hot reloading is a feature of vue-cli, implemented using Webpack.
From the docs,
When scaffolding the project with vue-cli, Hot Reload is enabled out-of-the-box.
When you're developing with Vue locally, Webpack is typically in Watch Mode, which means it detects changes to your files and recompiles automatically.
How the DOM refreshes depends which part of the Vue component you have changed.
If you change the Template portion of a component, it will re-render without reloading because the component's internal state has not changed.
If you change the Script portion of a component, the component will reload.
More info about Vue's hot reload
As for the app.js file, you'll see it's actually the initiator of the requests for the DOM diff, which run every time you save changes to your Vue files.
When you save a file, [hash].hot-update.json is requested. If [hash].hot-update.json has a non-empty payload, DOM-affecting changes have been detected. The DOM diff is then requested and applied as a patch via app.[hash].hot-update.js.

How to use static JS with Vue CLI?

I'm creating a Bootstrap Vue application (built with Vue CLI), and there's a Javascript library I want to be able to utilize: https://nadchif.github.io/html-duration-picker.js/. I tried putting the file in /assets and then using import in the script portion of App.vue (import './assets/html-duration-picker.min'), but I have not been able to get the script to work, not sure why (nothing happens, no duration picker shows). As an alternative, I thought I could maybe simply load the library in the traditional way in the head of index.html. But I'm not clear what the src URL should be for a file in the assets directory. Or should it be in the assets/public directory?
Honestly, you might as well use the npm package, if you are using Vue CLI, to save yourself a lot of trouble:
npm i html-duration-picker
DOCUMENTATION.md is where the installation instructions lie. While there aren't any for Vue, there are instructions for Angular, and it's fairly easy to get it working for Vue.
Just import html-duration-picker:
import * as HtmlDurationPicker from "html-duration-picker";
...and initalize it in mounted():
mounted() { HtmlDurationPicker.init() }
You can also run HtmlDurationPicker.refresh(); to "update dynamically loaded input boxes." I don't think this is necessary if you use v-model to bind the boxes' values to data properties which update fine from either end.
Here's a sandbox you can check out for more info.
If you do want to import it manually from assets, though, then what you're doing is probably fine (though you might need to add the .js to then end of the path); you'll just have to initialize it.

Scripts and CSS files that are not being used

So, I have a vue application with Nuxt/Vuetify/Vue-router and recently I've been doing a little research about lazy load this files that are not being used: here
My question is how can I lazy load them since vuetify and nuxt are generating this files and I can't modify them.

Clear failed modules in Dojo module loader?

When you load with Dojo's require a module with the wrong module url (mid), it creates an error (timeout) each time you use require(not loaded yet modules) again, regardless you loaded another module successfully afterwards.
Is there a way to clear that errors? Those failed modules seem to be permanent somewhere in dojo.js and they don't seem to be accessible through an API.
ps: I'd be happy even with a core hack to get rid of them.