-
Notifications
You must be signed in to change notification settings - Fork 406
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
"Open in new window" should be a page with no PL JS #265
Comments
Hi Evan. For what it's worth - this is how PL PHP has always worked, at least in the v1 world which Node is still emulating for the most part. I completely understand the use case you are describing. I'm open to suggestions as to how to make this better without throwing the baby out with the bath water. Perhaps a different control / button / link other than the right-click context menu default behavior would meet this need. |
Thanks for the clarification - those two tickets are on deck. |
@bramsmulders what version of PHP are you referring to when stating that this behavior does not occur? I am certainly not running latest PHP anymore but as of Pattern Lab PHP 0.7.0 which I am modeling the filesystem restructure off of - it appears to still add PL footer code - indeed it needs to in order to run. Thanks! |
cc @dmolsen |
@bmuenzenmeyer, i'm pretty sure it is Patternlab-php 0.7.0. They have a pattern header and footer, but they also include |
Ok. I am making those changes, and they are actually mostly live in https://github.com/pattern-lab/patternlab-node/tree/133 but what is throwing me for a loop is the assertion that there is no PL logic when opened in a new window. From what I know of 0.7.0, that's impossible. Need to keep looking perhaps - Dave always surprised me. |
Is this still on the roadmap? |
@mauricios can you include the entire output of the offending pattern? |
@bmuenzenmeyer using the home page of the Pattern Lab demo http://demo.patternlab.io/patterns/04-pages-00-homepage/04-pages-00-homepage.html the w3c validation tools shows errors in the meta tags generated by Pattern Lab:
See the report: https://validator.w3.org/nu/?doc=http%3A%2F%2Fdemo.patternlab.io%2Fpatterns%2F04-pages-00-homepage%2F04-pages-00-homepage.html |
The demo site, last I heard, was built using Pattern Lab PHP. cc @bradfrost |
@bmuenzenmeyer that's correct, although I'd assume that the behavior should be the same here between Node and PHP. As I recall the cache stuff was there to ensure the browser didn't aggressively cache changes during development. |
As @bradfrost says the same headers appear in the Pattern Lab Node. In my test I can see that the meta tags are unnecessary since the Node server of Pattern Lab is already sending the HTTP headers for preventing the cache on the browsers. This is the request headers of Pattern Lab Node:
|
the content you are specifiying comes from https://github.com/pattern-lab/styleguidekit-mustache-default/blob/master/views/partials/general-header.mustache which is a dependency of PL PHP and Node. If you don't like it you have a few options:
Your request is different than the original poster, however, so I'd ask that you bring your conversation somewhere else if we need to continue. Back to the OP.... The homepage example is telling however, along with Brad's assertion that PL PHP output currently has all the additional code included too. It's just the way PL currently works, to support the iframe viewer and all its data processing and interaction, we ship each pattern snippet with logic needed to run in isolation. I think Brad has even written glue code for styleguide guide that removes this code. I could see use cases for pattern export being "clean" and if I recall correctly, this is a feature / goal of that process. |
I am using Pattern Lab Node
v1.1.2
onMac
, using thegrunt
configuration.Expected Behavior
When I view a pattern and click on "Open in new window" I should get an HTML page with no Pattern Lab assets so I can help troubleshoot to see if things like JS errors are from my code or conflicts with my code and Pattern Lab's JS. Currently this is loaded on that page and comes from
./source/_patternlab-files/pattern-header-footer/footer.html
:Actual Behavior
I go to the "Open in New Window" page and see
<script>
tags other than I added.Steps to Reproduce
npm i && grunt serve
</body>
tag.The text was updated successfully, but these errors were encountered: