Debug local npm link package in meteor app - javascript

I am writing a javascript library that is npm linked to my meteor app. I didn't yet publish the library to npm so it is only local.
Now my problem is, that I want to debug inside the library while using it in my meteor app.
I can debug the meteor app components and using a sourcemap and a standalone html test page also the library itself. But as soon as I use import Library from 'library' in meteor it minifies, uglifies and mangles it.
Is there a way to tell either meteor's build system or my browser to use the library's source map?
Thanks in advance

You can try removing the Meteor minifier package until you need it again:
meteor remove standard-minifier-js

Related

How to edit build.gradle for required OS platform in React native created with expo?

I created a React Native project with Expo. I am able to locate build.gradle file in created project. I need to add some configurations for the module installed. How can I solve this in another appropriate way?
Your help would be appreciated.
when using expo-managed workflow you can't access native platform code (Objective-C or Java) unless you eject using expo eject command

How to use NPM Modules with Flask?

I have a python application which I am deploying through Flask using the render_template() function onto a webpage. At the same time, I am trying to use npm to incorporate some javascript modules into my code. Whilst I have correctly installed the needed modules within the static folder with all my other javascript files, the code refuses to recognize these modules.
My Flask CLI shows that my local development server has correctly located the module file but if I run var module = require('module') the code shows no indication of having worked if run through the browser. This goes for whether I include this script inside my html template in the template folder, or an external javascript file in the static folder.
Interestingly enough, if I run the same external javascript file through the npm CLI using node script.js, the script will execute. Can someone explain what I'm doing wrong and why this is so? I'm completely new to node.js, npm and have just started today so any help would be appreciated.
I am currently basing my work off of the answer with 6 upvotes here: How can I serve NPM packages using Flask?
You can use electron as the ui for the python app by spawning your file and navigating to the local url in the app instead of using a browser. With this you will have some node capability.
Without knowing more, this is a bit of a stab in the dark, and quite late, however, I solved a similar problem with the following:
app = Flask(__name__,
static_folder = './public',
template_folder="./static")
npm is. Node.js packages manager tool. And it is only used node.js application.
If your application frontend is react or vue framework and your backend is node.js framework example Express or Koa, use npm is good. but now your backend is Flask
, you know Python package manage tools is Pip, so if you use Npm, you should use node in frontend , backend is flask, and frontend start npm start, backend start python app.py.

Telerik Appbuilder Cli build callback

I'm using Telerik AppBuilder Cli to build an app for IOS. I am also using libimobiledevice which allows me to install the app directly onto my iPhone for debugging.
I'm using a batch script to build the app, and I want the same build script to install the app after the build is completed and the .IPA file is created.
The problem I am running into, is that there doesn't seem to be a proper callback when the Appbuilder Cli has finished building the app. My attempted solution was to use the && syntax like so:
appbuilder build `arguments` && goto install
:install
idevice install `arguments`
The form of my script has :install before the build ( so it can be used conditionally in case I want to build without installing ). However the install callback never fires. I double-checked my conditional, and the only thing I can figure is that the Appbuilder Cli is ignoring the && or something.
Is there a proper way to be notified when the build process is complete? Or is there a javascript library for Appbuilder apart from the cli version?
Thanks
AppBuilder CLI has a command that will build and deploy the application directly. Just use:
appbuilder deploy <platform>
And this will deploy the application on the specified platform, for example ios.
You can find more information in the documentation.
Also you can use appbuilder help deploy to check the help of the command.

Split a javascript Javascript project in multiple package using webpack ou npm

I'm trying to build an application that have to run on Windows(PC), Android and iOS.
For this, I will use Electron (for Windows) and React Native (for mobile plateforms). Both will be built with React and Redux. This way, I will be able to implement the logic in Redux reducers and middlewares and use them in both projects.
From now, I have done a POC for the Electron app using webpack. The reducers are currently directly in the app code. I want to extract the Redux relative code in a seperate package to allow me using it in a the React Native project.
I can make an npm package for my Redux module containing the reducers and the middlwares but this way, when I will compile my application, webpack will not compile my seperate package, it will use the precompiled version.
So What I want is to be able to make a separate package but still compile it at application compile time (because it is still in developpement and the dev is very closely related to main application dev).
Do I have to do it only with npm or with webpack as well ?
I'm pretty new to the Javascript dev stack.
I think you have different ways to handle that problem.
You can use NPM package. But in code of package, you will store not only original source code, but compiled code too. I mean before publish that package, you'll need to compile it in normal ES5 code.
I think you can use submodule system provided by Git. You should have separate repository with common code of your reducers. And in each project (Electron, RN, etc.), you will have a directory with git submodule. Webpack should compile code in that directory normally without any problems.
UPD:
About submodules you can read nice article here: https://git-scm.com/book/en/v2/Git-Tools-Submodules#Starting-with-Submodules
In few words, in project it will looks like:
cd yourProjectFolder
git submodule add https://github.com/TalAter/awesome-service-workers submoduleDirectoryName
It will clone repository to your project, and create .gitmodules file. Code from submodule will not exists in current project repository. In remote repository it will contain only link to submodule, but on your machine, you will have full code and you will be able to compile it.

how can I minimize&packaging Angular2 without Node.JS?

Reason:
I am doing one POC SPA with Angular2(using RC version).
Limited by company policy, we cannot install Node.JS, so Webpack is not available to me.
By now, there are 800+ HTTP requests(total 2.5 MB) at least once I load App home. Because we have developed many components among the App.
Question:
May you please advise me on How I can do minimize&packaging Angular2 code without Node.JS? (something like Third Party Library, Eclipse plugin and so on)
In other words, I want the Front-end one key deployment would be involved.
I think it would obviously increase performance.
Thank you in advance.
Disclaimer, I'm the author of Angular2 Eclipse.
I suggest you that you try Angular2 Eclipse which is based on TypeScript IDE.
When you install TypeScript IDE, you can install an embed node.js, so without installing at hand the node.js, you will benefit with TypeScript completion, validation, compilation, etc (which requires node.js to consume TypeScript tsserver).
You can even choose your version of TypeScript
Angular2 Eclipse provide the Angular CLI integration with terminal, wizards, launches, but in this case you need to install node.js (because it uses ng command that you must install it with npm install -g angular-cli
Please create an issue to give the capability to use ng command without installation:
ng should use the embed node.js (to avoid installing node.js)
provide an Eclipse Preference to link ng to a custom path (the custom path could be the angular-cli project that will download and host in your GIT, SVN repository).

Categories