breezy 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60bf67d656a6087a197ad4fde623f1f7a8534c06
4
- data.tar.gz: badc9b57fc77444f5514a0067846440b14f6d914
3
+ metadata.gz: 04390cdac77569e25cbc5b620e83f4ee91bf52bf
4
+ data.tar.gz: dc5fd6c5012c40372178ec383c79cd47ed20f82a
5
5
  SHA512:
6
- metadata.gz: 48ea2b7305dcdd5e5a86d59045c56d2d8fc475c3ea8c8d37afee0020f91b4709485e4f041f27aee149eb65020ad9ed1f58374a7d45fa5352f1ed333845cd951c
7
- data.tar.gz: 7e270982b63fa0276b64ec5c6dcb664b86b8a6c94d894cad99826dc3e9ba71454136808b1edb4f18f5ec77f2fcaae71f2a051443c44973ee5e06c089b1ac810d
6
+ metadata.gz: 46e782dc395622b456ba87ba5015add0c96d7f27420719b314c483d08978e6527aee94af131dbc5345bc627d4b8d355fa138f57e771dc933a5b881c5c00cc153
7
+ data.tar.gz: 251b1c6d31803306e78d4859045be5835d69ad07061971075ea9b2ec65ce651fc79c2eb635e4d6ff9045f5cc97e2c0eaa6946fdc8c474c5f7da2b336b66e8da0
@@ -1,3 +1,3 @@
1
1
  module Breezy
2
- VERSION = '0.2.3'
2
+ VERSION = '0.3.0'
3
3
  end
@@ -31,7 +31,7 @@ DESC
31
31
  if options[:target] == 'mobile'
32
32
  @view_ext = 'jsx'
33
33
  else
34
- @view_ext = 'js'
34
+ @view_ext = 'js' #todo fix me
35
35
  end
36
36
 
37
37
  @view_path = File.join(destination, "#{@action}.#{@view_ext}")
@@ -43,9 +43,9 @@ DESC
43
43
 
44
44
  def append_mapping
45
45
  if options[:platform] == 'mobile'
46
- app_js = 'app/javascript/packs/application.js'
47
- else
48
46
  app_js = 'App.js'
47
+ else
48
+ app_js = 'app/javascript/packs/application.js'
49
49
  end
50
50
 
51
51
  base_parts = class_path + [file_name]
@@ -4,18 +4,7 @@ import thunk from 'redux-thunk'
4
4
  import { Provider } from 'react-redux'
5
5
  import { render } from 'react-dom'
6
6
  import createHistory from 'history/createBrowserHistory'
7
- import Breezy, {
8
- rootReducer,
9
- pageToInitialState,
10
- setDOMListenersForNav,
11
- setWindow,
12
- argsForHistory,
13
- argsForNavInitialState
14
- } from '@jho406/breezy'
15
- //The navigator is pretty bare bones
16
- //Feel free to replace the implementation
17
- import {Nav} from '@jho406/breezy/dist/utils/react'
18
-
7
+ import Breezy from '@jho406/breezy'
19
8
 
20
9
  // This mapping can be auto populate through
21
10
  // Breezy generators, for example:
@@ -23,40 +12,35 @@ import {Nav} from '@jho406/breezy/dist/utils/react'
23
12
  const mapping = {
24
13
  }
25
14
 
26
- function start({window, url, baseUrl='', history, initialPage={}}) {
27
- setWindow(window)
28
-
29
- history.replace(...argsForHistory(url, initialPage))
30
-
31
- const store = createStore(
32
- rootReducer,
33
- pageToInitialState(url, initialPage),
34
- applyMiddleware(thunk)
35
- )
15
+ const history = createHistory({})
16
+ const initialPage = window.BREEZY_INITIAL_PAGE_STATE
17
+ const baseUrl = ''
36
18
 
37
- Breezy.connect(store)
38
- store.dispatch({type: 'BREEZY_SET_BASE_URL', baseUrl: baseUrl})
39
-
40
- return class extends React.Component {
41
- render() {
42
- return <Provider store={store}>
43
- <Nav ref={setDOMListenersForNav}
44
- mapping={this.props.mapping}
45
- initialState={argsForNavInitialState(url, initialPage)}
46
- history={history}
47
- />
48
- </Provider>
49
- }
19
+ //The Nav is pretty bare bones
20
+ //Feel free to replace the implementation
21
+ const {reducer, initialState, Nav, connect} = Breezy.start(
22
+ window,
23
+ initialPage,
24
+ baseUrl,
25
+ history
26
+ )
27
+
28
+ const store = createStore(
29
+ reducer,
30
+ initialState,
31
+ applyMiddleware(thunk)
32
+ )
33
+
34
+ connect(store)
35
+
36
+ class App extends React.Component {
37
+ render() {
38
+ return <Provider store={store}>
39
+ <Nav mapping={mapping}/>
40
+ </Provider>
50
41
  }
51
42
  }
52
43
 
53
- const App = start({
54
- window: window,
55
- url: window.location.href,
56
- initialPage: window.BREEZY_INITIAL_PAGE_STATE,
57
- history: createHistory({})
58
- })
59
-
60
44
  document.addEventListener("DOMContentLoaded", function() {
61
45
  render(<App mapping={mapping}/>, document.getElementById('app'))
62
46
  })
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: breezy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johny Ho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-28 00:00:00.000000000 Z
11
+ date: 2017-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: coffee-rails
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '4.0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '4.0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: actionpack
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -48,16 +34,16 @@ dependencies:
48
34
  name: breezy_template
49
35
  requirement: !ruby/object:Gem::Requirement
50
36
  requirements:
51
- - - ">="
37
+ - - "~>"
52
38
  - !ruby/object:Gem::Version
53
- version: '0'
39
+ version: '0.3'
54
40
  type: :runtime
55
41
  prerelease: false
56
42
  version_requirements: !ruby/object:Gem::Requirement
57
43
  requirements:
58
- - - ">="
44
+ - - "~>"
59
45
  - !ruby/object:Gem::Version
60
- version: '0'
46
+ version: '0.3'
61
47
  - !ruby/object:Gem::Dependency
62
48
  name: webpacker
63
49
  requirement: !ruby/object:Gem::Requirement
@@ -114,7 +100,7 @@ dependencies:
114
100
  - - ">="
115
101
  - !ruby/object:Gem::Version
116
102
  version: '0'
117
- description:
103
+ description: Rails integration for BreezyJS
118
104
  email: jho406@gmail.com
119
105
  executables: []
120
106
  extensions: []