Comments (4)
I would like common casts added to the list: Boolean, String (helpful for glint)
And utility namespaces: Math, JSON, Date, URL
And Common globals: window, document, navigator, localStorage
Tho, given the congern ef4 raises, i can deal with destructuring globalThis, as awkward as it is. Tho, elements must all be lowercase, so the namespaces and casts seem safe
from babel-plugin-ember-template-compilation.
LIke #38, this was intentional because in general there's no way to statically disambiguate between javascript globals and future ember keywords. That is the tradeoff of not making people import keywords.
We do support globalThis
, so I would expect @something=(globalThis.Boolean this.blah)
to work.
We can decide to support a standard list of platform-provided globals, including Boolean
and document
. Perhaps we should do that right away to mitigate the impact of this change.
The thing we don't want to do is support arbitrary globals. Like, if somebody decides they don't like importing their component all the time and tries window.CustomButton = CustomButton
, that doesn't make <CustomButton />
work in all components.
from babel-plugin-ember-template-compilation.
Another (IMO more important) consideration is html tags, or rather, for the scoping rule to work consistently across all positions (<___>
vs {{___}}
); say we support window
and document
, if HTML later introduces <window>
or <document>
elements, there will be no way to invoke them (without making convoluted excepts to the scoping rules)
from babel-plugin-ember-template-compilation.
Not to say that I am against supporting window
or document
for that reason, but we should keep that in mind every time we consider adding to that list
from babel-plugin-ember-template-compilation.
Related Issues (8)
- Reason for only allowing direct references to in-scope values? HOT 1
- Potential issue with 2.0.1 HOT 2
- 2.0.3 Errors with missing @babel/traverse
- Instructions unclear, got precompile is not a function. HOT 2
- 2.2.2 breaking Embroider tests HOT 7
- 2.2.2 breaking change: 'modifier' keyword is now overridden by local state HOT 4
- .gts test files not working in 2.2.2 HOT 1
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 babel-plugin-ember-template-compilation.