Sencha Cmd disable compressor - sencha-cmd

Does anyone know how to remove compression of javascript file in sencha cmd?
I want that my production app.js file what fully readable.
And I want to configure this in my app.json if possible.
I did this:
/**
* Settings specific to production builds.
*/
"production": {
"compressor": null, // compressor null
"output": {
"js": {
"optimize": false, // optimize false
},
"appCache": {
"enable": false,
"path": "../cache.appcache"
}
},
"loader": {
"cache": "${build.timestamp}"
},
"cache": {
"enable": false
}
}
But whereas the compressor option work, at the end my file is still "compressed" (not minified but still in one line).
I try the optimize method in the ideal situation, I would like all Sencha Cmd optimization to be perform except to shrink everything in one line...
If somebody know.
Thanks in advance!

thanks to #bnz, the proposed answer was not fully right but it helps me found the solution.
So, to disable the last compression of the app.js file during the build process, you have to go to your <appFolder>/.sencha/app/production.properties and this directive:
enable.resource.compression=false
I did not found yet how to set this in the app.json

No answer worked for me, but I found further possible solutions at Sencha Forum (that worked): https://www.sencha.com/forum/showthread.php?315722-How-to-ignore-compression-in-production-build
I leave it here for future people reaching this thread :)
[copied from the link]
Sencha Cmd v6.5.3.16:
app.json:
"production": {
"compressor": {
"type": "none"
}
}
To disable optimizations:
"output": {
"js": {
"optimize": false
}
}
Sencha Cmd 6.2.2.36 (change all the following):
app.json:
"production": {
"compressor": {
"type": "none"
}
}
.sencha/app/production.properties:
enable.resource.compression=false

Using app.json you can add
"debug" : {
"enable":false/true
}
to your production build object.
If you wanna disable this in general, until the next app upgrade,
you can have a look under
.sencha/app/production.defaults.properties
OR better to overwrite the settings
.sencha/app/production.properties
You need to set
build.options.debug=true
there.

Related

Scale-to command beh for Pixellena image API

I’m using the Pixellena image API and have an issue using the scale-to command for scaling an image. The same issue occurs both when using the demo page and with the SDK.
It doesn't matter if I use different output widths, I get the same problem, see below
I am using the below adjustments
"shifter": {
"steps": [
{
"scale-to-width": 90
}
]
},
"encoder": {
"quality-measure": "fsim-c",
"qual-threshold": 0.9
}
}
Thanks for asking Daniel. It is Vladir from Pixellena. Definitely this error message does not help at all. We have opened an issue to improve it. We'are also updating the doc, but probably there are yet old references elsewhere. In any case you can see here, that now the "scale-to-width" changed to "scale-to": {"width": 90}, so if you give it a try using the adjustments as below:
{
"shifter": {
"steps": [
{
"scale-to": {
"width": 90
}
}
]
},
"encoder": {
"quality-measure": "fsim-c",
"qual-threshold": 0.9
}
}
it should work. If not please let me know and we will look deeper. Thanks a lot for asking. We appreciate your question, and that you're using our API.

Disable intellisense for css classnames in .tsx/.ts files

