Comments (5)
I might get confused having only worked on v2 addons for a while, but I do think that our current setup is the "blessed" one as Sander pointed out.
Compare this to e-c-ts docs and its precompile compile command (run as part of prepublish
), which only creates declaration files, but doesn't compile down to JS.
v2 addons do the compilation upfront, as they have to. But I don't think it's worth our time to try to do this as a v1 addon. Also not sure if there is really much benefit, because our v1 addon's code still has to go through ember-cli-babel, with or without TS, and stripping the types away shouldn't be much additional work I think?
from ember-bootstrap.
For V1 addons, the addon controls it's own build behavior.
JS apps will defer the transpilation of the addon's Typescript to addon itself.
I've just tested this by creating a new JS Ember project and adding ember-bootstrap to it. Adding a bs-button just works as expected.
For a live demo, check out the component docs for BsButton. https://www.ember-bootstrap.com/components/button
Our docs app does not use Typescript yet, but the pages for the converted components still work.
from ember-bootstrap.
For V1 addons, the addon controls it's own build behavior.
JS apps will defer the transpilation of the addon's Typescript to addon itself.
Yes. But we don't have a dependency on ember-cli-typescript or typescript or any other package, which may handle the transpilation. That's why I'm surprised that it's working.
Even if we can delay transpilation to JS to build-time of consuming app with v1 addon, I don't think we should do so. It increases technical complexity and has a negative affect on build-time performance.
from ember-bootstrap.
For V1 addons, the addon controls it's own build behavior.
JS apps will defer the transpilation of the addon's Typescript to addon itself.Yes. But we don't have a dependency on ember-cli-typescript or typescript or any other package, which may handle the transpilation. That's why I'm surprised that it's working.
Even if we can delay transpilation to JS to build-time of consuming app with v1 addon, I don't think we should do so. It increases technical complexity and has a negative affect on build-time performance.
I think it's just using ember-cli-babel
for that. I do see that we don't pull in @babel/plugin-typescript-transform
through the dependencies (only through devDependencies), but that package is so widely used in Ember related packages, especially the core ones, that I think most apps have it available through those.
Even if we can delay transpilation to JS to build-time of consuming app with v1 addon, I don't think we should do so. It increases technical complexity and has a negative affect on build-time performance.
That is a valid concern. I do think that most V1 Typescript addons keep the TS in place though. Should we try to precompile the js files and remove the Typescript files from the build bundle?
I really should dive back into the V2 addon stuff. For that one atleast I'm sure we should only ship compiled js (except for the types, ofcourse).
from ember-bootstrap.
Should we try to precompile the js files and remove the Typescript files from the build bundle?
I was surprised to see that this is not the standard. If it's not too much work, we should do it in my opinion. Maybe it's just about running tsc
in prepack
step and adding *.ts
to .npmignore
?
from ember-bootstrap.
Related Issues (20)
- Run tests on Safari again HOT 2
- Remove subclassing deprecation message
- Drop RSVP dependency
- Road to TypeScript HOT 16
- Review need of custom CSS HOT 2
- Deprecate Bootstrap CSS, fonts, and theme import
- Deprecate inserting wormhole target HOT 1
- Improve public API for <BsDropdown>
- Bootstrap 5 dropdown direction and menu alignment HOT 5
- BsCarousel indicators are missing `aria-label` attribute.
- BsCarousel customizable controls are not working HOT 1
- Tracking issue: ember-bootstrap 7.0.0
- Deprecate ember-bootstrap blueprints HOT 2
- [6.1.0] {{on 'click'}}, <LinkTo> and <menu.linkTo> in dropdown menus dysfunctional HOT 8
- Test app does not rebuild when doing changes to the library HOT 2
- Tooltips are positioned too close to triggering element HOT 10
- Support responsive alignment for dropdown menu
- No Button component API docs on www.ember-bootstrap.com
- Remove usage of action template helper and modifier 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 ember-bootstrap.