by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 25 09:01
    sigmasoldi3r opened #657
  • Apr 29 23:01
    dependabot[bot] labeled #656
  • Apr 29 23:01
    dependabot[bot] opened #656
  • Apr 29 23:01

    dependabot[bot] on npm_and_yarn

    Bump jquery from 2.2.4 to 3.5.0… (compare)

  • Apr 04 02:46

    dependabot[bot] on npm_and_yarn

    (compare)

  • Apr 04 02:46
    dependabot[bot] closed #654
  • Apr 04 02:46
    dependabot[bot] commented #654
  • Apr 04 02:46
    dependabot[bot] labeled #655
  • Apr 04 02:46
    dependabot[bot] opened #655
  • Apr 04 02:46

    dependabot[bot] on npm_and_yarn

    Bump minimist from 1.2.0 to 1.2… (compare)

  • Mar 13 23:09
    dependabot[bot] labeled #654
  • Mar 13 23:09
    dependabot[bot] opened #654
  • Mar 13 23:09

    dependabot[bot] on npm_and_yarn

    Bump minimist from 1.2.0 to 1.2… (compare)

  • Dec 31 2019 09:24

    basarat on master

    Update README.md (compare)

  • Dec 31 2019 09:24

    basarat on master

    the news as come :rose: (compare)

  • Jun 29 2019 09:12

    basarat on master

    Update README.md (compare)

  • Jan 21 2019 23:27
    basarat opened #653
  • Jan 21 2019 23:27
    basarat closed #589
  • Jan 21 2019 23:27
    basarat closed #588
  • Jan 21 2019 23:27
    basarat closed #587
Jari Pennanen
@Ciantic
(I'm still not sold on free style, I would rather have type providers and get type safe suggestions for classNames)
partly because I've memorised the emmet and other things, that makes using LESS/SCSS/CSS files so much more convinient for me
Basarat Ali Syed
@basarat
@Ciantic completely agree. So many times I press ctrl+p and wish I'd ctrl+shift+y. I'll change them around a bit
@Ciantic about scss ... I am not entirely sold on free style either. But using pure css in simple enough for me. Generally just 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:
Jari Pennanen
@Ciantic
Btw, I think you might like this:
// 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} />
I find this neat, if I'm not mistaken, it also allowes the Webpack 2 to prune icons that are not being used
and of course, it allows to see all references of the icon
Jari Pennanen
@Ciantic
(not sure why I used declare class, inteface seems just as apt)
Basarat Ali Syed
@basarat

it also allowes the Webpack 2 to prune icons that are not being used

Probably true . But only if it prunes unused vars

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)

I prefer enums + a map of enum => value for such things. Of course it isn't pruned.
Marinho Brandão
@marinho
hey! just knew about Alm, loved it and got a couple of ideas to do with it: my major expectation is to setup some sort of self-hostable Plnkr to try some stuff out that cannot go public.
so, does anyone know how to hide some folders (i.e. node_modules) from the tree? the main reason for now is performance, but if could be for other reasons too. EditorConfig doesn't have any key about it.
Basarat Ali Syed
@basarat
@marinho no option about it. I actually like seeing node_modules (and quite commonly open and edit them to fix some thing before sending an upstream PR). What is the performance problem you are having ... there really should be no performance issues and that is something I should fix :rose:
Nothing major slow anyways :)
Marinho Brandão
@marinho

@basarat, actually it's only about the first load on the tree that annoys me. The project I work is an Angular 2 app with multiple components (a few hundreds, maybe) and the list of dependencies in node_modules is something of 400 or such.

The other reason is that my expectation is to use alm to build a live demo of our controls lib, so other devs can try out our styles and controls coding, etc. but I want to make sure they see only what I want them to see, then edit everything on browser, build that also on browser and finally display that in another panel on the right. Very similar to plnkr, but I cannot use plnkr as the project is still very private. So, being able to manipulate the tree is a need.

I could fork alm if necessary, but of course it's always better to contribute when that's part of the same vision
Basarat Ali Syed
@basarat

