Comments (4)
👍
from incremental-dom.
Maybe you could do something like:
my_thing.js
export {
elementOpen as o,
elementClose as c,
...
} from 'incremental-dom';
import { o as open, c as close } from 'my_thing';
and save even more bytes. If you use Incremental DOM in more than a few files (and you don't have mangling like Closure Compiler provides), you will probably out ahead compared to incremental DOM naming it open
rather than elementOpen
.
Depending on how you are bundling, the index.js of incremental DOM might just be optimized out entirely.
from incremental-dom.
I wouldn't worry about the file size here, but ease of use. I've written openElement
more than a few times.
from incremental-dom.
Any name we choose would be problematic for someone. I have had problems with text
being shadowed by a local variable named text
. Open and close are likewise very generic and could collide with someone's open
or close
functions. ES6 is really nice in that it gives you the power to rename in the import statement itself to avoid these issues.
Ultimately the code is not intended to be written by hand so the naming is pretty arbitrary and you can rename it to suit your needs. Given that, I don't see a compelling reason to change what the library exports just to change it.
from incremental-dom.
Related Issues (20)
- Element Events list HOT 2
- Is Angular 8 Ivy render engine going to effectively replace this project? HOT 2
- Ignoring certain attributes HOT 6
- Update dependencies to remove security warnings
- Extended custom element creation HOT 5
- Issues with webpack and babel HOT 3
- Document: `elementVoid` is incorrect. HOT 2
- Setting prop using Boolean (to trigger prop over attribute) always sets true HOT 7
- DocumentFragment support HOT 5
- Create function loses content HOT 2
- [Performance Advice] Patching to single element or custom elements HOT 16
- Runnable in jsdom (server side rendering)
- Add a module build HOT 2
- Twing implementation HOT 6
- Relationship to Lit / Polymer? HOT 5
- Do not publish ts sources to npm HOT 4
- CDN version not up to date. HOT 2
- Test not launching on macOS 11.2 / Chrome 89
- Details disclosure element <details> adds and removes "open" attribute outside of incrementalDOM HOT 2
- [Performance Advice] `key` parameter for `text()` function
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 incremental-dom.