- dependencies: Update dependencies to use Jest version 28
- angular: Fix imports
- angular: Upgrade to be compatible with Angular version 14
- visual regressions: Fix issue with visual regression tests not running
- dependencies: Update dependencies to use Angular 13
- dependencies: Update dependencies to use Jest version 27
- verify sandboxes: Add additional error checking for console error messages
- verify sandboxes: Fix issue with error reporting when page error exist in sandbox scenario
- verify sandboxes: Update to the latest version of Puppeteer
- schematic: Fix issue with schematic not getting the first application project settings
- build: Fix issue with node_modules not being filtered out the build sandboxes list
- configuration: Add configuration to defined where the sandboxes defined file is located
- angular: Upgrade to be compatible with Angular version 12
- filter: Fix issue when path-to-sandboxes is not specified
- filter: Add support for path-to-sandboxes filter to support a list of directories
- scenario loading: Fix issue with zone error introduced in 7.0.1
- package: Fixed issue when NGCC fails due to multiple "package.json" files
- scenario loading: Fix issue with random scenarios not loading without refreshing browser
- angular: Upgrade to be compatible with Angular version 9 and work with Ivy compiler
- verify sandboxes: Change verify sandboxes to not load an new page for every scenario error check to improve performance
- verify sandboxes: Add ability to filter based on a path to only check a subset of sandboxes
- embeding: Add ability to add a uniqueId to sandboxes to allow for URL not to be tied to the file location of the sandbox file
- visual regressions: Make visual regression sleep duration configurable
- navigation menu: Fixed issue with overlay not hiding when set to embed mode
- verify sandboxes: Fix issue with verify sandboxes not catching compilation errors
- schematics: Fix issue upgrading Angular Playground not updating dependent files
- angular: Upgrade to be compatible with Angular version 9 and work with Ivy compiler
- verify sandboxes: Change verify sandboxes to not load an new page for every scenario error check to improve performance
- verify sandboxes: Add ability to filter based on a path to only check a subset of sandboxes
- embeding: Add ability to add a uniqueId to sandboxes to allow for URL not to be tied to the file location of the sandbox file
- visual regressions: Make visual regression sleep duration configurable
- navigation menu: Fixed issue with overlay not hiding when set to embed mode
- verify sandboxes: Fix issue with verify sandboxes not catching compilation errors
- angular: Upgrade to be compatible with Angular version 9 and work with Ivy compiler
- verify sandboxes: Change verify sandboxes to not load an new page for every scenario error check to improve performance
- embeding: Add ability to add a uniqueId to sandboxes to allow for URL not to be tied to the file location of the sandbox file
- navigation menu: Fixed issue with overlay not hiding when set to embed mode
- verify sandboxes: Fix issue with verify sandboxes not catching compilation errors
- visual regressions: Add ability to have different configurations for testing image regressions at different view port sizes
- build: Make service worker optional for production builds
- visual regressions: Use mockdate package to set time in visual regression tests
- visual regressions: Improved performance
- visual regressions: New options: a list of paths to ignore, and a mock date to use in the visual regression tests (useful for components that rely on the current date)
- visual regressions: Don't resolve absolute paths like relative ones
- visual regressions: Add quick fail when there are Typescript compilation errors
- ng add: Fix error during ng add when first project is a library
- schematic: Fix issue (#199) with
ng add
setting impropertsconfig.app.json
path after upgrade to Angular version 8.
- visual regressions: Add ability to delete snapshots based on sandboxes filtered
- visual regressions: Fix with special characters causing issue with naming snapshots
- visual regressions command line switch change from "--update-snapshots-directory" to "--path-to-sandboxes":
Before:
angular-playground --config angular-playground.json --check-visual-regressions --update-snapshots --update-snapshots-directory app/feature1
After:
angular-playground --config angular-playground.json --check-visual-regressions --update-snapshots --path-to-sandboxes app/feature1
- visual regressions: Fix issue with screenshot image name not being unique
- visual regressions: Fix issue with screenshot capturing loading image
- visual regressions: Fix issue with some tests timing out
- visual regressions: Make jest not ignore the
test.js
file used for testing visual regressions
- visual regressions: Include jest config files needed for testing visual regressions
- config: Add option to check for visual regressions
- config: Add option to configure host that ng serve runs on (default is 127.0.0.1)
- config: Add default file path for check errors output file (only for json/xml, not log)
- angular: Upgrade to be compatible with Angular version 8
- error reporter: Fixed error reporter sometimes having blank errors
- config: Playground now supports using multiple source libraries at once (via the
sourceRoots
property in the configuration)
- cli schematics: Fixed schematic pathing issues for apps not created with the default
ng new <appName>
command
- error reporter: Fixed finding a free port
- error reporter: Fixed not xml encoding some strings for the xml report
- error reporter: Fixed not generating a report when there were no errors
- error reporter: Added a new error reporter for JUnit XML format
- perf: Performance optimizations to verify sandboxes
- cli: Fixed CLI configuration options for verify sandboxes
- types: Improved types for verify sandboxes
- npm dependencies: Update npm dependencies and peer dependencies
- configuration: Users can now set the max buffer size for the internal angular cli commands
- Thanks to @paolocarrasco for the contributions towards this release!
- ng add: Fix ng add schematic error caused styles in the angular.json file using the new object format.
- ng add: Fix ng add schematic adding 2 entries to the package.json file.
- ng add: Fix incorrect assets path when creating playground entry in angular.json.
- playground: Improved message on playground home screen when there are no sandboxed components.
- Thanks to @Halt001 for the contributions towards this release!
- generate sandbox: Fixed relative import of sandboxed component when using the sandbox generate command.
- npm run playground: Fixed error where the playground would crash on startup.
- ng add: Fixed error when installing via the
ng add
command.
- update sandbox config: Add new
entryComponents
andschemas
options for use when dynamically creating a module containing the dependencies of aSandbox
(5f91c7f). - add cli schematics: Add the ability to install
angular-playground
withng add
. - add sandbox schematics: Add the ability to create a new sandbox file with an ng cli command.
- natives package: Updated
natives
npm package to fix gulp issue on windows running node 10+. - local development: Fixed several bugs with local development environment that caused the sandbox to crash when built and run locally.
- Thanks to @sulco for the contributions towards this release!
- fix sandbox file watch: Fix issue with sandbox files not getting compiled when new one is added or removed.
- compatible with version 6: Updated Angular Playground to be work with Angular 6 and Angular CLI 6.
-
angular cli setup configuration changes: The Angular CLI uses a new configuration file "angular.json" that is now based on projects as instead of apps. When upgrading to use Angular CLI 6 change the "angular.json" file to include the contents of the after shown below.
Before:
.angular-cli.json
{ . . . "apps": [ . . . { "name": "playground", "root": "src", "outDir": "dist-playground", "assets": [ "assets", "favicon.ico" ], "index": "index.html", "main": "main.playground.ts", "polyfills": "polyfills.ts", "tsconfig": "tsconfig.app.json", "environmentSource": "environments/environment.ts", "environments": { "dev": "environments/environment.ts", "prod": "environments/environment.prod.ts" } } ], . . . }
After:
angular.json
{ . . . "projects": { . . . "playground": { "root": "", "sourceRoot": "src", "projectType": "application", "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { "outputPath": "dist/playground", "index": "src/index.html", "main": "src/main.playground.ts", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.app.json", "assets": [ "src/favicon.ico", "src/assets" ], "styles": [ "src/styles.css" ], "scripts": [] }, "configurations": { "production": { "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ], "optimization": true, "outputHashing": "all", "sourceMap": false, "extractCss": true, "namedChunks": false, "aot": false, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": false } } }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { "browserTarget": "playground:build" } } } } }, . . . }
-
removed environment configuration: Remove support for setting environment configuration in angular-playground.json file. Also removed command line switch for environment "--ng-cli-env". You can now just configure environment settings directly in the angular.json file and just provide different configurations.
- app: Fixed issue with matching sandbox metadata when formatted differently (aa9285a).
-
Plugins and Configuration: A new plugin/configuration API allows developers to easily configure and provide modules to the Playground application. This is a feature that we're especially excited about at SoCreate and plan on extending the functionality further based on what type of plugins people would like to develop. Right now, the plugin system provides a wrapper around distributing modules to all sandboxes globally and enabling a command-bar overlay (1db080f)
When declaring the Playground entry point in
main.playground.ts
, usePlaygroundModule
to provide configuration:// main.playground.ts PlaygroundModule .configure({ // Application's root selector for initialization selector: 'app-root', // Register modules that are available to all sandboxes modules: [ BrowserAnimationsModule, environment.production ? ServiceWorkerModule.register('/ngsw-worker.js') : [] ], // Enable an overlay UI for access to the command bar in mobile/ipad overlay: true }) platformBrowserDynamic().bootstrapModule(PlaygroundModule) .catch(err => console.error(err));
Note: this new Configuration API replaces the existing "root module" syntax for providing application-wide modules (like the BrowserAnimation module):
Deprecated syntax:
// my-playground.module.ts @NgModule({ imports: [ BrowserModule, BrowserAnimationsModule, // etc. ] }) export class MyPlaygroundModule {} // main.playground.ts // Don't do this, always use PlaygroundModule: platformBrowserDynamic().bootstrapModule(MyPlaygroundModule);
Don't call initializePlayground() directly anymore
// main.playground.ts // no longer needed: initializePlayground('app-root') // instead: PlaygroundModule .configure({ selector: 'app-root' });
-
app: Added an opt-in overlay that allows users to open the command bar via click/touch. To enable this, use the
PlaygroundModule.configure({ overlay: true })
option (see above for code example) (f047453). -
cli: Added base-href support for production builds. This works in the same way as @angular/cli's
ng build --base-href
command does. Pass it in when running a build: (0af9fbc)angular-playground --build --base-href=my/path/to
- app: Fixed IE11 build due to ES2015 arrow functions (0609340).
- app: Fixed IE11 command bar appearing on pages after being closed (8e0f099).
- app: Switched the "quick switch" key to
control
fromalt
for firefox compatibility (8b5b386). - cli: Better error reporting due to properly surfacing errors and exiting the CLI process (53692cc).
- Thanks to @pharaxe, @cvidal, and @michaeljfuller for their contributions towards this release!
-
cli: You can now build Playground apps for production with service workers (cf38864).
Use the
--build
flag to build Playground for production. Note that this requires all of the same setup to enable Service Workers as outlined by the Angular CLI--see our docs for more details.
- Regrouped source into
packages/
, supporting infrastructure for multiple exported projects (preparation for @angular/cli schematics) (083a83f). - Introduced infrastructure for unit tests with Jest. More unit tests will be gradually added to the project in future releases, making up for the present lack of test coverage (28e4755).
- Refactored CLI for unit testability (69cc522).
- check-errors: Fixed issue where sandbox verification wasn't properly reading from the
sandboxes.js
file due toesnext
dyanmic import module syntax (cd9f18c).
-
cli: Added an option to disable sandbox chunking for apps with a large number of sandbox files.
Usage:
angular-playground --no-chunk
-
sandboxes.ts: The
sandboxes.ts
file is no longer generated in the root of the consuming application's project. Instead,sandboxes.ts
is modified and referenced entirely withinangular-playground
(1fda77f). -
sandbox chunking: Sandbox scenarios are individually chunked and loaded, meaning that your component sandboxes are once again truly isolated. This functionality was affected by the
@angular/cli
1.6.2 update (1fda77f).Before we had you change
tsconfig.app.json
to useesnext
modules:# tsconfig.app.json { ... "module": "esnext" }
Now there's no need to change it from the Angular CLI's default:
# tsconfig.app.json { ... "module": "es2015" }
-
cli: Added a boat-load of new CLI configuration options. Every option available in the
angular-playground.json
file is now also available as a CLI argument (except @angular/cli arguments). Read more about it in our docs. (9dc1066) -
new docs: Speaking of docs, check out our newly-designed docs page.
-
new error checking utility: A new CLI option has been introduced that will run and visit all sandbox scenarios in headless chrome, surfacing any errors that appear in the console. Never forget to mock a dependency again! (6074586)
-
report formats for builds: Used in conjunction with the checking utility, you can now generate a JSON report that your build system can read for error reporting. Read all about it here. (7e0f5a8)
-
command bar shows all components as default: Got the Playground running but don't know where to begin? We'll help you out by showing all of your available scenarios. (51680fd
-
no default configuration argument: The CLI no longer supports a default configuration file argument. Note:
angular-playground
with no arguments will still default to using theangular-playground.json
file as expected. (9dc1066)Before:
angular-playground my-configuration-file.json
After:
angular-playground --config my-configuration-file.json
-
new cli argument style: CLI arguments now match typical npm style:
--argument
for full name,-A
for abbreviation.Before:
-no-watch -no-serve
After:
--no-watch --no-serve
- keyboard shortcuts: Change dropdown keybindings to f2 and ctrl+p (8b8dd84)
- update angular: Update to 5.0.0 release (841984b)
- style: Add styles for scrollbar in chrome (c6a406f)
- style: Change style of shortcuts on home page (c61044d)
- style: Add shortcuts list to initial view (686e87d)
- style: Add style for highlighted search terms (6d2224c)
- search: Add highlight feature to the search to show which fuzzy characters have matched (134940c)
- style: Reduce opacity on entire command bar in preview mode instead of just the background (8de2840)
- style: Pass through proper keydown event and adjust styles on the command bar preview mode (213a854)
- style: Add transparency to command bar when holding the alt key (d505810)
- menu bar navigation: Add new preview feature to show scenarios when holding the alt key and using the up and down arrow keys (1e34464)
- search: Change fuzzy search to improve accuracy of search results (6e8c57f)
- menu bar navigation: Change moving up or down in the menu with arrow keys when scenario is selected to go right to the previous or next item (53ceed4)
- embedding: Fix issue with filter filled out with key path when using url in new browser tab (c37649c)
- embedding: Fix issues with embed mode (dff2962)
- style: Change the initial none message to be centered without affecting sandboxed component displays (37e9433)
- style: Set command bar to show hide with css to maintain scroll position (f7a3cc9)
- style: Prevent list item headers from inheriting font family (c96047f)
- style: Remove link transitions (046bad0)
- package peer dependencies: Fix issue with peer dependencies for 5.0.0-beta.0 and higher (cd16815)
- package peer dependencies: Fix issue with peer dependencies not set to the right versions (3c7d374)
- Requires Angular 4.2 or higher
- Requires Typescript version 2.4 or higher
- If using Angular CLI version 1.2 or higher is required
- Requires changing compilerOptions -> module property in "tsconfig.json" or "tsconfig.app.json" to use "esnext"
- command bar: New improved look to the command bar for navigating between scenarios and components that have been sandboxed
- perfomance: Change the tool to now build an index of sandboxes and only load a sandbox and its dependencies lazily when switching to that scenario with the command bar
- labels: Added a new way to differentiate sandboxes by giving them a specific label that is shown in the command bar for categorizing and can be used in search
- command bar: Fix edge browser keydown events (8c54c41)
- examples: Fix examples showing how to embed sandboxes (8ac215c)
- performance: Change code to lazy load sandbox bundle when scenario is selected (4bc33ff)
- performance: Update build to create functions that lazy load sandboxes (503c67b)
- command bar: Change code to work with menu items index that was built from all sandboxes to seperate the loading of components from listing what is available to be loaded so that a sandboxes/related components are not loaded in one large bundle but instead each sandbox is independently bundled (503c67b)
- performance: Add new factory methods to get menu items/Remove combining of sandbox (eb40a11)
- performance: Update build to create functions that lazy load sandboxes (b4d241b)
- command bar: Update api to only deal with sandbox type information (2a188de)
- typescript: Update tsconfig to support using import function for lazy loading (7e1ca6f)
- package upgrades: Update webpack example to newer version of angular (3fc808a)
- style: Change menu style (49256d8)
- package upgrades: Upgrade sample and dev cli projects to latest package versions
(f3e970f)
-
component scenario combining removed: Each sandbox will now uniquely show up as its own section in the command bar even if it is sandboxing the same component
-
embed url: Embed url has now changed to uniquely reference the sandbox file based on the path within the application
Before:
<a href="http://localhost:4201/?scenario=feature1.PersonBioComponent/a%20special%20case">View in Playground</a> <iframe src="http://localhost:4201/?scenario=feature1.PersonBioComponent/a%20special%20case&embed=1" frameborder="0" width="100%"></iframe>
After:
<a href="http://localhost:4201/?scenario=.%2Fapp%2Ffeature1%2Fperson-bio.component.other.sandbox/a%20special%20case">View in Playground</a> <iframe src="http://localhost:4201/?scenario=.%2Fapp%2Ffeature1%2Fperson-bio.component.other.sandbox/a%20special%20case&embed=1" frameborder="0" width="100%"></iframe>
-
api: Rename prependText property to label (05b6bba)
Before:
import {sandboxOf} from 'angular-playground'; import {PersonBioComponent} from './person-bio.component'; export default sandboxOf(PersonBioComponent, {prependText:'feature1.'}) .add('a special case', {template:`<h1>Special Bio</h1><ex-person-bio></ex-person-bio>`});
After:
import {sandboxOf} from 'angular-playground'; import {PersonBioComponent} from './person-bio.component'; export default sandboxOf(PersonBioComponent, {label:'feature1'}) .add('a special case', {template:`<h1>Special Bio</h1><ex-person-bio></ex-person-bio>`});
-
typescript configuration: In order to lazy load sandboxes for components the new version requires that the compilerOptions -> module option in the tsconfig file be set to "esnext"
Before:
{ "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/app", "baseUrl": "./", "module": "es2015", "types": [] }, "exclude": [ "test.ts", "**/*.spec.ts" ] }
After:
{ "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/app", "baseUrl": "./", "module": "esnext", "types": [] }, "exclude": [ "test.ts", "**/*.spec.ts" ] }
- style: Remove section and :host styles that force bgcolor and font
(c82bb4c) - tslint: Add missing newline to last string in StringBuilder array
(814c161) - tslint: Fix tslint configuration
(4a5116b)
- root NgModule customization: Created a
PlaygroundCommonModule
that can be imported into your own root NgModule in cases where you need to import, provide, etc other things at the root level for the Playground app.
(1e266cf)
- z-index: Removed z-index on
section
element as it was not needed
(d4d3dcf) - dist: Updated build to use
ngc
and removed delivery of*.ts
files
(d64ebf3)
- example app cli: Upgraded the AngularCLI version in the example app to 1.1.3
- removal of
BrowserAnimationsModule
auto-import: Deleted the code in the Playground CLI that auto added theBrowserAnimationsModule
to the root NgModule imports. This should now be done by you in a custom root NgModule that you create and have total control over. If you were using Playground and had sandboxed components that were relying onBrowserAnimationsModule
then you will want to create a NgModule for Playground in your app and use thePlaygroundCommonModule
and bootstrap the PlaygroundAppComponent
. Example:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { AppComponent, PlaygroundCommonModule } from 'angular-playground';
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
PlaygroundCommonModule
],
bootstrap: [AppComponent]
})
export class MyPlaygroundModule {}
- command bar: Added up arrow support from command bar text box (63fbea1)
- command bar: Added F1 as supported Key to open Command Bar (d79adaa)
- command bar: Added example of inline component in sandbox file (bcd4214)
- cli: Added support for production build minification (4aecc19)
- app: Updated to support clearing url when no sandbox or scenario key is matched (helps when you live edit
a
.sandbox.ts
file and change the sandboxed item type or scenario description).
- angular animations: Added support to auto-discover if your project is using
@angular/animations
and if it is, add the import of theBrowserAnimationsModule
in the rootPlaygroundModule
so Playground will support components in your app that use animations.
-
angular cli: Fix support for
args
inangular-playground.json
to be able to pass additional arguments through to theng serve
command that is auto-run by Playground when integrating with the Angular CLI.before:
{ "sourceRoot": "./src", "angularCli": { . . . "args": "--ssl --open" } }
after:
{ "sourceRoot": "./src", "angularCli": { . . . "args": ["--ssl", "--open", "--host=0.0.0.0"] } }
-
angular cli: Add support for
args
inangular-playground.json
to be able to pass additional arguments through to theng serve
command that is auto-run by Playground when integrating with the Angular CLI.{ "sourceRoot": "./src", "angularCli": { . . . "args": "--ssl --open" } }
- command bar: Add styles for stacking order to keep command bar on top of content in all cases.
(#20)
(7638146)
- api: Add
declareComponent
flag toSandboxConfig
that controls whether the sandbox component is declared automatically - defaults to true
(#15)
(74886d2)
- build: Add declare of
require
type inload-sandboxes.ts
to fix TypeScript transpile error.
- cli: Add source files to build for distribution to fix issue with Angular CLI first build throwing error
(#14)
(1cd125d) - build: Add typings throughout source files to support environments using
noImplicitAny
.
-
Angular CLI: Added support for
@angular/[email protected]
. You can now make use of the multi-app support in Angular CLI to create a "playground" app with a unique entry script. See docs at http://angularplayground.it for more info. -
Angular v4.x: Changed some interal code of Playground app so it can be compatable with Angular
4.0.0-rc.1
and above.
-
cli flags: Added support for the following flags when running
angular-playground
(these are designed to be used in the case where you want to integrate the call to the Playground CLI into a build process for an instance of the Playground):-no-watch
Tells cli to not watch for*.sandbox.ts
file changes.-no-serve
Tells cli to not runng serve
if the Playground is set up to integrate with Angular CLI.
-
cli config: Added auto-discovery of
angular-playground.json
file next toproject.json
file if exists, so you can callangular-playground
with no args and it will do the auto-discovery.
-
state in url: The selected component scenario now gets added as a query string to the URL instead of storing that info in session storage. This allows for deep linking.
-
deep linking: A running Playground app now supports a query string parameter for deep linking directly to a component scenario.
?scenario=[prependText][componentName]/[scenarioDescription]
You can get a hold of this link by pulling up a component scenario in the Playground and getting the link from the browser location bar.
-
embed mode: A running Playground app now supports a query string parameter to put the render into embed mode (just the component scenario, no command bar support).
?scenario=[prependText][componentName]/[scenarioDescription]&embed=1
This is the same as the deep link but with an added query string parameter of
embed=1
.
So an example might look like?scenario=feature1.NoticeComponent/with%20long%20text&embed=1
and you could use it within another app/page via an iframe:<iframe src="http://yourplaygroundhost?scenario=feature1.NoticeComponent/with%20long%20text&embed=1"></iframe>
-
multi file for same component: Added support for identifying
sandboxOf
calls on the same component type and grouping them in the command bar when the combo ofprependText
andcomponentType
are the same. Now you can have multiple*.sandbox.ts
files to sandbox the same component and the scenarios can fall under the same grouping in the command bar. -
fuzzy search: Added fuzzy search support to the command bar (big thank you to Nicolás Bevacqua for his open source fuzzySearch code!).
- Angular CLI integration: As of
1.0.0-beta.31
and above the integration code to run Playground with Angular CLI is not working. There will be an update when the Angular CLI goes toRC0
(which should hopefully be soon). In the meantime, if you want to use Playground in an Angular CLI app you need to stay on1.0.0-beta.30
or you can make use of the webpack eject command in1.0.0-beta.32
.
- build Added
any[]
type tosandboxes
variable to support environments usingnoImplicitAny
for their TypeScript builds. - app Added z-index for command bar to always overlay even if sandboxed components contain absolute positioned content. (#6) (3c258de)
- example apps The source code for angular-playground now has an example app using webpack.
- angular-cli: @ngtools/webpack (1.2.7) is out and fixes the error on rebuild so no need to pin that package anymore!
- angular-cli: The new version of @ngtools/webpack (1.2.5) throws an error on
rebuild. You can temporarily get around this by doing a
npm i @ngtools/[email protected]
. It looks like the issue is being tracked here and hopefully will get a fix.