polymer-starter-kit | A starting point for Polymer apps | Router library
kandi X-RAY | polymer-starter-kit Summary
kandi X-RAY | polymer-starter-kit Summary
This template is a starting point for building apps using a drawer-based layout. The layout is provided by app-layout elements. This template, along with the polymer-cli toolchain, also demonstrates use of the "PRPL pattern" This pattern allows fast first delivery and interaction with the content at the initial route requested by the user, along with fast subsequent navigation by pre-caching the remaining components required by the app and progressively loading them on-demand as the user navigates through the app.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of polymer-starter-kit
polymer-starter-kit Key Features
polymer-starter-kit Examples and Code Snippets
Community Discussions
Trending Discussions on polymer-starter-kit
QUESTION
I'm a novice using Polymer 3 and need to get styles from an element. Can anyone show me a real world example of how to use stylesFromTemplate? I'm struggling.
...ANSWER
Answered 2018-Oct-19 at 14:22Here you go update the _pageChanged
method of the my-app component with the following:
QUESTION
In Polymer-Starter-Kit, how do I observe the current selected view inside , so that I can create an observer and only trigger it whenever the
is selected/visible?
ANSWER
Answered 2018-Jan-31 at 16:14In the iron-pages element, include the attribute "selected-attribute" like this:
QUESTION
Is it possible to reload a page (like /home or /photos) every time the page gets accessed via the app-route element?
...ANSWER
Answered 2017-Sep-25 at 10:40Are there other options for the app-route element available?
Not sure but I think no.
By the way, that behavior comes from iron-location
(included by app-location
) as you can see in source. It just listen click event on body element so you can stop event propagation before it go to body.
For example (didn't test)
QUESTION
I've been adapting the polymer-starter-kit for a project, and there is one thing I just can't get my head around, it's very simple too.
I'm trying to access a custom element using iron-pages.
Here is the code for my app:
...ANSWER
Answered 2017-Sep-19 at 10:09QUESTION
I am using the polymer-starter-kit
project. In that I am using the paper-toggle-button
and the editor-icons.html
elements. When I use polymer serve
to run my project, the toggle button and the edit
icon are shown in the browser.
But, when I build my project using polymer build
, these 2 components are not included in the bower_components
folder of the build.
Following is my polymer.json
:
ANSWER
Answered 2017-Aug-15 at 14:18Your paper-toggle-button
needs to be included somewhere in your codebase or the analyzer can't find it.
If it's not included in entrypoint
(or one of it dependencies) or shell
(or one of it dependencies) or fragments
(or one of it dependencies) then it will not be included in the build - as the analyzer thinks it's actually not needed.
So you either have to include it somewhere in your codebase or add it as a fragment. Depending on what fit's your need.
QUESTION
If I take the Polymer starter kit, it works well locally. I can navigate to http://localhost:8080/ and all the links to the 3 views work fine.
Now, if I host this app on a web server (that is shared with other apps) on a URL such as http://myservername:8080/mywonderfulapp/, I am having trouble with the routing. Is there a way I can mention the app-route to take in the relative URL?
I tried making changes to the html files to have relative URLs
...ANSWER
Answered 2017-Jan-24 at 23:15As stated in the comments, this was solved in a similar posting on stackoverflow.com/questions/39608956/polymer-error-on-reloading
Side note for firebase users - if you deploy this same version of starter kit to firebase and do a firebase serve at the CLI, this problem will even occur in the localhost, so you will need the above fix, even for there.
QUESTION
Can anyone point me to a tutorial that uses Polymer 2 and polymer-build
from Polymer CLI? When I use any example in the polymer-starter-kit
and use polymer serve
, it works fine; but when I use polymer build
and serve the bundled
or unbundled
directory, I get 404
errors. I have even updated to the newest alpha version of polymer-cli
.
Also, using https://github.com/tony19/generator-polymer-init-2-x-app generators have the same problem.
...ANSWER
Answered 2017-Jan-25 at 01:53I noticed a bug in the generator in that the starter-kit
subgenerator was missing a dependency on webcomponentsjs
, which would cause an error with polymer-build
. And as you discovered, polymer.json
was also missing dependencies for the polyfill support of webcomponentsjs
, which caused 404s on polyfilled browsers (such as Linux Chrome). That's all fixed now in v0.0.6
.
You'll also need a version of polymer-build
that does not try to uglify
the JavaScript, which would fail due to its inability to recognize ES6. The new-build-flags
branch of the polymer-cli
repo replaces uglify
with babili
for ES6 minification (added in PR#525). You could check out that branch and build it yourself, or you could install it from here:
QUESTION
I have installed all required packages for polymer.
I downloaded polymer-starter-kit and build it.
If I start polymer serve
, I can get the page similar like following:
However, if I copy the folder /build/bundled
under my polymer app directory, to the place /path/to/tomcat/webapps
, the page I get is only grep background, nothing more.
I would like to know how to properly deploy a polymer app on tomcat.
If I just build
a very very simple polymer with only one element instead of the polymer-starter-kit, after copying the /build/bundled
into /path/to/tomcat/webapps
, the page can be shown properly.
ANSWER
Answered 2017-Jan-03 at 19:37As for the Polymer Issues
Configuring Polymer to work properly on these Java Servlet based web servers can sometimes be kind of tricky. For starters open up dev tools to see what kind of errors you are receiving, likely you'll see some failed imports that shouldn't be overly difficult to resolve.
This is a drawback of using a servlet container to manage a non-servlet based application. Don't be discouraged it can be done, we have several apps in production on Tomcat servers.
You will likely have to throw polymer serve
out the window for this project and setup a local Tomcat server to do your development on. As these behave completely differently.
Things to Keep in Mind
Not sure what your overall goal for the project is or how much availability you have to make adjustments to the Tomcat environment (which I assume would be a production goal.) You will want to use hash based routing straight from the beginning. These servlet containers are going to be looking for Java classes to handle URL(s).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install polymer-starter-kit
The npm run build command builds your Polymer application for production, using build configuration options provided by the command line or in your project's polymer.json file. You can configure your polymer.json file to create multiple builds. This is necessary if you will be serving different builds optimized for different browsers. You can define your own named builds, or use presets. See the documentation on building your project for production for more information.
es5-bundled is a bundled, minified build with a service worker. ES6 code is compiled to ES5 for compatibility with older browsers.
es6-bundled is a bundled, minified build with a service worker. ES6 code is served as-is. This build is for browsers that can handle ES6 code - see building your project for production for a list.
esm-bundled is a bundled, minified build with a service worker. It uses standard ES module import/export statements for browsers that support them.
This command serves your app. Replace build-folder-name with the folder name of the build you want to serve.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page