Reloading Custom Functions in Excel Add-In - Online Version - excel

I am working on an Excel Add-In with custom functions using the Javascript API. I have followed this tutorial.
I am trying to debug this using the Web version of Excel as the logging capabilities are significantly better, however I am finding that it will never register changes in my functions.ts file. I can change any other code file (eg. taskpane.ts) and will see the changes reflected immediately, however whenever I try to reload the custom functions, I do not see any of the changes.
The commands I'm using:
npm run build followed by
npm run watch in one terminal, npm run start:web in another.
This is the same whether or not I run npm run watch in one terminal or not.
In order to observe any changes I need to completely restart the entire server and reload the plugin.
This makes for a pretty miserable development experience. Has anyone overcome issues like these, or have suggestions as to how I can improve the development process for Excel add-ins?
I would also like to develop using the Desktop version of excel, however do to the lack of decent logging capabilities, this doesn't seem too feasible.

Sorry to hear you are having problems. Can you please try the following:
Open the project manifest and remove 'dist' from the functions.html url as follows:
Run "npm run build" again and then "npm start" again

Related

Where is the "ng serve" for nodejs? Are there a similar tools for other languages?

ng serve is absolutely amazing for my workflow. When writing or editing my angular code, all I need to do is hit save, look at the already running instance of my project, and I can see if I like the changes or not, then repeat.
My question is, where can I get a tool that works like that for... well everything? When I swap from the front end of my MEAN app to the back end the difference is jarring.
I have to write or edit some piece of code, hit save, run node app.js in console, check the changes, hit ctrl+c to stop the service, change more code and repeat. It's obnoxious in comparison.
Is it a small issue? I mean, yeah. Am I being entitled? Also yeah, probably. It's just such a glaring difference when swapping between the two. I just want to be able to use a similar command when I develop in other environments and languages.
Are there options out there for other languages I just don't know about? Is there a simple script senior devs use that I'm not privy to? Do I just need to suck it up and appreciate the convenience where I have it?
Thanks in advance for any advice you all may have!
I'm not exactly sure if this is what you are looking for. But I know for node there is a package called
nodemon
nodemon helps automatically restart the node application whenever a file is changed and saved.
// Installation
npm install -g nodemon
You can use supervisor to watch for file changes and it will automatically serve the latest code
install it like this:
npm install supervisor -g
Use the it like following
supervisor app.js
More on supervisor here

Using webhint with angular7

I am trying to incorporate webhint which is a linting tool that
will help you with your site's accessibility, speed, security and more,
by checking your code for best practices and common errors.
So its installation is as follows :-
npm install hint --save-dev
npm create hintrc (creates a config file)
then I add hint to scripts in package json
"hint" : hint
I run the local server using ng serve in one cmd
And I run webhint in other cmd using
npm run hint -- http://localhost:4200
I wanted to run the ng serve/build along with npm run hint.
I tried steps on link https://webhint.io/docs/user-guide/development-flow-integration/local-server/
I also tried &&, | and concurrency but all failed.
What I want is to run both these ng serve/build and npm run hint using one command.
Any help would be appreciated.
When an angular application with multiple components is run and webhint is run, the html or json formatters show errors but line numbers are column -1 and row -1.
Most likely this is because the html of the page is generated on the client side so the line/col don't make a lot of sense as it is generated dynamically. If you tell the browser to so the pages code you only obtain the initial html, and if you go to the elements panel in the devtools line and column don't have sense there.
The errors should have the html of the element with the error and that should hopefully help you identify the template with the issue.
That said, we have plans to improve this experience but need to finish a few things first.
How does webhint traverse the code using routes or urls so I can better understand it ?
When using Chrome or jsdom we wait until the page is loaded and then analyze all the html while keeping track of all the network requests. In the case of the local we analyze all the files in the folder passed as a parameter.
npm run all and concurrency don't work for me. ng serve only keeps running.
Do you have the code somewhere so we can take a look? Enabling the concurrency should launch all tasks simultaneously. Maybe it's a question of adding a delay in webhint or something similar.
Thanks!

Having nodemon and debugging both working in a WebStorm run configuration

This is a problem I have never really been able to sort and have come across a few times so I thought I'd ask on here to see if there is a solution.
I am currently building a NodeJS(koa) application using babel to transpile the ES6 code. I have setup a run configuration which looks like this:
This setups a debug configuration in order for me to debug my ES6 code.
This works great but I want the debugger to be able to run using nodemon so that when i make changes to the code, the run configuration restarts the server but keeps the debugging functionality. Is this possible from a run configuration or does it have to be done from the command line? At the moment I can only run the debugger OR nodemon... not both at the same time.
Thanks!

Is it possible to make Visual Studio call npm install when an updated package.json is downloaded from source control?

I know that when I manually update the package.json file, VS will run an npm install. However, if someone else updates it and checks it into source control, when I download it, npm install doesn't get called. I have to either save package.json (even if I don't make any changes), or call it myself from a command prompt. It will be really frustrating if we have to communicate to the entire team that they each need to perform some action after getting package.json, any time a change is made.
Is this just a missing feature in Visual Studio, or am I missing something that would allow it work as expected?
Our project is still an old Webforms project (Yeah I know. It's not by the dev team's choice.), so it doesn't have the Dependencies node in Solution Explorer. I realize this might be the problem, and it would possibly all work correctly if we were using an ASP.NET 5 MVC project. However, saving package.json does launch npm install, so the basic support still works. So, if that is the problem, I'd like confirmation on it.
I tried asking this on the VS forums also, and only got a response from a single MS CSG who obviously didn't understand what I was asking. I got tired of the frustration of trying to explain it to him, and dropped it. Since no one else responded, I'm assuming the answer is that it's not possible.
I've created a UserVoice suggestion for it, and suggest everyone that has votes avilable to upvote it.
I have noticed that it does call npm install when you open the solution file (and probably when opening just the project file, although I haven't tried that). That's a little better, but since I usually leave VS open and just hibernate my computer at the end of the day, I don't actually open the solution/project file that often.

Should node.js changes be instantaneous?

Seeing how node.js is ultimately javascript, shouldn't changes to any files be seen when trying to run the app command? I've forked the yuidocjs repo on github and am trying to work my way through my local build, but for some reason my minor changes do not get picked up. I'm new to node.js so I'm not really sure what the exact conventions are.
In node.js when you require a file the source code gets interpreted. It's considered good practice to require all code when you start the server so all the code gets interpreted once.
The code does not get re-interpreted whenever you run it though.
So changes are not instantaneous.
To help you out, try supervisor which does hot reloading of the server on code changes.
It is possible to make instant changes happen by re-interpreting source code but that is not the default action. Generally you should just re-start the server.
Also see nodemon which will automagically reload changed files under it's authority.
EDIT
Rereading your question, it appears you are asking about the following scenario:
Run app to test
Quit app to refactor js code
Restart app
And you're asking why your changes do not appear at step 3?
If this is the case, you are seeing something very strange which might be related to how and from where files are being required.
In node, run:
console.dir(require.paths);
To see where node is looking for any resources you are requiring. If there is a copy of the file you're changing in any of the paths listed which is not the file you're editing, this would explain your problem.

Resources