-
-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PROGRESS] ES6/ES7 support roadmap #306
Comments
Heyo, tbh I'm in no hurry with ES6/ES7 code base transition. The real benefit I realize from your post is a gzip reduction which I welcome ofc. Where do you have the numbers from? From my experience libraries tend to get larger, but this is just my observation. Upcoming Bootstrap v5 might bring additional work to bsn already. We should focus on this task first, I think |
@midzer in regards to manual tokenization, check this out #269. I think BS5 will come with ES6/ES7 sources, no jQuery dependency, and mostly minor tweaks to components for usability, accessibility and hopefully less or no dependency. As for the hurry aspect, I think it's a good time to gather around and have a little chat about it, put some ideas on paper and come with a plan. We're not competing with original script, we try and make it better in some ways. |
I have a first proposal for our components: how about the possibility to enable using Tooltip / Popover simultaneously with other components like Modal, Dropdown, Collapse, Button and Tab. The solution is simple: we just use a different markup for Tooltip and Popover targets. For instance Carousel uses I know this would be quite the difference with the original plugins, but I think it's necessary in order to enable this functionality, so please let me know what you think about it. |
What do you mean "simultaneously with other components"? Do you want to use Modal , Dropdown , Collapse , Button and Tab in Tooltip (in tooltip-inner)? |
I suggest to apply architecture of import of components, with possibility to include in bundle only the components necessary to the developer. Now the bundle always includes all the components. When switching to ES6/ES7 using |
Dropdown with Tooltip, Modal with Tooltip, Button with Tooltip would be nice, however Dropdown and Modal may not be needed. I'm thinking of combinations that make sense.
No, you can build a bundle with only or except the components you want, while the ES6/ES7 standard will make this possibly easier to create builds. But mostly I agree with your suggestions. |
* added first ES6/ES7 code draft to `lib/src` folder, the following changes apply * all components have `destroy()` method * recent fixes to allow re-init are included (on re-init we trigger `destroy()` before anything else) * more clear init objects ( in essence we're talking `{chaos,options,methods}` -> `{element,target,options,methods}` ) * removed manual tokenization, resulting in easier long term maintenance, the min files will be larger while gzip files should be 7-10% smaller, now @mustafa0x should be happy #269 * replaced `getClosest()` utility with native `element.closest(selector)` * Popover and Tooltip now both use `options.template` and make use of attributes like `data-title` to fill in the template markup * Popover and Tooltip can work simultaneously with other `data-toggle` components via `data-tip="tooltip"` and `data-tip="popover"` attributes (Modal,Dropdown,Tab,Collapse) TO DO (priority ordered): * debug and fix all issues resulted in removal of manual tokenization or other module import/link related issues * evaluate and discuss code structure to find opportunities for new features and code quality improvements (constructor, private & public methods, etc) * Toast component: aren't `destroy()` and `dispose()` methods supposed to do the same? * we need a new ES6/ES7 friendly `initCallback`, we might also need an ES6/ES7 friendly `removeDataAPI` for all components, the opposite of `initCallback`, a possible draft at `src/util/callbacks.js` * we need a new bundle builder (lib/bundle.js) to do ES6/ES7 `index.js` -> ES5 `bootstrap-native.js` compilation + uglify work, that's where YOU come in (rollup, babel, promise, whatever you need, bring it) * we need a full documentation for V4 page, the future main page of the project * wiki updates @cvaize and everyone interested in this thread please join discussion here #306 Happy New Year!
* added first ES6/ES7 code draft to `lib/src` folder, the following changes apply * all components have `destroy()` method * recent fixes to allow re-init are included (on re-init we trigger `destroy()` before anything else) * more clear init objects ( in essence we're talking `{chaos,options,methods}` -> `{element,target,options,methods}` ) * removed manual tokenization, resulting in easier long term maintenance, the min files will be larger while gzip files should be 7-10% smaller, now @mustafa0x should be happy #269 * replaced `getClosest()` utility with native `element.closest(selector)` * Popover and Tooltip now both use `options.template` and make use of attributes like `data-title` to fill in the template markup * Popover and Tooltip can work simultaneously with other `data-toggle` components via `data-tip="tooltip"` and `data-tip="popover"` attributes (Modal,Dropdown,Tab,Collapse) TO DO (priority ordered): * debug and fix all issues resulted in removal of manual tokenization or other module import/link related issues * evaluate and discuss code structure to find opportunities for new features and code quality improvements (constructor, private & public methods, etc) * Toast component: aren't `destroy()` and `dispose()` methods supposed to do the same? * we need a new ES6/ES7 friendly `initCallback`, we might also need an ES6/ES7 friendly `removeDataAPI` for all components, the opposite of `initCallback`, a possible draft at `src/util/callbacks.js` * we need a new bundle builder (lib/bundle.js) to do ES6/ES7 `index.js` -> ES5 `bootstrap-native.js` compilation + uglify work, that's where YOU come in (rollup, babel, promise, whatever you need, bring it) * we need a full documentation for V4 page, the future main page of the project * wiki updates @cvaize and everyone interested in this thread please join discussion here #306 Happy New Year!
Howdy and Happy New Year! Great work so far 👍 I'm just working on it to bring rollup bundler into the process. I'm gonna do a PR once I got something ready. |
Write when I should start testing the health of all components. I plan to start tests on Chrome, Safary, Firefox, Safary (Iphone 5)(Old browser), Edge, IE11, IE10, IE9. |
@cvaize we're looking into ways to include components and their respective utils as well as initialization scripting. What would you suggest? |
Are you sure we're not adding it where we don't need it? Don't we need to filter that out if not needed? IDK, I'm just asking? |
Most experienced developers import only the components they need, and our goal is to ensure that these components do not contain unused code. |
At the moment, this is all, I will conduct performance tests in browsers when you write to me. |
I know, but just for me to know: rollup will try and remove unused code or just concat code that modules actually need? Also how do you suggest we implement options for the rollup? (components to be used, add/remove init/remove) How about using uglify instead of rollup-minify we use now? I hope we can do custom headers for the minified files. |
I use webpack like millions of people do. Therefore, you should not rely only on rollup. From components it is necessary to remove the code of mass initialization I consider. People are more likely to import the component, put the element in the component constructor, and then manage the created object through its public methods. |
All right, I'll run tests soon. |
According to https://medium.com/@kelin2025/so-you-wanna-use-es6-modules-714f48b3a953#dd9e conclusion we should prefer I will give more feedback when I finished deep testing master in some of my projects. |
The initial test in Google Chrome I finished, after fixing the bugs found, I will repeat the test. In the current test, I did not consider working with parameters. I'll test them in the next test. |
Checked the closed issue. I will continue the tests tomorrow, today I can not devote more time to them. |
I will continue the tests tomorrow, today I can not devote more time to them. |
Guys what do you think of setting up an auto-polyfill script via babel.js? |
I'm kind of in favor of two approaches:
|
Is the webpack loader still required? I ask because, although it's still mentioned in this project's README, it isn't marked as compatible (per peerDependencies) with the 3.x release of Bootstrap Native. |
It's not updated, I'm updating the README.md now. |
@swrobel do you have any suggestion on what that loader should look like considering the new library code base and build scripts? |
@thednp unfortunately not |
Hello everyone. How you all doin? I want to open a public debate on developing/transitioning towards ES6/ES7 standard(s).
Progress
index.js
-> ES5bootstrap-native.js
compilation + uglify work, that's where YOU come in (rollup, babel, promise, whatever you need, bring it), thanks to @midzer we now have a rollup script introduce rollup bundler #326BSN = {components:[], initCallback(), supports[]}
destroy()
anddispose()
methods are supposed to do the samedestroy()
todispose()
method for all components// BSN | author | License
style header for.min.js
filesInitial Notes
bootstrap-native-legacy.js
and moved to aBSN-V3-legacy
branchelement[styleString]
comes back toelement.style
) will go away for easier module "connectivity",offsetTop
,marginLeft
) will all be removed, but essential utilities will remain untouched such asstyleTip
or event related utilities likeemulateTransitionEnd
andon
,off
bootstrap-native.min.js
will get back from ~20kb to around ~40kb, but the gzip size will decrease by about 7-10%this
or what stays private)Please join, I need to know your key points, availability and any suggestion.
This is a draft, expect changes
The text was updated successfully, but these errors were encountered: