Skip to content
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

Option to output just a single html import file containing all templates #1695

Closed
krisnye opened this issue Oct 31, 2014 · 7 comments
Closed

Comments

@krisnye
Copy link

krisnye commented Oct 31, 2014

I need to use the web components programmatically. I don't want the output to be a stand alone html page. I want it to just contain all of the web components that I will need. This way, I can use an html import on the resulting file and then instantiate any of the contained web controls via javascript.

@dfreedm dfreedm self-assigned this Oct 31, 2014
@dfreedm
Copy link
Member

dfreedm commented Oct 31, 2014

That sounds reasonable.

@davidmaxwaterman
Copy link

yeah, this is what I want too. my 'index.html' file is generated programmatically, but it imports one (or two) polymer elements which also import other elements.
I want to be able to run vulcanize on my 'app' element and it will basically avoid all those individual imports, leaving me with just one that I put in my generated index.html.
Perhaps I can make a 'fake' index.html that is like the generated one, and then see what it contains to make my single polymer file that contains all my app's polymer elements and all the paper/core elements too. Does anyone have any ideas/tips?

@davidmaxwaterman
Copy link

I note the -h help for vulcanize :

"vulcanize: Concatenate a set of Web Components into one file"

One interpretation of that would not include any 'index.html', I'd say :)

IMO, what it does now is more like "Pre-import web components into their top-level parent html document.'

@floatdrop
Copy link

We need this too. Is there any status update on it @azakus? //cc @nyakto

@alixeb
Copy link

alixeb commented Jul 31, 2015

Would this change also involve passing html as a string to be processed?

i.e if you use Flux/React your server code output html as a string, that you then want to feed to vulcanize and get back a string that you can then send as type html.

const html = React.renderToStaticMarkup(htmlComponent({
     clientFile: env === 'production' ? 'main.min.js' : 'main.js',
     context: context.getComponentContext(),
     state: exposed,
     markup: React.renderToString(createElementWithContext(context))
}));

// do vulcanize steps here on html variable?
// shall we have a new function processHTML?

debug('Sending markup');
res.type('html');
res.write('<!DOCTYPE html>' + html);
res.end();

Or should I create a separate issue/improvement for that scenario?

@eximius313
Copy link

We also need functionality of importing single html file containing all components in it.
It would be awesome to have possibility to import it like that:

<script type="text/javascript" src="components/webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="components/all-vulcanized-components.html">

@joineral32
Copy link
Contributor

joineral32 commented Jun 19, 2016

Any particular reason why this issue ended up abandoned/closed? Not having this feature limits Polymer's utility in a server-side templated application. I'm using Express with Handlebars to render our different views' HTML, and using Polymer elements as tags in that rendered HTML to allow us to spit out a page that features rich UI components. Vulcanize is not useful for that purpose, and I really don't like the idea of pulling in all those components individually...

@aomarks aomarks transferred this issue from Polymer/polymer-bundler Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants