Add js logic to external web components - polymer

I started to use web components from bower recently in my applications. I am trying to tweak a small logic in a particular web component. I want to know is there a way we can change the js logic specific to a component in my local js file instead of forking a repository and try to do it.
Thanks in advance.

For quick hacks you can go to bower_components and experiment. For persistent changes you will need a fork.
Of course you could try monkey-patching by replacing methods/functions but it's ugly and brittle in case the dependency library changes.

Related

How to add a custom dropdown in ckeditor4-react

I have an instance of ckeditor4-react running, but I want to add a control (such as a customised dropdown) of my own design.
The documentation largely talks about adding files to the node_modules folder, which makes sense in theory, but is going to be a problem for deployment when the build script runs npm i. For that matter, I would expect this to be a common problem.
So my question is, how do people usually work around this?
I need:
A way to develop the customisation (in a sandbox is fine).
A way to deploy it that doesn't involve too much specialisation of the existing deployment system.

Is there a way to import Polymer 3 components in Polymer 1?

I have just received a legacy project which was implemented using Polymer 1. For some reasons, I have a plan to change it to Polymer 3. There are lots of custom components. Also, it is a huge project and I want to gradually transform it step-by-step. My plan is that I want to change the components first and import them to the old project. When all components are finished, I will go for the rest of the project.
I want to ask if it is possible to take this approach and how? I have searched through the Internet but I cannot find any recommended approach in this case. If there is other recommended method, please tell me.
Thank you in advance!
Sorry but the answer is no you can´t. You can load Polymer as library only once (It is using the same namespace) per browser window so you must decide which version to use. The only way i think i will be possible is with an iframe but i guess that is not a suitable way for you.

Can Alcatraz be used to add build rules?

I'd like to create an Alcatraz plugin that adds a new project Build Rule to Xcode. Currently our tutorial requires that the developer manually add the rule, pasting in a script. None of the current plugins appear to add build rules -- is it possible?
It's probably possible because when writing a Xcode plugin you basically gain access to all Xcode's private classes & methods + the current Xcode state in memory. So yes, with a good amount of reverse engineering it should be doable.
Now I doubt this is a very good idea as such a plugin would act at the IDE level and not a project level, so you'd have to ask the user to select a project before adding the build rule.
From my point of view, building a plugin for this is way overkill, and a tutorial is good enough (you're interacting with developers after all, they probably know how to click a few buttons), and if you really want to take your users by the hand I'd recommend using a script (bash, python, ruby, etc.).
Crashlytics and Cocoapods both require to add a build step to the developer's project, and they both seems to do pretty well with instructions / a script.

Vulcanize local Polymer app

We use Polymer to build a local app. Each Polymer element has a .html and .css (compiled from .scss) file.
Does the use of vulcanize (it concatenates the JS and Polymer elements into one file) provide an advantage? Does the use of some minify tool after vulcanize provide any advantage?
Once again, it is a local (only) app so I mostly care about performance and speed.
From Concatenating Web Components With Vulcanize.
The short answer is “don’t guess it, test it”. There is always a
trade-off when it comes to concatenation but tools like WebPageTest
can be useful for determining what your true bottlenecks are.
You can use chrome browser developer tools (acess via menu) and compare application load speed for plain, vulcanized, minified versions or combinations of them.
Then decide which bests suits your needs.

Starting up a node.js project

I'm about to start a project that's going to be a web site for storing photos. The method for uploading shall be drag and drop (from the desktop, same as Imgur), and it shall be possible to rate the photos as well commenting them.
For the project I'm going to use Node.js as well as HTML5, CSS3 and jQuery. The thing is that I'm a total newbie on Node.js and really could use some help regarding getting started. For the project I will of course need a database, and I have understood that MongoDB is a good choice. Is there any templates for this combination, so that I don't need to start from scratch?
I have installed Node.js and followed some tutorials but I really feel that I want to a template if there is one.
Thanks in advance!
As you said you are a beginner you can take the best independent modules for your project and start using. Instead of having a pre-defined package of necessary components as a single module. Problem is you may end up not understanding the whole pack and become more biased.
So,
I would suggest to use Expressjs (Best Choice) for url routing as mentioned above.
And,
File upload management:
formidable - a high performance file upload server with file parts reading and progress notifiers etc.
Template Engine (Markup libs for your custom htmls):
Jade
coffeekup
And consider Bootstrap as well for prebuilt templates if in case you need it.
Mongo - Good choice.
Mongo Modules
These libs should help.
Take a look at HTML5 Boilerplate + Express.js
As a basic starting point, this is a popular framework:
http://expressjs.com/
Here you will find some links to example applications:
Node.js Web Application examples/tutorials
https://github.com/heroku/facebook-template-nodejs
Open Source Node.js (and Express) projects
Express JS is good but I would recommend you have a look at Railway JS as well.
It is based on Express with support for numerous template engines and database adapters (including MongoDB). It is a lot more modular so you should not have much trouble working with it (in my opinion).
Check out: Uploading images using Node.js, Express, and Mongoose too.
Here is a list of resources that I have compiled using themeefy to start a node.js project http://www.themeefy.com/AvinashEga2/nodejs
I think Tower.js is something like what you're after.