Comments (7)
In Ractive, you allow people to change the delimeters, is it not possible in Svelte too?
If the curly braces were to be changed, my preference would be to use a similarly easy to type character like the first two options below. Presumably the chosen delimiter would need to not be used in any other way so there are no chances of conflicts.
<< hello >>
[[ hello ]]
<% hello %>
from svelte.
FYI Vue uses {{ for binding }} and {{{ for html blobs }}}
I think many people are worried about having conflicts with php style templating using {{....}}.
from svelte.
My confusion was just from using the term "Mustaches" to refer to the braces. Once I realized they were delimiters and didn't refer to the template library of the same name then it became clear. Perhaps just a documentation update is all that is needed to begin with. There are other good points here so I hope the discussion keeps going.
from svelte.
I've just updated the docs to make the relationship to Mustache (i.e., none) more obvious, so I'll close this as it's definitely the lowest friction solution to the problem.
@mrmartineau yep, we could add an option to control delimiters. For simplicity's sake I'm going to file that under YAGNI but it's something we could revisit in future.
from svelte.
what about $(
starting and a )
ending?
h1 $(hello)
<h1>$(hello)</h1>
from svelte.
We had trouble with mixing Django templating interpolation ({{ … }}
) with AngularJS, so we changed the latter one's to {$ … $}
. (Don't ask about why we were mixing in the first place).
from svelte.
It might be reasonable just pointing out in README that it does not use proper Mustache, without
changing anything.
from svelte.
Related Issues (20)
- `$derived.by` destructor support (Svelte 5) HOT 18
- Nested effect runs twice on state update when wrapped in template effect HOT 4
- Document best practise for unittesting HOT 1
- Better effect stack logging HOT 2
- Parsing error corner case with the `$` and `{` characters
- add typings for svelte/events on(document, on(window
- Track binding values HOT 2
- Can we have specific types for reactive state in Svelte 5? HOT 1
- Svelte 5: Action parameters type inferred as 'any' despite explicit typing
- `class:`/`style:` directives can be overridden by `class`/`style` attributes HOT 4
- Declarative Shadow DOM doesn't work HOT 5
- migrate: Merging event handlers adds an unnecessary parameter HOT 18
- migrate: incorrect parenthesis handling in derived expressions
- Svelte 5: `<script module>` - Cannot use JSX unless the '--jsx' flag is provided. js(17004) HOT 1
- Reactivity breaks on derived if condition (Svelte 5)
- Svelte 5: Logging a proxy in an `$effect` causes it to fire on any mutation HOT 1
- Bug about the same page navigation.
- Uncaught ReferenceError: $$props is not defined HOT 5
- Destructuring reactive components cause $state not being reactive HOT 3
- Svelte 5: `$effect` somewhat broken between v247 and v248 HOT 10
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 svelte.