When using the
computedFrom decorator in Aurelia, you currently need to specify the fields it depends upon using strings. Which is useful, because in Aurelia you could create a field/ property that is only defined in the view and not in the ViewModel.
Now if you are using TypeScript and are very used to things being typed, you might not like these strings, because they could contain typos.
In version 2.1 of TypeScript, the
keyof index type query was introduced which allows us to force a string to equal one of the member names of an object. …
Maintaining a significant portion of inline SVG in your HTML pages isn’t the most fun task and most of the times won’t help you to understand your HTML code quickly.
Dwayne Charrington found a great solution for this problem by creating a custom element that replaces itself with external SVG (Inline SVG custom element for Aurelia). This is a very easy to use solution and works great! …
The TypeScript release notes for version 2.1 contains an interesting section named ‘Support for external helpers library (tslib)’. This new feature allows you to use require.js to get the polyfills or helper functions that are normally generated by TypeScript in each file to support backward compatibility (using ESnext features supported by TypeScript, but not yet by all browsers).
Support for external helpers library (tslib) TypeScript injects a handful of helper functions such as _extends for inheritance, _assign for spread operator in object literals and JSX elements, and __awaiter for async functions.
Previously there were two options:
inject helpers in every…
Every day, we as developers, use a wide range of tools to perform our tasks. Re-installing your machine and getting everything you need is always a bit of a search. So I have created this blog posts to store how I install my development machine.
Download the latest version of Powershell (not required on Windows 10, we use version 5)
Go to the following link Windows Management Framework 5.0 and download Win8.1AndW2K12R2-KB3134758-x64.msu.
Once installed verify your PowerShell version by performing the following command:
This should display a Major version of 5.
PS C:\> $PSVersionTable.PSVersion Major Minor Build Revision …
In this blog post, I will use a generated project created with the Aurelia-CLI and extend it to support future CSS syntax and CSS modules/ BEM styled class names. I use TypeScript as transpiler, but this can just as good be done with Babel and ES2015.
Writing unit tests for repositories/ data access code can be a bit tricky and can quickly become an integration test and take more execution time than you want.
In this blog post, I will walk you through 3 different options to perform unit tests on repositories. There isn’t a right or wrong one, it all depends on your use case/ current situation.
When writing unit test I try to follow the following rules:
With this in…
Create a new folder and add the following folders:
Create a default package file by performing:
npm init -y
Install all the packages that are required:
npm i chai cucumber cucumber-tsflow gulp gulp-clean gulp-protractor gulp-protractor-cucumber-html-report gulp-typescript protractor protractor-cucumber-framework require-dir typings --save-dev
This will install the following npm packages:
In the root folder create a file named
gulpfile.ts and add the following content:
// all gulp tasks are located in the ./build/tasks directory // gulp configuration is in files in ./build directory require('require-dir')('build/tasks');
build.js file in the directory
build\tasks and add the…
Erik is a full stack web developer at Effectory and member of the Aurelia Core team. Organizer of the Aurelia & dotnet Amsterdam meetup.