Answer by Chris Krycho for Elegant command line argument parsing for PyQt
The best solution here is using the argparse module's parse_known_args() method (docs) to process the non-Qt command line options first. It's no more work in configuring the ArgumentParser—it just...
View ArticleCSS fallback for OpenType small caps
I'm working on a site where small caps are important: setting the text of the Bible. In the Old Testament the name of God is transliterated as Lord but in small caps—not LORD. However, the state of...
View ArticleAnswer by Chris Krycho for CSS fallback for OpenType small caps
Last updated 2016/02/28.I spent a considerable amount of time researching this and wrestling with it.After digging around as best I could, the top solutions for now are:@supportsTake advantage of the...
View ArticleAnswer by Chris Krycho for Constrain wxPython MultiSplitterWindow panes
Depending on what one needs this for, one possible option to use instead of a custom-managed MultiSplitterWindow (or SashLayoutWindow combinations, etc.) is the Advanced User Interface kit's AuiManager...
View ArticleConstrain wxPython MultiSplitterWindow panes
Edit: I'm leaving the question open as is, as it's still a good question and the answer may be useful to others. However, I'll note that I found an actual solution to my issue by using a completely...
View ArticleAnswer by Chris Krycho for ember-cli is hanging on ember server command
There's a bug in the upgrade process from watchman 4.6 to 4.7. The solution, from the watchman team (which doesn't require you to uninstall and reinstall watchman) is to reload the watchman launch...
View ArticleAnswer by Chris Krycho for tsc is trying to resolve relative path modules in...
You can resolve this by using the "paths" key in the "compilerOptions" in your tsconfig.json. Something like this:{"compilerOptions": {"paths": {"myLib/*": "node_modules/myLib/dist/*" } }}Sadly, this...
View ArticleAnswer by Chris Krycho for Handling Mixins with Ember CLI Typescript
You have the right basic tack going. Classic Ember Mixin instances have to be bound to the prototype. Note that everything that follows is equally applicable to ES6 classes; TypeScript classes are...
View ArticleAnswer by Chris Krycho for I have an enum in my Typescript / Ember 3.1 app...
This is because the types module is not included for compilation by ember-cli-typescript. Pure type declarations will work fine, because they're erased at compile-time. However, enums have runtime...
View ArticleAnswer by Chris Krycho for Emberjs and Typescript SetUp
Full and mostly-accurate type definitions for Ember.js are now available to install from npm at @types/ember, @types/ember-data, and so on, currently all via the Definitely Typed project.Ember CLI...
View ArticleAnswer by Chris Krycho for How to fix type checking when using...
To understand what's happening I recommend reading this section of the ember-cli-typescript docs. The gist is that the types supplied for Ember do some extra work to make it so that when you type...
View ArticleAnswer by Chris Krycho for emberjs glimmer object set() with variable...
There are two basic issues with the situation you have described—one of them related to TypeScript, one of them not.The TypeScript issue is that TS is aware of the names of properties in general, and...
View ArticleAnswer by Chris Krycho for Inset border-radius with CSS3
The best way I've found to achieve this with all CSS and HTML (no images, etc.) is by using CSS3 gradients, per Lea Verou. From her solution:div.round { background: -moz-radial-gradient(0 100%, circle,...
View ArticleAnswer by Chris Krycho for component unit testing in Glimmer
These are indeed an anti-pattern! Indeed, unit testing components is an anti-pattern in general: you're not actually testing the interface of the component that way. Here's what I mean by that: all...
View ArticleAnswer by Chris Krycho for What is the Ember Octane replacement for...
Your instinct that did-insert isn't the right solution here is, I think, correct. In general, modifiers should only be used when the element they're going to be attached to is used in some way—that is,...
View ArticleAnswer by Chris Krycho for Glimmer.js how to reset tracked property to...
There are two parts to this answer, but the common theme between them is that they emphasize switching from an imperative style (explicitly setting values in a lifecycle hook) to a declarative style...
View ArticleAnswer by Chris Krycho for Best approach to caching in Ember Octane
There are two categories of things here:The two @cached decorators.The caching primitives introduced via RFC 0566.In the vast majority of Ember or Glimmer app or normal library code, you’ll just be...
View ArticleAnswer by Chris Krycho for How to update nested state in Ember Octane
Any time you have a bunch of nested state like that which needs to be tracked, just tracking the top-level object won't cause updates to the internals of that object to propagate out. You need to track...
View ArticleAnswer by Chris Krycho for Ember.JS Tutorial "Super-Rentals" and API Paths
Per the Ember CLI docs:public/– This directory will be copied verbatim into the root of the built application. Use this for assets that don’t have a build step, such as images or fontsNormally in an...
View Article