Dabolus / polymer3-webpack-starter-kit

Polymer 3 Starter Kit with Webpack
MIT License
55 stars 6 forks source link

Breaking changes in Polymer Elements Pre.15 #72

Closed logicalphase closed 5 years ago

logicalphase commented 6 years ago

I caught your note about breaking changes on the latest polymer element update. It appears, from my scan of a post from Polymer earlier today, that they are moving away from many of the paper styles and components in favor of using what will be called Polymer Material Components. This looks like the right change to me because since Polymer started incorporating layout into the app elements it's caused issues with Paper Elements. It's also pretty well known that Polymer hasn't been able to keep up with Google Material Design regards to standards, elements, and animation. So, this should be a good thing.

But on running an update to latest PSK and polymer pre.13 with elements pre.15 my app broke. Turned out to be paper styles like buttons, etc. I think this is probably what happened to you earlier. I removed paper styles and and some components and, while it hurt some styles in the app, everything does work. So, if you want to assign this to me, I'd be happy to work on it and create a PR when ready. Shouldn't take long (I hope) ;-)

Dabolus commented 6 years ago

Completely missed that blog post, thank you for letting me notice it! Yeah, that's exactly what happened to me, but I decided to avoid investigating more because I was working on a blocking bug (the polyfills not working). By the way, thanks for your time, any help is always appreciated! I'm assigning it to you right now

Dabolus commented 6 years ago

About that blog post, I read it and found two possible enhancements for this project:

  1. Migrate to those new material components that are already available here
  2. Migrate to lit-html, as it seems to be the next standard for HTML template literals. It shouldn't be too hard to do that using LitElement (that is also the element the new material components depend on)
logicalphase commented 6 years ago

Happy to help if I can. Thanks for the fills fix. 👍

On Thu, May 3, 2018, 11:41 AM Giorgio Garasto notifications@github.com wrote:

Assigned #72 https://github.com/Dabolus/polymer3-webpack-starter-kit/issues/72 to @hyperpress https://github.com/hyperpress.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Dabolus/polymer3-webpack-starter-kit/issues/72#event-1608146782, or mute the thread https://github.com/notifications/unsubscribe-auth/AYC27bqh4rEp4IaDEAu8apKGR4eaiihpks5tuzMogaJpZM4TxZIi .

logicalphase commented 6 years ago

I'm in total agreement. lit-html looks really good, and I'm liking the MDC fix for presentation.

On Thu, May 3, 2018, 11:46 AM Giorgio Garasto notifications@github.com wrote:

About that blog post, I read it and found two possible enhancements for this project:

  1. Migrate to those new material components that are already available here https://github.com/material-components/material-components-web-components
  2. Migrate to lit-html, as it seems to be the next standard for HTML template literals. It shouldn't be too hard to do that using LitElement https://github.com/polymerlabs/lit-element (that is also the element the new material components depend on)

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Dabolus/polymer3-webpack-starter-kit/issues/72#issuecomment-386360428, or mute the thread https://github.com/notifications/unsubscribe-auth/AYC27U3olDUnIyTQJCX0Br5g9Bnn74i0ks5tuzRbgaJpZM4TxZIi .

logicalphase commented 6 years ago

I've been reading up on lit-html, I've opened a local git rep and branched for this change. But, I was thinking it might be good to open a branch on your GitHub project for LitElement, MDC, and I can work in fixes for breaking changes to P3 final prerelease and then 3.0 rollout expected at I/O 2018.

It's clear lit-html is going to be the default, and I can see why. So, I think it will keep this TypeScript PSK synced more closely with structure of official PSK in non-TypeScript. Pretty exciting really.

Anyway, I've got time mid next week to devote uninterrupted days to this. But I'm certain I'll need to run proposed PRs. Looking forward to seeing this project stand out as the TypeScript option for PSK P3.

Dabolus commented 6 years ago

I created the refactor/lit-html branch for you, now I'm editing some repo permissions so that you can do whatever you want on that branch. By the way, yesterday I played around a bit with LitElement, and I noticed that it doesn't work well with this "separation of concerns" layout because it uses variables inside the JS template you pass to it to update only what is necessary, but the external HTML and SCSS files we are using are injected in the template as two big variables, so lit-html will update the entire element UI when a variable is modified. I didn't find a workaround to this for now, but probably a custom loader will do the work.

logicalphase commented 6 years ago

Thank you for doing that. Yes, it looks like lit won't play well with this. I've fired off an email to Justin (author of lit-html) to see if he has any best solutions for this. Either way will let you know as soon as possible. Thank again.

https://themesurgeons.com

https://themesurgeons.com

logicalphase commented 6 years ago

Just chatted with Justin on Slack. He said he plans on working in a html compiler after Google I/O. But he pretty strongly recommended modifying the structure back to single file Element layout. He can think of several problems beyond injection and feels the performance disadvantage with LitElement would be significant even if we can find a workaround. Not sure how you feel about it, but combining the Element concerns is not a huge bother to me.

Dabolus commented 6 years ago

I tried to think at various possible solutions to keep the template separated from the rest:

  1. Write a custom loader that takes the "old style" template and converts it into a lit-html template at build time
  2. Convert the HTML file into a module that just contains the lit-html template as an export; e.g.
    
    import {html} from '@polymer/lit-element';

export default (props) => html`