Comments (10)
@erinpentecost I'm going to try adding in parse.go and the related files so that Parse() works in htmlx. Wish me luck! :) (And let me know if you have any feedback or comments on this.)
from vugu.
I split out some of the requirements into other files, so you'll probably spot some duplicates if you add in everything I removed. I'm slowly working on an io.Reader wrapper that should let us use the normal module.
from vugu.
Okay awesome, thanks for the info!
from vugu.
Ok, I finally finished a writer/reader middleware that can convert between byte offsets and lines/columns. Columns won't be accurate if you use runes that encode to more than one byte. Here's the thing: byteline
I'm working on an edit to vugufmt that uses it. Hopefully it works out.
from vugu.
Awesome! Yeah looks like that could work well. I guess golang/go#31312 never got any further response, bummer.
I'm using your fork of x/net/html for line numbers in some new code I'm writing. If this byteline thing ends up working well, I could switch over to doing that instead.
from vugu.
Note to self on this:
code generator emit proper line numbers
I actually tried this and it was a disaster for this use case. Trouble is generated Go code has lots of code generated stuff in it that doesn't correspond directly to anything in the vugu file (and it's not uncommon for the error to be at this part). And the //line directive does not provide a way "unset" the line back to the original value.
Possibly just the <script> part could be done - if it's place at the bottom of the output .go file and has a line directive, that could, should be tried.
from vugu.
Maybe the best solution is the easy one and just remove the code from inside html and put in a file with a name.
index.html
index_code.go
mymodule.html
mymodule_code.go
So when compiled the errors are in place.
from vugu.
@morpheus747 You can achieve something close to this right now by having myfile.vugu
and myfile.go
right along side each other. The component struct definition and methods, etc. can be in myfile.go and that works well and handles most of the issue. However you still end up with things like vg-if
attributes that can have expressions in myfile.vugu. So far my only idea of how to provide line numbers for that case is in a regular comment in the generated code. So if vg-if="x"
appeared in myfile.vugu on line 100, the generated code could be:
// myfile.vugu:100
if x {
That would probably be better than nothing.
from vugu.
two thinks came to mi mind.
1st i don't see that myfile.vugu and myfile.go in the documentation, maybe is a good idea to add that more clearly, i can do that.
2nd if i understand the problem correctly, the vg-if inside the .vugu files are "extracted" converted to "gocode" and inyected in one file. after that, the file is compiled?
In that case maybe a good "start point" is to just leave the temporal pre-assembled file somewhere so you can see it.
Let me understad this more by checking the code so i can add to this problem, because i face this. And can't found the error in the code and was so frustrating.
Can you give me some orientation about where is the code generator or where start to read the code ?
from vugu.
The generated code (from running vugugen
or using tooling that calls it) goes into a file that ends with _vgen.go. Depending on the options used, this can be in a file with the same prefix as the input e.g. myfile.vugu -> myfile_vgen.go or it can be combined into 0_components_vgen.go.
You should be able to see the emitted if
statement(s) that correspond to vg-if
and so on.
from vugu.
Related Issues (20)
- Using javascript libaries with Vugu HOT 8
- wiring example not working HOT 1
- Consider using GCSS for CSS preprocessing HOT 1
- Panic: index out of range HOT 2
- This fixes the example in examples/fetch-and-display HOT 1
- MDL latest now is updated after many years neglect HOT 2
- Short form of vg-comp tag stops rendering the parent component
- Render server side and client side HOT 3
- webpack loader support and mixed with vue or react HOT 1
- Abandoned? HOT 9
- The Rendered lifecycle of the subcomponent has not been called HOT 1
- Getting Vugu to v1.0 and into production HOT 19
- TailwindCSS and Vugu HOT 2
- Produce a full production example
- State of vgforms package - do we need this for v1.0? HOT 1
- Request for a volunteer: TinyGo support for v1.0 (or shortly after) HOT 2
- Is the library alive? HOT 1
- Vugu v1.0 ToDo List
- Feedback Request: Do you use the generated `main_was.go`? HOT 3
- js Set can not set Function HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vugu.