Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
08bb0bd
fix: dynamic isDraggable and isResizable remount
Dec 19, 2018
53f8272
Issue #898: Updating WebpackBin link to new CodeSandbox link in READM…
CWSites Feb 2, 2019
e8794dc
Add graphext to projects using react-grid-layout list (#905)
Feb 2, 2019
31a9560
travis: test on node 10 (#877)
nikolas Feb 2, 2019
aa5af3c
fix(deps): update to webpack4 (#907)
STRML Feb 2, 2019
80873c8
Fix/tests (#908)
STRML Feb 2, 2019
1ff0ab0
feat(grid): add an ability to drop elements from outside of a grid
daynin Aug 14, 2019
56eb5c8
Merge pull request #980 from daynin/droppable
daynin Sep 9, 2019
e504017
fix(examples): fix typo 16-drag-from-outside -> 15-drag-from-outside
daynin Sep 11, 2019
3d4e863
fix: replace componentWillReceiveProps by getDerivedStateFromProps and
daynin Aug 14, 2019
9fe5882
Merge pull request #990 from daynin/fix-cwrp-warnings
daynin Sep 14, 2019
c3ed858
Merge pull request #993 from daynin/fix-examples
daynin Sep 14, 2019
5826c18
chore: update FlowType version
daynin Sep 15, 2019
4e8f11f
Fix for the drag-from-outside example
n1ghtmare Sep 16, 2019
19bd90b
Merge pull request #997 from n1ghtmare/examples-fix
daynin Sep 18, 2019
c947169
fix(yarn): dedupe lodash
STRML Sep 19, 2019
779e8d2
feat: add transformScale (#987)
xcqwan Sep 20, 2019
b974d4e
Merge branch 'pr/995'
STRML Sep 27, 2019
4af61ff
chore(lint): fix minor lint errors
STRML Sep 27, 2019
77547d6
chore(lint): apply prettier on existing files
STRML Sep 27, 2019
b0db89d
add Quadency to projects using react-grid-layout
roshsingh Oct 1, 2019
9dfda0c
Issue #1015 - fixed (#1023)
KognitivnayaBuena Oct 4, 2019
ce1f5ea
added an ability to use different margins for different breakpoints. …
serebrennikovalex Oct 7, 2019
ddebb65
fix RangeError: Maximum call stack size exceeded when preventCollisio…
serebrennikovalex Oct 7, 2019
ce5e3ff
Merge pull request #1022 from quadency/quadency-using-rgl
n1ghtmare Oct 8, 2019
4137380
fix isDroppable in firefox (#1010)
daynin Oct 8, 2019
58838ed
chore(actions): add action for removing stale issues and RPs (#1035)
daynin Oct 9, 2019
1d714da
chore(actions): add an action for auto adding lables on PR creating (…
daynin Oct 9, 2019
a013f9c
chore(devDeps): upgrade husky
STRML Oct 9, 2019
0cb8e3e
chore(pkg): move babel-preset-es2015 to babel-preset-env
STRML Oct 9, 2019
0ec7f53
chore(deps): upgrade to babel 7
STRML Sep 27, 2019
f45ba4f
added monday to list of companies using react-grid-layout (#966)
momotofu Oct 9, 2019
8502809
chore(examples): refactor for import/export
STRML Oct 9, 2019
082907c
fix(examples): get 'make view-examples' running with babel 7
STRML Oct 9, 2019
e61a493
chore(pkg): minor flow update
STRML Oct 9, 2019
86cffca
fix(test): ensure espower & present and let webpack handle modules
STRML Oct 9, 2019
9c88df5
Merge branch 'master' into lm-fix-dynamic-remount
STRML Oct 9, 2019
80a3a5d
chore(actions): increase operations count and runs frequency (#1037)
daynin Oct 9, 2019
5aea831
fix(test): add @babel/cli
STRML Oct 9, 2019
f2f3fc0
Update stale.yml
daynin Oct 10, 2019
b733aed
fix(example): test-hook relative path
STRML Oct 10, 2019
7fefadc
fix(flow): upgrade flow version in flowconfig
STRML Oct 10, 2019
fcb2305
Merge pull request #1013 from STRML/babel7
STRML Oct 10, 2019
a0936f7
chore(style): re-run prettier
STRML Oct 10, 2019
6575862
chore(examples): add CONTENT_BASE env and ignore examples
STRML Oct 10, 2019
8a2a0dc
fix(prettier): ignore dist/ and example/
STRML Oct 10, 2019
056c6f2
Explicitly use default prettier config (#1041)
mei33 Oct 11, 2019
1a1ab98
fix: remove dropping placeholder on drag leave (#1033)
daynin Oct 11, 2019
3d91fe1
chore(examples): make flash of unstyled content less jarring
STRML Oct 11, 2019
6346836
refactor(GridItem): save some work when dragging/resizing
STRML Oct 22, 2019
451d482
Resizable handles on other corners
polikashina Oct 24, 2019
e46f9f1
chore(pkg): minor dep update & upgrade react-resizable to 1.9.0
STRML Oct 24, 2019
d121e0b
chore(pkg): upgrade flowconfig expected version
STRML Oct 24, 2019
c630400
release 0.17.0
STRML Oct 24, 2019
82863b5
fix(ReactGridLayout): ensure window exists before checking navigator …
alexvision Oct 29, 2019
6022813
chore(github): disable labeler
STRML Oct 29, 2019
caa921b
issue-1046: added scale for DraggableCore (#1054)
serebrennikovalex Oct 29, 2019
1fe93e2
release 0.17.1
STRML Oct 29, 2019
f1fdad5
Add example for resizable handles
polikashina Nov 2, 2019
2059870
Pass event to onDrop callback
Nov 4, 2019
226a4bc
fix: forbid change layout on click without drag (#1044)
mei33 Nov 6, 2019
d772b2f
Merge pull request #1065 from Jacob-Grafenstein/master
n1ghtmare Nov 10, 2019
75d69d1
update compatibility table (#1078)
jrowny Nov 20, 2019
09f22ff
Adding Hakkiri to list of projects that use react-grid-layout (#1077)
Nov 20, 2019
ed6d577
fix(github): use periodic-labeler to fix https://github.com/actions/l…
STRML Nov 20, 2019
e3e0e82
Do not mutate layouts prop (#1063) (#1064)
darekkay Nov 20, 2019
d3f4730
feat: react-resizable add transformScale (#1075)
xcqwan Nov 20, 2019
cffd456
Fixed a minor bug which prevents showing 'Add +' (#1038)
vagoel Nov 20, 2019
7c6ef3e
fix(GridItem): ensure locally set isDraggable/isResizable overrides g…
STRML Nov 20, 2019
18caa8b
Update Readme.md code sample (#1086)
iuricmp Nov 29, 2019
92be169
Replaces .includes with a regex for a better IE compatibility (#1096)
n1ghtmare Dec 8, 2019
865a83f
Fix handling of width changes (#1090)
gregbty Jan 13, 2020
87ba2df
chore(pkg): upgrade devDependencies
Jan 13, 2020
52390bf
chore(prettier): run on a few files that got missed
Jan 13, 2020
ba0c333
chore(pkg): remove babel-plugin-espower
Jan 13, 2020
8d5ca2c
chore(pkg): add test pre-commit & upgrade husky package.json
Jan 13, 2020
63a9ded
Moved calculation methods from GridItem to own util file
Jan 22, 2020
5c6c922
Setting correct grid unit position for newly created dropping items.
Jan 22, 2020
be1d41f
refactor(dropping): minor tweaks
STRML Jan 22, 2020
98f21c4
Merge pull request #1128 from STRML/refactor/dropping
STRML Jan 22, 2020
59b0da6
Merge pull request #892 from lmachens/lm-fix-dynamic-remount
STRML Feb 10, 2020
72bd210
Add link to users recipes wiki
eric-burel Feb 16, 2020
da867bc
Merge pull request #1142 from eric-burel/patch-5
n1ghtmare Feb 16, 2020
3a7c20a
Fixed the "User recipes" wiki link
n1ghtmare Feb 16, 2020
663c06f
Merge pull request #1143 from STRML/n1ghtmare-patch-1
n1ghtmare Feb 16, 2020
1078b14
Add `shouldComponentUpdate` to major components. (#1123)
STRML Feb 25, 2020
44e2000
docs(readme): document new onDrop callback arity
STRML Feb 25, 2020
730f201
release 0.18.0
STRML Feb 25, 2020
91ebd58
Fix flow error due to incorrectly set defaultProps (#1138)
mbhrznr Feb 25, 2020
5e9affa
chore(deps): update devDeps
STRML Feb 25, 2020
0e38ea0
fix(types): fix flow typing for WidthProvider and make props exact.
STRML Feb 25, 2020
616daaf
release 0.18.1
STRML Feb 25, 2020
42baa39
fix(SCU): make shouldComponentUpdate shallowly compare children array.
STRML Feb 26, 2020
b108a7c
docs(example): indicate how to use toolbox
STRML Feb 26, 2020
2bb6a26
release 0.18.2
STRML Feb 26, 2020
6ec7d74
Fix example of memoizing children in README.md (#1158)
draperunner Mar 11, 2020
20dac73
Add enzyme testing. (#1163)
STRML Mar 11, 2020
7435467
Fix shouldComponentUpdate interfering with droppability (#1164)
STRML Mar 12, 2020
8ba4853
release 0.18.3
STRML Mar 16, 2020
7b8c132
make onDrop callback more consistent
cedeber Mar 18, 2020
0697252
Bump react-resizable to 1.10.0 (#1179)
nguymin4 Apr 9, 2020
83251e5
Added innerRef prop to expose wrapping div (#1176)
paul-sachs Apr 29, 2020
debcadb
Merge remote-tracking branch 'polikashina/resizable-handles-on-corners'
mariusandra May 14, 2020
da07f0f
Add isBounded property so items could be constrained within grid (#1248)
STRML Jul 20, 2020
bf48aca
fix #1243 (#1246)
rhgb Jul 20, 2020
33ccfa5
chore(dev): update devDeps
STRML Jul 20, 2020
105a11b
chore(dev): re-run Prettier with 2.0
STRML Jul 20, 2020
f53cf0f
chore(dev): bump websocket-extensions
STRML Jul 20, 2020
b0f73e9
chore(dev): rem unused build.sh
STRML Jul 20, 2020
2b19e58
chore(dev): rem Node 8, which is no longer supported by many deps
STRML Jul 20, 2020
e589cd3
Merge remote-tracking branch 'origin/pr/1169'
STRML Jul 20, 2020
c47f1f2
changed readme accordingly to responsive mechanism (#975)
vichugunov Jul 20, 2020
f446e28
docs(readme): additional note on `innerRef`
STRML Jul 20, 2020
9aa465e
release 1.0.0
STRML Jul 20, 2020
d086cb4
chore(pkg): npmignore flow interfaces
STRML Jul 20, 2020
6591a6d
docs(readme): reformat css transforms perf data
STRML Jul 20, 2020
a6e0e63
Merge branch 'master' into master
STRML Aug 31, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .babelrc

This file was deleted.

21 changes: 21 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// @flow

const es6Compat = process.env.BABEL_ES_COMPAT === "6" || process.env.NODE_ENV === "test";

module.exports = {
presets: [
[
"@babel/preset-env",
{
targets: es6Compat ? "maintained node versions" : "> 0.25%, not dead"
},
],
"@babel/react",
"@babel/preset-flow"
],
plugins: [
"@babel/plugin-transform-flow-comments",
"@babel/plugin-proposal-class-properties",
"babel-plugin-preval"
]
};
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 0.25%
ie 11
not dead
10 changes: 10 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,22 @@
"rules": {
"no-console": 0,
"no-use-before-define": [2, "nofunc"],
"no-unused-vars": [1, {
"argsIgnorePattern": "^(e|_.*)$",
"vars": "local",
"varsIgnorePattern": "(debug|^_)"
}],
"prefer-const": 2,
"react/jsx-boolean-value": [2, "always"]
},
"env": {
"browser": true,
"node": true,
"es6": true
},
"settings": {
"react": {
"version": "detect"
}
}
}
10 changes: 9 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
[version]
0.65.0
^0.129.0

[ignore]
<PROJECT_ROOT>/build/.*
<PROJECT_ROOT>/dist/.*
# Speeds parsing:
.*/node_modules/@babel.*
.*/node_modules/babel.*

[include]

[libs]
interfaces/
flow-typed/

[options]
emoji=true
module.use_strict=true
29 changes: 29 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
documentation:
- test/examples/**/*
- README.md
- examples/**/*

core:
- lib/**/*

release:
- dist/**/*

tests:
- test/spec/**/*

deps:
- yarn.lock

infrastructure:
- .github/**/*
- .babelrc
- .eslintignore
- .eslintrc.json
- .flowconfig
- .gitignore
- .npmignore
- .travis.yml
- build.sh
- package.json
- webpack*
14 changes: 14 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Pull request labeler
on:
schedule:
- cron: '*/5 * * * *'
jobs:
labeler:
runs-on: ubuntu-latest
steps:
- uses: paulfantom/periodic-labeler@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
LABEL_MAPPINGS_FILE: .github/labeler.yml
19 changes: 19 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Close stale issues and PRs"
on:
schedule:
- cron: "0 0,6,12,18 * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 7 days'
stale-pr-message: 'This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 7 days'
stale-pr-label: 'stale'
exempt-pr-label: 'stale'
days-before-stale: 30
days-before-close: 7
operations-per-run: 30
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ dist/*
npm-debug.log
build/
.idea
# Ignore built example files
examples/*.html
examples/*.js
!examples/generate.js
!examples/vars.js
.vscode
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ Makefile
*.sh
*.*.json
__tests__/
__mocks__/
index-dev.js
index.html
flow-typed/
interfaces/
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
examples/
18 changes: 18 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "none",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid",
"requirePragma": false,
"insertPragma": false,
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "css",
"endOfLine": "auto"
}
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
language: node_js
node_js:
- "6"
- "7"
- 10
- 12
- "lts/*"
script:
- make build test
cache: yarn
Expand Down
109 changes: 109 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,114 @@
# Changelog

0.18.3 (Mar 16, 2020)
----

### Bugfixes
- Fix `shouldComponentUpdate` interfering with droppability ([#1152](https://github.com/STRML/react-grid-layout/issues/1152))

### Internal Changes
- New Enzyme test suite added to prevent regression. If you have time, we could really use more test cases that reflect your use cases!

0.18.2 (Feb 26, 2020)
----

### Bugfixes
- `shouldComponentUpdate`:
- A too-aggressive implementation of `shouldComponentUpdate` was shipped in 0.18.0-0.18.1 ([#1123](https://github.com/STRML/react-grid-layout/pull/1123)), which did not compare the `children` object. While this works well in many simple implementations of RGL, it breaks in more complex applications.
- Reference equality of `props.children` and `nextProps.children` is now added to `<ReactGridLayout>` and `<GridItem>`. If you wish to take advantage of the performance improvements from the `shouldComponentUpdate` work, memoize your children.
- A section has been added to the [README](/README.md#Performance) explaining how this works.
- Fixed [#1150](https://github.com/STRML/react-grid-layout/issues/1150), [#1151](https://github.com/STRML/react-grid-layout/issues/1151).

0.18.1 (Feb 25, 2020)
----

This release contains typedef changes only.

### Bugfixes
- Flow types:
- Make Props to `<ReactGridLayout>` and `<ResponsiveReactGridLayout>` exact.
- Fix loss of props refinement when passing through `WidthProvider`.
- Fix Flow errors as surfaced in [#1138](https://github.com/STRML/react-grid-layout/pull/1138).
- Modify examples to use types so that the above type error can't resurface

0.18.0 (Feb 25, 2020)
----

Thanks to all of our maintainers for this big release. 0.18.0 contains a large number of bugfixes that users have been asking for. Please read the full list so you know what to expect. Some of the biggest improvements include fixing changes of `isResizable`/`isDraggable` without a remount ([#892](https://github.com/STRML/react-grid-layout/pull/892)), fixes to prop changes on `ResponsiveReactGridLayout` ([#1090](https://github.com/STRML/react-grid-layout/pull/1090)), `shouldComponentUpdate` improvements for speed ([#1123](https://github.com/STRML/react-grid-layout/pull/1123)), improvements to droppability ([#1127](https://github.com/STRML/react-grid-layout/pull/1127)), and much more.

### (Potentially) Breaking Changes

- You can now locally set `isDraggable`/`isResizable` on a `static` item and it will have that property. This could be useful, but be sure to check your layouts if you use `static`. Relates to [#1060](https://github.com/STRML/react-grid-layout/pull/1060).
- `shouldComponentUpdate` is now implemented on major components to improve render speed while you manipulate the layout. In our testing there are no issues. If you encounter one, please open an issue asap and we'll get it fixed. See [#1123](https://github.com/STRML/react-grid-layout/pull/1123).

### New Features

- You can now manipulate `isDraggable`/`isResizable` without the child component remounting. We do this by always rendering the child `<Resizable>` and `<Draggable>` wrappers, optionally in a `disabled` state. This feature has been heavily requested. [#892](https://github.com/STRML/react-grid-layout/pull/892)
- The event is now passed as `e` on the `onDrop` callback. [#1065](https://github.com/STRML/react-grid-layout/pull/1065)
- Pass `transformScale` to `Resizable`. [#1075](https://github.com/STRML/react-grid-layout/pull/1075)

### Bugfixes

- Fix handling of width changes in `ResponsiveReactGridLayout`. [#1090](https://github.com/STRML/react-grid-layout/pull/1090)
- Fixes ignored changes of breakpoints and columns. See also [issue #1083](https://github.com/STRML/react-grid-layout/issues/1083).
- Forbid layout change on click without drag. [#1044](https://github.com/STRML/react-grid-layout/pull/1044)
- Do not mutate `layouts` prop. [#1064](https://github.com/STRML/react-grid-layout/pull/1064)
- Ensure locally set `isDraggable`/`isResizable` on a `GridItem` overrides the global setting on the layout. [#1060](https://github.com/STRML/react-grid-layout/pull/1060)
- Avoid additional element jumping when an item is dropped. [#1127](https://github.com/STRML/react-grid-layout/issues/1127)
- Don't use `String#includes` for Firefox test. [#1096](https://github.com/STRML/react-grid-layout/pull/1096)

### Internal Refactors

- Added `shouldComponentUpdate` to major elements for speed. Significant [performance improvements](https://github.com/STRML/react-grid-layout/pull/1032#issuecomment-541604763) while dragging. Started in [#1032](https://github.com/STRML/react-grid-layout/pull/1032) and finished in [#1123](https://github.com/STRML/react-grid-layout/pull/1123).
- A [fun trick for the curious](https://github.com/STRML/react-grid-layout/blob/44e200067b3640c3230f5511e8624a7c629d2f9a/lib/fastRGLPropsEqual.js).
- Internal refactor of dropping capability. It is now more predictable and uses similar unit labels (`left`, `top`) to other features. [#1128](https://github.com/STRML/react-grid-layout/issues/1128)
- Upgrade devDependencies.
- Remove ESPower from test suite (not useful with Jest).


0.17.1 (Oct 29, 2019)
----

### Bugfixes

- Surround `navigator` check in `try/catch` to avoid problems with mocked navigators [#1057](https://github.com/STRML/react-grid-layout/pull/1054)
- TransformScale is not applied properly while dragging an element [#1046](https://github.com/STRML/react-grid-layout/pull/1054)

0.17.0 (Oct 24, 2019)
----

It's been 18 months since the last release, and this is a pretty large one! For references on the items below, see https://github.com/STRML/react-grid-layout/milestone/1?closed=1.

Thanks to @daynin and @n1ghtmare for taking an active role in maintaining RGL, and for giving it a much-needed shot in the arm, and thanks to the rest of our contributors.

### New Features

- Added ability to drag items into the grid from outside. [#980](https://github.com/STRML/react-grid-layout/pull/980). See [the example](https://strml.github.io/react-grid-layout/examples/15-drag-from-outside.html).
- This is especially exciting as it opens up new "widget toolbox" use cases such as [Example 14](https://strml.github.io/react-grid-layout/examples/14-toolbox.html) with more intuitive interaction. Thanks @daynin.
- `transformScale` prop [#987](https://github.com/STRML/react-grid-layout/pull/987)
- `<ResponsiveReactGridLayout>` now supports margin-per-breakpoint [#1016](https://github.com/STRML/react-grid-layout/pull/1016)


### Bugfixes

- `onWidthChange` only called on breakpoint changes [#770](https://github.com/STRML/react-grid-layout/pull/770)
- Various movement bugs when compaction is off [#766](https://github.com/STRML/react-grid-layout/pull/766)
- Don't fire `onDragStop` if an item is only clicked, not dragged [#1023](https://github.com/STRML/react-grid-layout/pull/1023)
- Fix infinite loop when dragging over a static element. [#1019](https://github.com/STRML/react-grid-layout/pull/1019)

### Internal Refactors

- Both `react-draggable` and `react-resizable` dependencies are now React 16.9 compatible, as is now `react-grid-layout`.
- [RGL PR #990](https://github.com/STRML/react-grid-layout/pull/990)
- [react-resizable](https://github.com/STRML/react-resizable/pull/112/commits/541dee69b8e45d91a533855609472b481634edee)
- [react-draggable](https://github.com/mzabriskie/react-draggable/commit/fea778c8e89db2a4e1a35e563b65634f8146e7e4)
- Webpack 4 [#907](https://github.com/STRML/react-grid-layout/pull/907)
- Babel 7 [#1013](https://github.com/STRML/react-grid-layout/pull/1013)
- Flow 0.110 [#995](https://github.com/STRML/react-grid-layout/pull/995)
- Jest [#774](https://github.com/STRML/react-grid-layout/pull/774)
- Various build simplifications [#773](https://github.com/STRML/react-grid-layout/pull/773)
- Various PR bots - thanks @daynin

0.16.6 (Mar 8, 2018)
----

Expand Down
28 changes: 18 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ clean:
rm -rf $(BUILD) $(DIST)

dev:
@$(BIN)/webpack-dev-server --config webpack-dev-server.config.js --hot --progress --colors --port 4002 --open --content-base .
@$(BIN)/webpack-dev-server --config webpack-dev-server.config.js \
--hot --progress --colors

# Allows usage of `make install`, `make link`
install link:
Expand All @@ -28,26 +29,33 @@ install link:
dist/%.min.js: $(LIB) $(BIN)
@$(BIN)/webpack

# find/exec is more cross-platform compatible than `rename`
build-js:
@$(BIN)/babel --stage 0 --out-dir $(BUILD) $(LIB)
@$(BIN)/babel --out-dir $(BUILD) $(LIB)

# Will build for use on github pages. Full url of page is
# https://strml.github.io/react-grid-layout/examples/0-showcase.html
# so the CONTENT_BASE should adapt.
build-example:
@$(BIN)/webpack --config webpack-examples.config.js
node ./examples/generate.js

view-example: build-example
@$(BIN)/opener examples/0-showcase.html
env CONTENT_BASE="/react-grid-layout/examples/" node ./examples/generate.js

view-example:
env CONTENT_BASE="/examples/" node ./examples/generate.js
@$(BIN)/webpack-dev-server --config webpack-examples.config.js --progress --colors

# FIXME flow is usually global
lint:
./node_modules/.bin/flow
@$(BIN)/flow
@$(BIN)/eslint --ext .js,.jsx $(LIB) $(TEST)
@$(BIN)/valiquire $(LIB)

test:
@$(BIN)/jest
env NODE_ENV=test $(BIN)/jest

test-watch:
env NODE_ENV=test $(BIN)/jest --watch

test-update-snapshots:
env NODE_ENV=test $(BIN)/jest --updateSnapshot

release-patch: build lint test
@$(call release,patch)
Expand Down
Loading