Whenever I enter a . after a object the autocomplete dropdown contains a lot of unnecessary css classnames as options:
Is it possible to ignore css files for ts/tsx intellisense, so i only get relevant options?
VS Code version: 1.37.1
"[typescript]": {
"editor.suggest.showClasses": false
},
"[typescriptreact]": {
"editor.suggest.showClasses": false
}
Basically the same as Mark's answer but it looks like "editor.suggest.filteredTypes" has been deprecated since VSCode >= 1.40 in favor of settings like "editor.suggest.showClasses".
Try something like this in your settings:
"[typescript]": {
"editor.suggest.filteredTypes": {
"class": false,
}
},
"[typescriptreact]": {
"editor.suggest.filteredTypes": {
"class": false,
}
}
[it would be nice if you could combine these but [typescript, typescriptreact] didn't work for me.
From types of completions it looks like it is class that you want to filter out.
And see create language-specific settings to see how to create settings for specific languages.
You will have to reload vscode to see these changes take effect.

Vscode API - Custom View Container Not Showing

I am currently writing a vs-code FTP type extension, which requires me to use the "TreeView". I have found this link:
https://code.visualstudio.com/api/extension-guides/tree-view
Which guides you through adding a tree view to the sidebar. However I am having trouble getting this off the ground, Step one on the above mentioned guide already does not seem to add the icon to my vscode sidebar? Thus holding from making any progress...
Obviously I am misunderstanding something! I am rather new to TypeScript and have trouble following others code on this subject. Please could anyone just help me getting the first step working?
This is my package.json contributes:
"contributes": {
"commands": [
{
"command": "extension.helloWorld",
"title": "Hello World"
}
],
"viewsContainers": {
"activitybar": [
{
"id": "live-workspace",
"title": "Live-Workspace",
"icon": "./src/Treeview/laptop.svg"
}
]
}
}
From what I understand this should place a "functionless" icon on the sidebar? Am I understanding this wrong? Is there more to be done to achieve this? Thanks!
A view container will only show up if it contains at least one view. It works for me once I also add the following to the contributes section:
"views": {
"live-workspace": [
{
"id": "exampleView",
"name": "Example View"
}
]
}

Can't get suggestions in snippets

I have customized one snippet:
"Import for eslint": {
"prefix": "import",
"body": [
"import { $2 } from '$1'",
],
"description": "import (eslint)"
}
Though it works well, but I can't get suggestions when you code the file path($1), Like this:
the image No Suggestions
the code has highlight background, and don't have suggestions, How should I do some work to implement the feature like this:
only has cursor
Try changing to
"editor.suggest.snippetsPreventQuickSuggestions": false,
true is the default which may be preventing you from seeing suggestions inside your snippet. You want false.

How can I make a chrome packaged app which runs in fullscreen at startup?

Currently it seems that the fullscreen ability can only be activated from a user action (mouse/keyboard event). Is there a way to circumvent this?
Now, you can just add the state:"fullscreen" property on your main .js:
chrome.app.runtime.onLaunched.addListener(
function() {
chrome.app.window.create('index.html',
{
state: "fullscreen",
}
);
}
);
Make sure you don't add resizable: false or bounds properties, and you add a "fullscreen" permision on the manifest.json.
{
...
"permissions": [
...
"fullscreen"
]
}
You can use the HTML5 Fullscreen API, which requires a user action:
button.addEventListener('click', function() {
document.body.webkitRequestFullscreen();
});
or the more "app-y" way using the AppWindow object, which doesn't require a user action:
chrome.app.window.current().fullscreen();
Both need the "fullscreen" permission in the manifest.json.
I have got it working with below code
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('index.html', {
'width': 1024,
'height': 768
},
function(win) {
win.maximize();
});
});
Check out https://plus.google.com/100132233764003563318/posts/2SuD7MVd8mG referring to recently landed changelist https://chromiumcodereview.appspot.com/12205002. You can lift sample code from either of those sources:
document.body.addEventListener('click', function() {
document.body.webkitRequestFullscreen();
});
Make sure in your manifest you're requesting the "fullscreen" permission and that you're testing on a sufficiently recent Chrome build (beta channel ought to have this feature by now, and dev definitely does).
Your question specifically refers to packaged apps, but in case anyone reading this answer missed this, this will work only with Chrome packaged apps.
main.js
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('index.html',{},function(window) {
window.fullscreen();
});
});
manifest.json
{
...
"manifest_version": 2,
"minimum_chrome_version": "23",
"app": {
"background": {
"scripts": ["main.js"]
}
},
"permissions": ["fullscreen"]
}
Edit: Per BeardFist's comment, my original answer was wrong on two fronts. You can do this on a Chrome Extension (which this is tagged as), but probably not on a packaged app.
For extensions you can make it go fullscreen using the state:"fullscreen" option, which can be applied with chrome.window.update. The code below chains the creation of the window via chrome.windows.create with chrome.window.update. In my experiments you could not set the fullscreen state directly through the window creation.
chrome.windows.create(
{url:"PATH/TO/POPUP"},
function(newWindow) {
chrome.windows.update(newWindow.id, {state:"fullscreen"})
});