The project I work is an Angular 2 app with multiple components (a few hundreds, maybe) and the list of dependencies in node_modules is something of 400 or suc

@marinho Perhaps you might not know of these features:

  • The files that are in the compilation context are colored green. Everything else is pseudo noise as far as TypeScript is concerned.
  • There is also project filepath search which only filters the same files (files in the compilation context).

That should reduce some of the noise

Marinho Brandão
@marinho
Looks good @basarat I ll take a look
martov1
@martov1
Hi buddy, just wanted to let you know that I added ALM to the typescript IDEs list on the IONIC 2 documentation
https://github.com/driftyco/ionic-site/pull/780#event-796252124
cheers, i love your project.
Basarat Ali Syed
@basarat
Thanks! 🌹❤️
Richard Fuhr
@rdfuhr
This is a very basic question, since I have just started using alm, but I see no obvious way to save a file using alm. In my first experiment, it either saved the file automatically or by doing command-s when in Chrome.
Richard Fuhr
@rdfuhr
Got my answer, it is indeed command + s on the Mac.
Basarat Ali Syed
@basarat
🌹 you can also use the Omni command search to get the keyboard shortcuts (or even run the command without the shortcut ) ❤️
mortan
@mortan
can I run my script directly in ALM and see the console output?
Burt Harris
@BurtHarris
Hello. I'm just trying out alm-tools, and share questions like @mortan's.
Is there a way I can make alm -o . run Chrome rather then Edge on Windows 10.? I'd rather not change my default browser, but Chrome seems to run alm better in the zoomed-in mode I need to read comfortably.
Basarat Ali Syed
@basarat

can I run my script directly in ALM and see the console output?

Not quite. You can however run a ts->js conversion and see the output in the dev tools console. with Ctrl|⌘ + M. Covered here : https://basarat.gitbooks.io/alm/content/features/build.html :rose:

Is there a way I can make alm -o . run Chrome rather then Edge on Windows 10.? I'd rather not change my default browser,

Sadly you have to. open chrome url didn't work reliably on all OSSes and would crash silently if user didn't have chrome, so I just send open url to all OSSes and the OS load the default browser : https://github.com/alm-tools/alm/blob/f3c89d0a69fbb0e62e203b5de7d55ea8e006bceb/src/server.ts#L134-L136

Burt Harris
@BurtHarris
Thanks Basarat. One more question: can I exclude certain file names from the dependency view?
Basarat Ali Syed
@basarat
@BurtHarris no, but you can include only specific ones using find
Jari Pennanen
@Ciantic
just wanted to share, but have you @basarat used mobx?
const user = observable({
    userName : ""
});

setTimeout(() => {
    user.userName = "Jack"
}, 3000);

@observer
class SomeComp extends React.Component<any, any> {
    render() {
        return <div>
            {user.userName}
        </div>
    }
}
that thing works as expected
changes to "Jack" in three seconds...
and it's written in TypeScript https://github.com/mobxjs/mobx
I think I'm not going to fiddle with Redux anymore, this is amazingly simpler way
forget about passing shit in context, when you can just import the "user" in deeply nested component
and use it
best of all, it does not re-render if I remove {user.username} from render, it knows it's not using that observable in that case
so it's also precies
precise
Basarat Ali Syed
@basarat
@Ciantic once again great minds think alike https://twitter.com/basarat/status/780661816313516032 🌹
Jari Pennanen
@Ciantic
oh great, you've discovered it already. There still isn't good TS & React resources, one must cobble together from discovering stuff, most seems to be JS libraries
clearly alsot the mobx creator kept the TS as a implementation detail, it's literally not mentioned in docs or the readme, probably to encourage JS peeps to use it :)
well, there is a only small mention in the docs
Jari Pennanen
@Ciantic
apparently the author seems to go as far as allowing untyped pull requests
Basarat Ali Syed
@basarat
🌹
Matthew Wilson
@diakopter
@basarat do you have a suggestion for how to add a preprocessor hook to an alm buffer? That is, let's say I'd like to put some Ohm.js grammar/parser in one window that will output normal TypeScript to another file/window