Comments (9)
@kof jittering is my bad. I had a weird easing on the animation. Doh!
from webstudio.
Ok progress.
By selecting 'Client only' this fixes. I think overall this needs to be clearer or maybe something automatic when dom manipulation is being detected. Would be interesting to know what could be done serverside to know which is the default choice for scripts (html embeds?)
from webstudio.
More related discoveries that trigger the same error.
I have some simple JavaScript that handles my nav button. Showing and hiding the main menu. I've got this in a HTML embed that I've copied across every page.
This works on first load but when navigating to any page, this script fails with the same error.
SyntaxError: Identifier 'menuButton' has already been declared
There's definitely something fruity going on with scripts and how they are loaded/handled.
One small indication is the fading in/out of the menu of my pages. It jitters. Which is normally an indication of gsap code firing a couple of times which syncs up with the "already declared" message.
Live in progress website: https://x-new-worlds-mttq5.wstd.io/
from webstudio.
Mostly server-side is useful for some html/css, 90% of scripts are manipulating dom. Problem is we can't know for sure.
from webstudio.
Once we move icons to a separate component, we could switch it over to client-only by default, so there is less situations to think about, but given icons is a super frequent use case right now, it is not clear which default is more practical.
If you think our tooltip could be better, let me know
![image](https://private-user-images.githubusercontent.com/52824/338209190-fe5fb968-53ec-4757-a188-786c498cd519.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgzODc5NjgsIm5iZiI6MTcxODM4NzY2OCwicGF0aCI6Ii81MjgyNC8zMzgyMDkxOTAtZmU1ZmI5NjgtNTNlYy00NzU3LWExODgtNzg2YzQ5OGNkNTE5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE0VDE3NTQyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQxODc1NzdkMmI0YzE2YTFhODBiOTA3MGJlMDg2ZGM1NTU2YzdmYTU5MGY1YTlkYzQ0NzM5OWU5YThmYzBmZDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.3OEPPPizONFOlXaN5du1W3DGrxGaGzOdyLTPXzMeNv0)
from webstudio.
SyntaxError: Identifier 'menuButton' has already been declared
https://docs.webstudio.is/university/core-components/html-embed#avoid-creating-global-variables
from webstudio.
Maybe we could auto-set type module on scripts ...
from webstudio.
@kof thank you. type="module"
worked perfectly however I am still seeing 'jitters' in my GSAP animation. Not sure if this is related.
issue with auto type="module"
is that In my HTML embed also has CSS in it. Unless you can do something at build time to add type="module"
.
Wording was perfect in the tooltip, it's just knowing what it's there for. Another alternative could be forcing the user to choose client or server side on creation before they are able to add code (still able to switch after the fact) or separate server HTML embed component entirely. It's a neat feature just with a few hidden quirks to use it.
from webstudio.
Seems like all things resolved here
from webstudio.
Related Issues (20)
- Backgrounds panel issues HOT 2
- Update gpt models we use because openai deprecates those in a few days
- Lets make loading of the builder delightful
- favicon.ico not matching project icon? HOT 2
- Ability to add custom attributes HOT 1
- Native Video Component HOT 1
- Assets don't delete when pressing delete from certain areas HOT 1
- Animation name property value adds px unit automatically HOT 1
- Add a redirect option for success state in Webhook Form HOT 1
- Installable marketplace projects
- Install any project using a shared link
- Paste CSS
- Simple localization of static pages HOT 2
- Log UI
- Create a toast notification when creating a new page from a marketplace
- Incorrect Current Page link state on dynamic pages
- Flash of unstyled content con canvas when inserting large chunk
- After cloning a shared template, buttons are still disabled
- Save only transition longhands in style panel HOT 2
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 webstudio.