-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[WIP] Add Polymer 2 support #2225
Conversation
… into add-polymer-support
Run through webpack-dev-server
Action addon works
I would wait on supporting Polymer 3 until the team starts announcing a release candidate. |
@robdodson v3 is not just a v2 delivered with npm? Do you have info about some polymer 3 announcements? |
@equinusocio yes it will be delivered over npm but I think the team is still designing the project and I don't know when they plan to release it. So supporting an early alpha might be difficult because they may make breaking changes along the way. |
# Conflicts: # package.json # yarn.lock
We should add a netlify deploy/site for this, so we can demo this! |
# Conflicts: # .editorconfig # lib/cli/package.json # yarn.lock
# Conflicts: # yarn.lock
@shilman I'd like your approval to merge this |
import createChannel from '@storybook/channel-postmessage'; | ||
import Preview from './preview'; | ||
|
||
export default class ReactProvider extends Provider { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this called ReactProvider and not PolymerProvider because it bridging between Polymer and React?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason why don't have demo components defined in here? We do in both react/angular (but don't in vue). don't care too heavily either way, but maybe we should be consistent?
@@ -0,0 +1 @@ | |||
// TODO: add demo stories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will we do that?
Hi all, I have tried the following on my existing stencil project (which is derivated from stencil-component-starter): npm install --save-dev @storybook/polymer polymer-webpack-loader Then I added the script line in the package.json: {
"scripts": {
"storybook": "start-storybook -p 9001 -c .storybook -s www"
}
} I created the import { configure } from '@storybook/polymer';
const req = require.context('../src', true, /\.stories\.js$/);
function loadStories() {
req.keys().forEach((filename) => req(filename))
}
configure(loadStories, module); And a <script src="/build/mycomponent.js"></script>
<link rel="stylesheet" type="text/css" href="/build/mycomponent.css"> Finally I created a story: import { storiesOf } from '@storybook/polymer';
const stories = storiesOf('Button', module);
stories.add('using string', () => ('<hec-button>Click here</hec-button>')); But I got the following error:
This comes from the I have commented out the I don't know if I can override the template |
@naipath something you could do here? |
Polymer 3 is on the way, it will be released in weeks...do worth integrating v2? |
Updating my process with the usage of Just changing the first npm install and keep the rest: npm install --save-dev @storybook/polymer@4.0.0-alpha.4 polymer-webpack-loader lit-html And it works 👍 😄 Just one warning is remaining:
But doesn't seems to be blocking so far. |
What I did
We added initial support for Polymer 2 and set up an example application. We are in the process of improving the compatibility in all browsers and adding support for all Storybook addons. Tests have to be added.
How to test
yarn
in the repo rootyarn bootstrap
in the repo rootexamples/polymer-cli
directory (cd examples/polymer-cli
)yarn storybook
)The Welcome page and example stories should be shown at
http://localhost:9001/
TODO
getstorybook
CLI command for polymerknobs