Skip to content

Commit 70d0f81

Browse files
committed
2.4.0 release
2 parents 3b98b00 + 5321f4e commit 70d0f81

File tree

93 files changed

+2110
-931
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2110
-931
lines changed

.travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ cache:
88
install:
99
- npm config set prefer-offline true
1010
- npm install -g enactjs/cli#develop
11+
- npm install -g codecov
1112
- npm install
1213
- npm run bootstrap
1314
script:
1415
- echo -e "\x1b\x5b35;1m*** Starting tests...\x1b\x5b0m"
15-
- npm test -- -- -- --maxWorkers=4
16+
- npm test -- -- -- --runInBand --coverage
17+
- codecov
1618
- echo -e "\x1b\x5b35;1m*** Tests complete\x1b\x5b0m"
1719
- echo -e "\x1b\x5b35;1m*** Starting eslint...\x1b\x5b0m"
1820
- npm run lerna -- run lint -- -- -- --max-warnings 0 .

CHANGELOG.md

+24
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,30 @@
22

33
The following is a curated list of changes in the Enact project, newest changes on the top.
44

5+
## [2.4.0] - 2019-03-04
6+
7+
- `moonstone` `line-height` rule to base text CSS for both latin and non-latin locales
8+
- `moonstone` support for high contrast colors in dark and light skin
9+
- `moonstone/BodyText` prop `noWrap` which automatically adds `moonstone/Marquee` support as well as limits the content to only display one line of text
10+
- `ui/BodyText` prop `component` to allow customization of the tag/component used to render its base element
11+
- `ui/Repeater` prop `component` to allow customization of its base element
12+
- `ui/Spinner` prop `paused` to halt the animation. Previously this was hard-coded "on", but now it can be toggled.
13+
14+
### Changed
15+
16+
- `moonstone/Spinner` visuals from 3 spinning balls to an energetic flexing line
17+
- `ui/Changeable` and `ui/Toggleable` to warn when both `[defaultProp]` and `[prop]` are provided
18+
19+
### Fixed
20+
21+
- `moonstone/Panels` to set child's `autoFocus` prop to `default-element` when `index` increases
22+
- `moonstone/Slider` to prevent gaining focus when clicked when disabled
23+
- `moonstone/Slider` to prevent default browser scroll behavior when 5-way directional key is pressed on an active knob
24+
- `moonstone/DatePicker` and `moonstone/TimePicker` to close with back/ESC
25+
- `moonstone/DatePicker` and `moonstone/TimePicker` value handling when open on mount
26+
- `moonstone/ContextualPopupDecorator` to correctly focus on popup content when opened
27+
- `spotlight/Spottable` to prevent unnecessary updates due to focus changes
28+
529
## [2.3.0] - 2019-02-11
630

731
### Deprecated

docs/interoperability.md

+103-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ Enact is a fantastic way to build apps. However, you're not limited to developin
88
only Enact components, nor are you prevented from using pieces of Enact in other React apps. You
99
can mix and match third-party libraries with Enact easily.
1010

