Releases: swissquote/crafty
React Hot Loader 4, TypeScript 2.9.0
Highlights
- Updated to React Hot Loader 4, easier to install and use
- Updated to Typescript 2.9
- Lazy load dependencies for faster command startup and not loading unused libraries
- Change UglifyJS configuration to compress faster
- Added
crafty help
to list available tasks and commands
Changes
crafty-preset-react
React Hot Loader 4
Moving from React Hot Loader 3 to 4 meant a lot of changes inside Crafty, especially for TypeScript, but will only require a small change on your side.
React Hot Loader 3 required this :
import React from "react";
import ReactDOM from "react-dom";
import {AppContainer} from "react-hot-loader";
import App from "./containers/App";
const render = Component => {
ReactDOM.render(
<AppContainer>
<Component />
</AppContainer>,
document.getElementById("root"),
);
};
render(App);
// Webpack Hot Module Replacement API
if (module.hot) {
module.hot.accept("./containers/App", () => {
render(App);
});
}
Which can now be returned to
import React from "react";
import ReactDOM from "react-dom";
import App from "./containers/App";
ReactDOM.render(
<App />,
document.getElementById("root"),
);
But in exchange the App
Component (The root of your react app) must be wrapped in hot(module)(YourComponent);
import React from 'react'
import { hot } from 'react-hot-loader'
const App = () => <div>Hello World!</div>
export default hot(module)(App);
crafty-preset-typescript
TypeScript 2.9
No change is required on your side to benefit from this update.
Running Babel after TypeScript in Webpack
After running the TypeScript loader, we now run babel in order to apply the optimizations that babel can do, like inlining React components and applying plugins like React Hot Loader
crafty-preset-jest
- Fix code coverage collection in Jest #21
UglifyJS Configuration
We made some changes to the UglifyJS Configuration to disable advanced compression techniques as they are slow and don't bring a lot of improvement overall.
You can re-enable these options if you wish in your own crafty.config.js
Internal Changes
- Use yarn for development instead of npm
- Lazy load dependencies to make crafty faster
Version updates
[babel-preset-swissquote, crafty-preset-babel, crafty-preset-typescript] Update @babel/*
to 7.0.0-beta.52
[babel-preset-swissquote] Updated babel-plugin-transform-react-remove-prop-types
from 0.4.12
to 0.4.13
[crafty-preset-babel] Updated babel-loader
to 8.0.0-beta.3
[crafty-preset-babel] Updated babel-preset-jest
to 23.2.0
[crafty-preset-babel] Updated eslint
to 5.1.0
[crafty-preset-babel] Updated gulp-eslint
to 5.0.0
[crafty-preset-babel] Updated rollup-plugin-babel
to 4.0.0-beta.5
[crafty-preset-jest] Updated jest-cli
to 23.3.0
[crafty-preset-postcss] Updated css-loader
to 1.0.0
[crafty-preset-postcss] Updated gulp-rename
to 1.3.0
[crafty-preset-postcss] Updated mini-css-extract-plugin
to 0.4.1
[crafty-preset-postcss] Updated postcss
to 6.0.23
[crafty-preset-postcss] Updated postcss-loader
to 2.1.5
[crafty-preset-postcss] Updated postcss-scss
to 1.0.6
[crafty-preset-postcss] Updated stylelint
to 9.3.0
[crafty-preset-postcss] Updated webpack
to 4.15.1
[crafty-preset-react] Updated react-hot-loader
to 4.3.3
[crafty-preset-react] Updated react-test-renderer
to 16.4.1
[crafty-preset-typescript] Updated rollup-plugin-typescript2
to 0.15.1
[crafty-preset-typescript] Updated ts-jest
to 23.0.0
[crafty-preset-typescript] Updated tslint
to 5.10.0
[crafty-preset-typescript] Updated tslint-eslint-rules
to 5.3.1
[crafty-preset-typescript] Updated typescript
to 2.9.2
[crafty-runner-rollup] Updated rollup
to 0.62.0
[crafty-runner-rollup] Updated rollup-plugin-json
to 3.0.0
[crafty-runner-rollup] Updated rollup-plugin-uglify
to 4.0.0
[crafty-runner-webpack] Removed service-port
, replaced by hash-index
[crafty-runner-webpack] Updated uglifyjs-webpack-plugin
to 1.2.7
[crafty-runner-webpack] Updated webpack
to 4.15.1
[crafty-runner-webpack] Updated webpack-chain
to 4.8.0
[crafty-runner-webpack] Updated webpack-merge
to 4.1.3
[crafty] Update browserslist
to 4.0.0
[crafty] Update enhanced-resolve
to 4.1.0
[eslint-plugin-swissquote] Updated babel-eslint
to 9.0.0-beta.1
[eslint-plugin-swissquote] Updated eslint-plugin-import
to 2.13.0
[eslint-plugin-swissquote] Updated eslint-plugin-react
to 7.10.0
[postcss-swissquote-preset] Updated autoprefixer
to 8.6.5
[postcss-swissquote-preset] Updated browserslist
to 4.0.0
[postcss-swissquote-preset] Updated postcss
to 6.0.23
[postcss-swissquote-preset] Updated postcss-dir-pseudo-class
to 4.0.0
[stylelint-config-swissquote] Updated stylelint-scss
to 3.1.3
crafty-preset-jest minor fixes
crafty-preset-react minor fixes
Webpack 4, Babel 7
Highlights
- Webpack 4 migration from Webpack 3 #9
- Use Babel 7 instead of Babel 6
- Changed the list of supported browsers
Changes
babel-preset-swissquote
- Use babel 7
- Added a
deduplicateHelpers
option to allow helpers function to be declared only once.crafty-preset-webpack
uses that option now. - Added a
useESModules
option to use ES imports for helper functions. - Remove prop types in production automatically
crafty-preset-postcss
- Fix a bug when compiling styles with gulp, timestamp wasn't updated on created files, which broke reloading in browsers. Thanks @mariepw for the fix #13 #14
- Replace
extract-text-webpack-plugin
was replaced withmini-css-extract-plugin
for Webpack 4, features and options stay the same.
crafty
- Changed default browsers to
"> 0.25%, Firefox ESR, Edge >= 13, Safari >= 7.1, iOS >= 7.1, Chrome >= 32, Firefox >= 24, Opera >= 24, IE >= 9"
This now excludes older browsers like IE8 and largely unused browsers. - Use browserslist's standard way to read browser list, fallback to crafty's default if nothing else is found.
eslint-plugin-swissquote
- Added
eslint-plugin-sonarjs
to check on some more advanced rules for your JavaScript code. #12 - Enabled sonarjs's recommended rules in our recommended preset.
stylelint-config-swissquote
- Added
stylelint-scss
to plugins. #10 - Replaced
at-rule-no-unknown
withscss/at-rule-no-unknown
Documentation
- Fix typos in documentation, thanks @Elendev for contributions.
Internal
- added
npm clean
to runlerna clean
- added a postinstall script to run
lerna bootstrap
right afternpm install
Version updates
- [babel-preset-swissquote, crafty-preset-babel] Update
@babel/core
to7.0.0-beta.46
- [babel-preset-swissquote] Replace
babel-plugin-syntax-dynamic-import@6.18.0
with@babel/plugin-syntax-dynamic-import@7.0.0-beta.46
- [babel-preset-swissquote] Replace
babel-plugin-transform-class-properties@6.24.1
with@babel/plugin-proposal-class-properties@7.0.0-beta.46
- [babel-preset-swissquote] Replace
babel-plugin-transform-object-rest-spread@6.26.0
with@babel/plugin-proposal-object-rest-spread@7.0.0-beta.46
- [babel-preset-swissquote] Replace
babel-plugin-transform-react-constant-elements@6.23.0
with@babel/plugin-transform-react-constant-elements@7.0.0-beta.46
- [babel-preset-swissquote] Replace
babel-plugin-transform-regenerator@6.26.0
with@babel/plugin-transform-regenerator@7.0.0-beta.46
- [babel-preset-swissquote] Replace
babel-plugin-transform-runtime@6.23.0
with@babel/plugin-transform-runtime@7.0.0-beta.46
- [babel-preset-swissquote] Replace
babel-preset-env@1.6.1
with@babel/preset-env@7.0.0-beta.46
- [babel-preset-swissquote, crafty-preset-babel] Replace
babel-runtime@^6.23.0
with@babel/preset-env@7.0.0-beta.46
- [babel-preset-swissquote] Replace
babel-plugin-dynamic-import-node@1.2.0
withbabel-plugin-transform-dynamic-import@2.0.0
- [babel-preset-swissquote] Replace
babel-plugin-transform-react-jsx@6.24.1
,babel-plugin-transform-react-jsx-self@6.22.0
,babel-plugin-transform-react-jsx-source@6.22.0
,babel-preset-react@6.24.1
with@babel/preset-react@7.0.0-beta.46
- [crafty-preset-babel] Update
babel-loader
from7.1.4
to8.0.0-beta.2
- [crafty-preset-babel] Update
babel-plugin-istanbul
from4.1.5
to4.1.6
- [crafty-preset-babel] Update
babel-preset-jest
from22.4.1
to22.4.3
- [crafty-preset-babel] Update
gulp-babel
from7.0.1
to8.0.0-beta.2
- [crafty-preset-babel] Update
rollup-plugin-babel
from3.0.3
to4.0.0-beta.2
- [crafty-preset-polyfills] Update
core-js
from2.5.4
to2.5.5
- [crafty-preset-postcss, postcss-swissquote-preset] Update
postcss
from6.0.21
to6.0.22
- [crafty-preset-postcss] Update
postcss-loader
from2.1.3
to2.1.4
- [crafty-preset-postcss] Update
postcss-scss
from1.0.4
to1.0.5
- [crafty-preset-postcss] Update
style-loader
from0.20.3
to0.21.0
- [crafty-preset-postcss] Update
stylelint
from9.1.3
to9.2.0
- [crafty-preset-postcss] Replace
extract-text-webpack-plugin@3.0.2
withmini-css-extract-plugin@^0.4.0
- [crafty-preset-react] Update
react-test-renderer
from16.2.0
to16.3.2
- [crafty-preset-typescript] Update
rollup-plugin-typescript2
from0.12.0
to0.13.0
- [crafty-preset-typescript] Update
ts-loader
from3.5.0
to4.2.0
- [crafty-preset-typescript] Update
tslint-loader
from3.5.3
to3.6.0
- [crafty-preset-typescript] Update
typescript
from2.8.1
to2.8.3
- [crafty-runner-rollup] Update
rollup
from0.57.1
to0.58.2
- [crafty-runner-rollup] Update
rollup-plugin-commonjs
from9.1.0
to9.1.3
- [crafty-runner-webpack, crafty-preset-postcss] Update
webpack
from3.10.0
to4.6.0
- [crafty-runner-webpack] Added
uglifyjs-webpack-plugin
from^1.2.5
- [crafty-runner-webpack] Update
webpack-chain
from4.5.0
to4.6.0
- [crafty-runner-webpack] Update
webpack-dev-server
from2.11.1
to3.1.4
- [crafty-runner-webpack] Update
webpack-stylish
from0.1.7
to0.1.8
- [crafty] Update
enhanced-resolve
from3.4.1
to4.0.0
- [crafty] Update
meow
from4.0.0
to5.0.0
- [crafty, postcss-swissquote-preset] Update
browserslist
from3.2.3
to3.2.6
- [eslint-plugin-swissquote] Update
babel-eslint
from7.2.3
to8.2.3
- [eslint-plugin-swissquote] Update
eslint-plugin-import
from2.9.0
to2.11.0
- [eslint-plugin-swissquote] Added
eslint-plugin-sonarjs
version^0.1.0
- [postcss-swissquote-preset] Update
autoprefixer
from8.2.0
to8.4.1
- [postcss-swissquote-preset] Update
postcss-dir-pseudo-class
from^2.1.0
to3.0.0
- [postcss-swissquote-preset] Update
postcss-url
from7.3.1
to7.3.2
Dependencies updates and tweaks
Highlights
- [crafty-runner-webpack] Webpack's output is now cleaner with the help of webpack-stylish
- [crafty-preset-babel] Use
uglify-es
in when using the Gulp runner - [crafty-runner-webpack] Create an UMD package by default with webpack instead of an AMD package
- [stylelint-config-swissquote] added
selector-max-compound-selectors
rule with a default of 6. - [stylelint-config-swissquote] created
swissquote/no-block-inside-block
rule, it's not enabled by default. - [crafty-preset-typescript] Updated to TypeScript 2.8.1
TypeScript 2.8.1
The TypeScript preset now comes with TypeScript 2.8.1. ( instead of 2.6.2 )
We'll not go into details on the new features, but I invite you to check the team's announcements
Documentation
- Fix spelling and typos in the documentation
- Use a separate theme
- Added search
Version updates
- [crafty-preset-babel]
babel-loader
from7.1.2
to7.1.4
- [crafty-preset-babel]
babel-preset-jest
from21.2.0
to22.4.1
- [crafty-preset-babel]
eslint
from4.15.0
to4.19.1
- [crafty-preset-babel]
eslint-loader
from1.9.0
to2.0.0
- [crafty-preset-babel]
gulp-babel
from7.0.0
to7.0.1
- [crafty-preset-babel]
gulp-eslint
from4.0.1
to4.0.2
- [crafty-preset-babel]
gulp-sourcemaps
from2.6.3
to2.6.4
- [crafty-preset-babel]
tmp
from0.0.33
to0.0.33
- [crafty-preset-polyfills]
core-js
from2.5.3
to2.5.4
- [crafty-preset-postcss]
css-loader
from0.28.8
to0.28.11
- [crafty-preset-postcss]
gulp-sourcemaps
from2.6.3
to2.6.4
- [crafty-preset-postcss]
lodash
from4.17.4
to4.17.5
- [crafty-preset-postcss] [postcss-swissquote-preset]
postcss
from6.0.16
to6.0.21
- [crafty-preset-postcss]
postcss-loader
from2.0.10
to2.1.3
- [crafty-preset-postcss]
postcss-scss
from1.0.3
to1.0.4
- [crafty-preset-postcss]
style-loader
from0.19.1
to0.20.3
- [crafty-preset-postcss]
stylelint
from8.4.0
to9.1.3
- [crafty-preset-typescript]
gulp-sourcemaps
from2.6.3
to2.6.4
- [crafty-preset-typescript]
gulp-tslint
from8.1.2
to8.1.3
- [crafty-preset-typescript]
gulp-typescript
from3.2.3
to4.0.2
- [crafty-preset-typescript]
gulp-plugin-typescript2
from0.10.0
to0.12.0
- [crafty-preset-typescript]
ts-loader
from3.2.0
to3.5.0
- [crafty-preset-typescript]
tslint-eslint-rules
from4.1.1
to5.1.0
- [crafty-preset-rollup] [crafty-runner-webpack]
chalk
from2.3.0
to2.3.2
- [crafty-preset-rollup]
rollup
from0.54.0
to0.57.1
- [crafty-preset-rollup]
rollup-plugin-commonjs
from8.2.6
to9.1.0
- [crafty-preset-rollup]
rollup-plugin-node-resolve
from3.0.2
to3.3.0
- [crafty-preset-rollup]
rollup-plugin-uglify
from2.0.1
to3.0.0
- [crafty-preset-rollup]
uglify-es
from3.3.7
to3.3.9
- [crafty-runner-gulp] [crafty]
glob-watcher
from5.0.0
to5.0.1
- [crafty-runner-webpack]
case-sensitive-paths-webpack-plugin
from2.1.1
to2.1.2
- [crafty-runner-webpack]
glob-to-regexp
from0.3.0
to0.4.0
- [crafty-runner-webpack]
webpack-dev-server
from2.11.0
to2.11.1
- [crafty-runner-webpack]
webpack-merge
from4.1.1
to4.1.2
- [eslint-plugin-swissquote]
eslint-plugin-import
from2.8.0
to2.9.0
- [eslint-plugin-swissquote]
eslint-plugin-react
from7.5.1
to7.7.0
- [eslint-plugin-swissquote]
eslint
from4.12.1
to4.19.1
- [postcss-swissquote-preset]
autoprefixer
from7.2.5
to8.2.0
- [postcss-swissquote-preset]
browserslist
from2.11.3
to3.2.3
- [postcss-swissquote-preset]
postcss-advanced-variables
from2.3.0
to2.3.3
- [postcss-swissquote-preset]
postcss-cssnext
from3.0.2
to3.1.0
- [postcss-swissquote-preset]
postcss-import
from11.0.0
to11.1.0
- [postcss-swissquote-preset]
postcss-url
from7.3.0
to7.3.1
- [stylelint-config-swissquote]
stylelint
from8.3.1
to9.1.3
Dependencies updates and bugfixes
Bugfixes
- [eslint-plugin-swissquote] React rules default options were done incorrectly.
Documentation
- Added more badges to the README
- Updated list of supported browsers to be in sync with the code.
- Updated
crafty-preset-babel
's homepage to preset Babel and not CSS (unlucky copy/paste)
Updates
- [internal]
lerna
from2.5.1
to2.7.1
- [internal]
markdownlint-cli
from0.5.0
to0.6.0
- [crafty-preset-babel]
eslint
from4.13.1
to4.15.0
- [crafty-preset-babel]
gulp-eslint
from4.0.0
to4.0.1
- [crafty-preset-babel] [crafty-preset-images] [crafty-preset-typescript]
gulp-newer
from1.3.0
to1.4.0
- [crafty-preset-babel] [crafty-preset-postcss] [crafty-preset-typescript]
gulp-sourcemaps
from2.6.1
to2.6.3
- [crafty-preset-babel]
rollup-plugin-babel
from3.0.2
to3.0.3
- [crafty-preset-images]
gulp-imagemin
from4.0.0
to4.1.0
- [crafty-preset-postcss]
css-loader
from0.28.7
to0.28.8
- [crafty-preset-postcss]
end-of-stream
from1.4.0
to1.4.1
- [crafty-preset-postcss]
gulp-postcss
from7.0.0
to7.0.1
- [crafty-preset-postcss]
postcss
from6.0.14
to6.0.16
- [crafty-preset-postcss]
postcss-loader
from2.0.9
to2.0.10
- [crafty-preset-postcss]
postcss-scss
from1.0.2
to1.0.3
- [crafty-preset-react]
enzyme
from3.2.0
to3.3.0
- [crafty-preset-react]
enzyme-adapter-react-16
from1.1.0
to1.1.1
- [crafty-preset-typescript]
rollup-plugin-typescript2
from0.8.4
to0.10.0
- [crafty-preset-typescript]
tslint
from5.8.0
to5.9.1
- [crafty] [crafty-runner-gulp]
glob-watcher
from4.0.0
to5.0.0
- [crafty-runner-gulp]
gulp-plumber
from1.1.0
to1.2.0
- [crafty-runner-rollup]
rollup
from0.52.1
to0.54.0
- [crafty-runner-rollup]
rollup-plugin-node-resolve
from3.0.0
to3.0.2
- [crafty-runner-rollup]
uglify-es
from3.2.2
to3.3.7
- [crafty-runner-webpack]
webpack-dev-server
from2.9.7
to2.11.0
- [postcss-swissquote-preset]
autoprefixer
from7.2.3
to7.2.5
- [postcss-swissquote-preset]
browserslist
from2.10.0
to2.11.3
- [postcss-swissquote-preset]
postcss
from6.0.14
to6.0.16
- [postcss-swissquote-preset]
postcss-advanced-variables
from1.2.2
to2.3.0
- [postcss-swissquote-preset]
postcss-sassy-mixins
removed because its feature is now covered bypostcss-advanced-variables
Initial Release
This is the first release of Crafty and all of its presets.
Instead of changes, this will be a quick overview of each package's feature.
@swissquote/crafty
- The core package of Crafty, it gives the foundations to load presets and execute the tasks and commands created by them.
- Contains the
run
,test
andwatch
commands
Runners
@swissquote/crafty-runner-webpack
- Bundle your JavaScript using EcmaScript 2015 imports or commonjs imports
- Your code is Uglified after compilation.
- Configurable output formats
- Automatically integrates with watch mode, re-compiles your files on changes
@swissquote/crafty-runner-gulp
- Create any gulp task
- Combine tasks in parallel or in series
- Create file watchers that run tasks or anything else on change.
@swissquote/crafty-runner-rollup
- Bundle your JavaScript using EcmaScript 2015 imports or commonjs imports
- Your code is Uglified after compilation.
- Configurable output formats
- Automatically integrates with watch mode, re-compiles your files on changes
Presets
@swissquote/crafty-preset-babel
- Integrated with Webpack or Rollup or simply outputs your code file by file using Gulp
- Uses a carefully crafted preset of babel plugins
- Lints your code with ESLint
@swissquote/crafty-preset-images
- Compress jpg/png/gif or svg images
@swissquote/crafty-preset-images-simple
- Works the same as
crafty-preset-images
but doesn't compress images. Is meant if you build your projects behind a corporate proxy and can't download the compression binaries.
@swissquote/crafty-preset-jest
- Configures Jest to work out of the box with
crafty-preset-babel
andcrafty-preset-typescript
- All jest features work the same, without special configuration
@swissquote/crafty-preset-maven
- Automatically set the destination of your files according to maven's
target
works for webapps and webjars.
@swissquote/crafty-preset-polyfills
Doesn't work yet.
@swissquote/crafty-preset-postcss
- Compiles your CSS using PostCSS with our postcss preset
- Lints your CSS using Stylelint
@swissquote/crafty-preset-react
- Configures Webpack for Hot Module Replacement
- Configures Jest to easily test React components
@swissquote/crafty-preset-typescript
- Integrates TypeScript with Webpack or Rollup or simply outputs your code file by file using Gulp
- Lints your code using TSLint
Presets for other tools
@swissquote/babel-preset-swissquote
- Transform EcmaScript 2015+ using
babel-preset-env
- Convert JSX to JavaScript for React
- polyfills for async/await and generators when needed
- Is used inside
@swissquote/crafty-preset-babel
@swissquote/eslint-plugin-swissquote
- Contains Swissquote's JavaScript Styleguide
- Is used inside
@swissquote/crafty-preset-babel
@swissquote/postcss-swissquote-preset
- Contains Swissqute's CSS Presets
- Transpiles CSS level 4 to valid CSS level 3
- Understands the
scss
syntax and many of its features (loops, conditions, variables) - Embed images or get their size
- Is used inside
@swissquote/crafty-preset-postcss
@swissquote/stylelint-config-swissquote
- Contains Swissquote's CSS styleguide and Stylelint plugins
- Is used inside
@swissquote/crafty-preset-postcss