dependabot[bot] on npm_and_yarn
dependabot[bot] on npm_and_yarn
dependabot[bot] on npm_and_yarn
dependabot[bot] on npm_and_yarn
dependabot[bot] on npm_and_yarn
dependabot[bot] on npm_and_yarn
first problem I encountered is a list of files in Ctrl+P, there is a lot of stuff I would not want to see, e.g. node_modules/ and .awcache/ etc.
@Ciantic instead of file search (which shows everything) you can use project file search (which only shows you the TypeScript files in the compilation context!) https://basarat.gitbooks.io/alm/content/features/omni-search.html#project-filepath-search :rose:
what I don't understand is why this is so much faster than vscode file search, it must be really poorly optimized compared to this
@Ciantic we basically index it up front (as everyone uses file search inevitably) and in a seperate process. That makes it faster : fileListingWorker
: https://basarat.gitbooks.io/alm/content/contributing/async.html :rose:
require('./foo.css')
. That said I am sure that eventually css
will be obsolete for TS / React projects and thus I'm focusing on a great TS only experience :rose:
// Images.ts
// Faux types to achieve type safety at assignment
export declare class ResourceImage {
type: "resourceImage"
}
export declare class ResourceIcon extends ResourceImage {
subtype: "resourceIcon"
}
export declare class ResourceBigIcon extends ResourceImage {
subtype: "resourceBigIcon"
}
export const closeIcon: ResourceIcon = require("./close-icon.svg");
export const someOtherIcon: ResourceIcon = require("./some-other-icon.svg");
// ... list of all images
// Then use like this
import { ResourceIcon } from "./Images";
export class Button extends React.Component<{
icon?: ResourceIcon
}, {}> {
}
// This forces the users of the Button to import icons
import { closeIcon } from "./Images";
<Button icon={closeIcon} />
This forces the users of the Button to import icons
Users will not get a good error message though. and they can give it {type:'resourceImage',subtype:'reousrceIcon'}
object instead of an actual icon (at least thats what the error will guide them to)