11-
## Using Third-Party Components inside of Enact
11+
## Using Third-Party Components Inside of Enact
12+
1213
When creating an app using `enact create`, it creates app boilerplate that is set up for a
1314
`Moonstone` styled app. However, if you want to use another UI library like
14-
[`material-ui`](https://material-ui.com/), [`reactstrap`](https://reactstrap.github.io/), or [`react-router`](https://reacttraining.com/react-router/), just use `npm install`.
15+
[`material-ui`](https://material-ui.com/) (see: [Moonstone + material-ui example](https://codesandbox.io/s/l5my52r299)), [`reactstrap`](https://reactstrap.github.io/), or [`react-router`](https://reacttraining.com/react-router/), just use `npm install`.
1516

1617
You can include components just like you normally would by using `import`.
1718

@@ -37,7 +38,10 @@ For libraries like bootstrap, you can also import the css in your `App.less` fil
3738

3839
The advantage of this is you get to use Enact's `cli` to develop, test, and build applications.
3940

40-
## Using Enact outside of Enact
41+
There is also a [Moonstone starter template](https://codesandbox.io/s/z2wnj3jznx) on CodeSandbox that can be used to quickly test
42+
how third-party libraries and components can be used with Enact.
43+
44+
## Using Enact Outside of Enact
4145
If you're using something like `create-react-app`, it's pretty easy to use Enact as a module.
4246

4347
You can create a new application, as follows:
@@ -64,6 +68,102 @@ const App = kind({
6468
});
6569
```
6670

71+
You can even use `Moonstone` themed components after installing `@enact/moonstone`.
72+
73+
```javascript
74+
import BodyText from '@enact/moonstone/BodyText';
75+
import Button from '@enact/moonstone/Button';
76+
import { MoonstoneDecorator } from '@enact/moonstone/MoonstoneDecorator';
77+
import React, { Component } from 'react';
78+
79+
class App extends Component {
80+
render() {
81+
return (
82+
<div>
83+
<BodyText centered>
84+
These are Enact Moonstone components in a CRA app
85+
</BodyText>
86+
<Button>Click me</Button>
87+
</div>
88+
);
89+
};
90+
}
91+
92+
export default MoonstoneDecorator(App);
93+
```
94+
95+
### Styling Enact Components Outside of Enact
96+
97+
Behind the scenes, Enact supports using CSS modules and most Enact components provide public class
98+
names that can be overridden to easily change their style.
99+
100+
#### CRA Example
101+
102+
If you are using `react-scripts` version `2.0.0` or later, you can import style overrides by using
103+
the `[component].module.css` filename convention. For earlier versions, you will need to eject
104+
the CRA app and modify the webpack configuration to enable CSS modules. This [article](https://medium.com/nulogy/how-to-use-css-modules-with-create-react-app-9e44bec2b5c2)
105+
is a good reference for enabling CSS modules prior to `2.0.0`.
106+
107+
```css
108+
/* Button.module.css */
109+
.bg { /* public class name in Moonstone/Button */
110+
background-color: #a4939d !important;
111+
}
112+
```
113+
114+
```javascript
115+
// App.js
116+
import Button from '@enact/moonstone/Button';
117+
import { MoonstoneDecorator } from '@enact/moonstone/MoonstoneDecorator';
118+
import React, { Component } from 'react';
119+
120+
import buttonCss from './Button.module.css';
121+
122+
class App extends Component {
123+
render() {
124+
return (
125+
<div>
126+
<Button css={buttonCss}>Click me</Button>
127+
</div>
128+
);
129+
};
130+
}
131+
132+
export default MoonstoneDecorator(App);
133+
```
134+
135+
### Internationalization Outside of Enact
136+
137+
#### CRA Example
138+
In order to use the [`@enact/i18n`](../../developer-guide/i18n) library for internationalization, you can [eject](https://facebook.github.io/create-react-app/docs/available-scripts#npm-run-eject)
139+
your CRA app, install your required Enact libraries (plus, `@enact/dev-utils`), and update the webpack configuration.
140+
141+
```
142+
// package.json
143+
144+
...
145+
"devDependencies" : {
146+
"@enact/dev-utils": "2.0.0"
147+
},
148+
"dependencies": {
149+
...
150+
"@enact/i18n": "2.3.0",
151+
"@enact/moonstone": "2.3.0",
152+
...
153+
}
154+
...
155+
156+
// webpack.config.js
157+
...
158+
const {GracefulFsPlugin, ILibPlugin} = require('@enact/dev-utils');
159+
...
160+
plugins: [
161+
// new GracefulFsPlugin(), // use on Windows OS if you run into filesystem handler problems
162+
new ILibPlugin()
163+
]
164+
...
165+
```
166+
67167
## Theming
68168

69169
Enact also has support theming. This way you can take our components and style them to best fit

docs/migration/enact/migrating-to-enact-2.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The `factory` module has been replaced by the `css` override feature.
2222
import factory from '@enact/core/factory';
2323
import kind from '@enact/core/kind';
2424
25-
import componentCss from './Button.less';
25+
import componentCss from './Button.module.less';
2626
2727
const ButtonFactory = factory({css: componentCss}, ({css}) => {
2828
return kind({

docs/theming.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Components built with the `kind` feature can use the `publicClassNames` key in t
1414

1515
Sometimes, behavior is built into a component, but no visual qualities are assigned to that behavior. For example, Enact handles the `selected` state of a `Button`, and it's implemented in our `ui` package, so it's universally available to all themes. `ui` has no opinion on how this state is visually represented, so it simply exports a blank class that the consuming theme can style to its liking.
1616

17-
Here's a simplified example of `ui/Button/Button.less`:
17+
Here's a simplified example of `ui/Button/Button.module.less`:
1818

1919
```css
20-
// Button.less
20+
// Button.module.less
2121
//
2222
@import "../styles/mixins.less";
2323

@@ -52,7 +52,7 @@ import React from 'react';
5252
import kind from '@enact/core/kind';
5353
import UiButton from '@enact/ui/Button';
5454

55-
import componentCss from './Button.less';
55+
import componentCss from './Button.module.less';
5656

5757
const Button = kind({
5858
name: 'CustomizedButton',
@@ -110,7 +110,7 @@ When creating customizable components it may be helpful to understand how the th
110110
When a LESS or CSS file is imported, the classes are inventoried and a hash map is generated of original class names to obfuscated modularized class names: `{original: obfuscated}`. Your module now has a map of all of the class names you referenced. Normally, when using `kind()` you simply pass this into the `styles` block, and indicate which one is your base class, with the `className` key.
111111

112112
```javascript
113-
import css from './Button.less';
113+
import css from './Button.module.less';
114114
...
115115
{
116116
css, // Via ES6, the `css` variable is converted to {'css': css}
@@ -156,7 +156,7 @@ import React from 'react';
156156
import kind from '@enact/core/kind';
157157
import UiButton from '@enact/ui/Button';
158158

159-
import componentCss from './Button.less';
159+
import componentCss from './Button.module.less';
160160

161161
const Button = kind({
162162
name: 'CustomizedButton',

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"lerna": "2.8.0",
3-
"version": "2.3.0",
3+
"version": "2.4.0",
44
"command": {
55
"bootstrap": {
66
"npmClientArgs": [

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "enact",
3-
"version": "2.3.0",
3+
"version": "2.4.0",
44
"description": "Monorepo for all Enact front end libraries.",
55
"private": true,
66
"scripts": {

packages/core/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
The following is a curated list of changes in the Enact core module, newest changes on the top.
44

5+
## [2.4.0] - 2019-03-04
6+
7+
No significant changes.
8+
59
## [2.3.0] - 2019-02-11
610

711
### Deprecated

packages/core/kind/tests/computed-specs.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* globals describe, it, expect */
2-
31
import computed from '../computed';
42

53
describe('computed', () => {

packages/core/kind/tests/styles-specs.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* globals describe, it, expect */
2-
31
import styles from '../styles';
42

53
describe('styles', () => {

packages/core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@enact/core",
3-
"version": "2.3.0",
3+
"version": "2.4.0",
44
"description": "Enact is an open source JavaScript framework containing everything you need to create a fast, scalable mobile or web application.",
55
"main": "index.js",
66
"scripts": {

packages/i18n/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
The following is a curated list of changes in the Enact i18n module, newest changes on the top.
44

5+
## [2.4.0] - 2019-03-04
6+
7+
No significant changes.
8+
59
## [2.3.0] - 2019-02-11
610

711
### Added

packages/i18n/package.json

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@enact/i18n",
33
"main": "./src/index.js",
4-
"version": "2.3.0",
4+
"version": "2.4.0",
55
"description": "Internationalization support for Enact using iLib",
66
"scripts": {
77
"clean": "enact clean",
@@ -33,8 +33,15 @@
3333
"eslintConfig": {
3434
"extends": "enact/strict"
3535
},
36+
"jest": {
37+
"collectCoverageFrom": [
38+
"**/*.{js,jsx,ts,tsx}",
39+
"!**/*.d.ts",
40+
"!ilib/**/*"
41+
]
42+
},
3643
"dependencies": {
37-
"@enact/core": "^2.3.0",
44+
"@enact/core": "^2.4.0",
3845
"prop-types": "15.6.2",
3946
"ramda": "^0.24.1",
4047
"react": "^16.7.0",

0 commit comments

Comments
 (0)