Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapted to work with Polymer 3.0 #99

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>polymer-redux</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
<script src="./node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../iron-component-page/iron-component-page.html">
</head>
<body>
Expand Down
2 changes: 2 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Element as PolymerElement } from '../../@polymer/polymer/polymer-element';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong. lib/index.js is generated from npm run build.
Also why are you including this here when we don't use PolymerElement anywhere?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should maybe document this on the README actually of how to build the repo.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't know that... ok maybe it's better if I leave the repo adaptation to v3 to you, the main thing that is required to make polymer-redux working in a v3 project was that

import {get} from '../../@polymer/polymer/lib/utils/path';

thing, so in the meanwhile I can work with my fork.
Sorry for the inconvenience

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, don't be sorry. I'm snowed under at work, this is great I really appreciated it 👍

Just run npm run build then commit the changes and you're done 🎉


var PolymerRedux = (function () {
'use strict';

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@
},
"homepage": "https://github.com/tur-nr/polymer-redux#readme",
"dependencies": {
"@polymer/polymer": "next",
"global": "^4.3.1"
},
"devDependencies": {
"@polymer/iron-demo-helpers": "next",
"babel-jest": "^19.0.0",
"babel-plugin-external-helpers": "^6.8.0",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-preset-env": "^1.2.2",
"babel-register": "^6.24.0",
"bower": "^1.5.2",
"coveralls": "^2.11.9",
"del": "^2.2.2",
"gulp": "^3.9.1",
Expand All @@ -54,6 +55,7 @@
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-node-resolve": "^2.0.0",
"run-sequence": "^1.2.2",
"web-component-tester": "^6.1.5",
"xo": "^0.18.0"
},
"xo": {
Expand Down
1 change: 0 additions & 1 deletion src/index.html

This file was deleted.

5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import window from 'global/window';
import console from 'global/console';
import {get} from '../../@polymer/polymer/lib/utils/path';

// Expose globals
const {CustomEvent, Polymer} = window;
const {CustomEvent} = window;

/**
* Polymer Redux
Expand Down Expand Up @@ -59,7 +60,7 @@ export default function PolymerRedux(store) {
const {statePath, readOnly} = properties[name];
const value = (typeof statePath === 'function') ?
statePath.call(element, state) :
Polymer.Path.get(state, statePath);
get(state, statePath);

if (readOnly) {
element._setProperty(name, value);
Expand Down
Loading