astoilkov / OneScript

:traffic_light: HTML, CSS and JavaScript brought together in one complete solution
MIT License
44 stars 2 forks source link

link stylesheet and script javascript #2

Open hueitan opened 9 years ago

hueitan commented 9 years ago

<link rel="stylesheet" href="xxx.css"/>

<script type="text/javascript" src="xx.js"></script>

astoilkov commented 9 years ago

Can you give a little more context? What do you mean by that?

hueitan commented 9 years ago

I didn't see anything about this in your example.

astoilkov commented 9 years ago

Yes because it stays the same. You could reference a external JavaScript and CSS the same way you will do it in regular page. I am only thinking in a shorthand syntax like this one (but not sure about it):

<css href="xxx.css" />
hueitan commented 9 years ago

:+1: cool for that.

astoilkov commented 9 years ago

From the little that could be seen - what do you think about OneScript?

hueitan commented 9 years ago

I have the same idea about how to writing a "component" means html/css/js should be in one file.

In traditional way, every times we need to find out the method, we may need to go though all the folders and files to get the method function.

In this kind of "component", we can directly find out the style and script. It's easier for maintaining and debugging.

I have thinking about this before and I found webcomponentit's quite useful. After that reactjs, seems everything writing is javascript within one file, but in the end it's not.

Actually it's quite surprise and happy that I found your repo and then OneScript, that's the one I always think about. But i have no idea what structure it should be, it's still be the imagination on our mind.

Cool, I love the project you have done. :beers:

hueitan commented 9 years ago

Hi @astoilkov What do you think about polymer

astoilkov commented 9 years ago

Polymer is a great project. I love web components but it is too big a framework for me. I have been experimenting for the past couple of weeks and I believe the solution should be more complex for compiling and super simple for the client-side code. I am experimenting with something around the 500 lines of code.