-
Notifications
You must be signed in to change notification settings - Fork 424
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
feat!: major folder restructuring with esbuild to support iife
, cjs
and esm
and TypeScript
#804
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* feat!: Drop jQuery requirement
- fix ESLint for Cypress - also remove jQuery from package.json list of dependencies
- remove jQuery from plugin and also in the autotooltip example as well
* chore: apply better code styling to few core files
* feat(plugins): remove jQuery from range decorator selection model
- Slick.Map polyfill is no longer required since Map is included in ES6 browsers
…n needs to become continue)
…effect when auto scrol
ghiscoding
changed the title
feat!: major folder restructuring with esbuild to support
WIP - feat!: major folder restructuring with esbuild to support Jul 10, 2023
iife
, cjs
and esm
and soon TypeScriptiife
, cjs
and esm
and soon TypeScript
- fixes #219 by providing `scrollRenderThrottling` grid option, defaults to 50ms, the user can decrease the throttling and see what is the best fit for them
ghiscoding
changed the title
WIP - feat!: major folder restructuring with esbuild to support
feat!: major folder restructuring with esbuild to support Jul 13, 2023
iife
, cjs
and esm
and soon TypeScriptiife
, cjs
and esm
and soon TypeScript
@6pac I'm going to merge this PR to This way you can start testing and toying with the new structure and you could start creating PR against it (on the |
ghiscoding
changed the title
feat!: major folder restructuring with esbuild to support
feat!: major folder restructuring with esbuild to support Jul 13, 2023
iife
, cjs
and esm
and soon TypeScriptiife
, cjs
and esm
and TypeScript
ghiscoding
added a commit
that referenced
this pull request
Sep 19, 2023
* feat!: major folder restructuring with esbuild to support `iife`, `cjs` and `esm` and soon TypeScript (#804) * feat: migrate all Controls to TypeScript (#808) * feat: migrate all Menu/Buttons Plugins to TypeScript (#811) * feat: migrate all Decorator & Selection Plugins to TypeScript (#812) * feat: migrate CheckboxSelector & State Plugins to TypeScript (#813) * feat: migrate Draggable Grouping Plugins to TypeScript (#814) * feat: migrate Resizer Plugin to TypeScript (#815) * feat: migrate RowMoveManager Plugins to TypeScript (#817) * feat: migrate RowDetail Plugin to TypeScript (#822) * feat: migrate RemoteModel Plugins to TypeScript (#823) * feat: remove deprecated DataView methods (#833) * feat: remove deprecated DataView methods - `setAggregators` and `groupBy` were both replaced by `setGrouping` many years ago, so no need to keep these old functions anymore * feat: add new trading platform high frequency update grid (#835) * feat: add new trading platform high frequency update grid * fix: copying multiple times only kept last undo CellExternalCopyManager - fix an issue where copying and pasting to multiple area only kept the last undo and reapplied it over and over and the cause was because the clipCommand was global to the class so it only kept the last undo, the fix is to make sure the clipCommand variable is local to the execution handler instead --------- Co-authored-by: Nikhil Giddaluru <38428547+nikhil5693@users.noreply.github.com> Co-authored-by: Ben McIntyre <email.ben.mcintyre@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
dist
folderiife
which is the same as the start of SlickGrid years ago, the only difference will be the located underdist/browser
cjs
for CommonJS build for NodeJS legacy loading usingrequire(...)
, located underdist/cjs
esm
for ES6/ESM support which will give us Tree Shaking support (located underdist/esm
)I did a lot of research to make sure that we get the smallest possible builds for each build format types, for example I didn't want to have code that isn't used by the
iife
format but required foresm
and vice versa (i.e.import
are used by esm but not used at all iniife
). It took me a while to find the best approach, I even asked on SO with this question: esbuild hybrid plugin to bundle multiple files iife and single esm bundle and opened an issue on esbuild as well. Eventually made it all work with the smallest build sizes for all build types, woohoo 🚀Starting with the
iife
build (located under thedist/browser
folder) we will still build individual files and we are still adding everything on theSlick
object onwindow
(i.e.Slick.Grid
orwindow.Slick.Grid
)On the other hand, the
cjs
andesm
are both producing a singleindex.js
bundle and theesm
will provide us with Tree Shaking support. As opposed toiffe
though, there will not be anySlick
object produced, the user will have toimport
(orrequire
) everything, for example withesm
we would doimport { SlickGrid } from 'slickgrid';
and that is the common approach for ES6 syntaxInstallation
npm install
to install all new dev dependencies (esbuild
and others...)npm run dev
for development using Browser-Sync and build for dev modeindex.html
was updated will all the Example links (which contains the same as the Examples Wiki)Then finally, and hopefully, be amazed by the new Alpine Theme look and feel... Beautiful, isn't it? 🐰
Info
The new structure will use a lot more new tools for development like:
.ts
,.js
,.css
,.scss
and.html
) and run appropriate process (i.e.:.scss
will run a SASS build,.ts
would run an esbuild, ...)The use of Browser-Sync is awesome because we no longer need to refresh the page, whenever a file changes (js, css or html), the watch mode will simply reload the page by itself, awesome! The use of Chokidar in combo with Browser-Sync is also great since it will also rebuild SASS to CSS and reload the page as well if anything changes.
This PR branch was created about 2 months ago so it contains a lot of old commits (including the previous major version) but I feel now is a good time to merge it into a new
next
branch and get feedback from others. I say this because at this point, I feel like the folder structure is pretty much what I want it to become at the end of this exercise.Upcoming TypeScript
Like I mentioned earlier, we can use esbuild since it accepts TypeScript (and JavaScript) and it's super fast to build. When we run our final production build, we will also use TypeScript to create all the Types (
d.ts
) files and source maps.I already converted 1 of the plugin, it is the smallest one which is good to start with and that is the
SlickAutoTooltips
and it is also part of this PR. So yes, TypeScript is coming...🤖This next major version will eventually close some old issues as well
Conclusion
So in conclusion, I encourage anyone to give it a try. Also note that this PR will be merged on the
next
branch and a few more PRs will follow (like TypeScript migrations). At this point the folder structure is not expected to change much more than what is in this PR, however all the.js
will be renamed as.ts
files. Please note that all images were deleted, it's all SVGs now and in pure CSS, so we can even easily colorize them, SVGs are not just used by the new Alpine Theme but also referenced by the old SlickGrid theme which I updated as well in order to get rid of images. This new Alpine Theme was based and inspired from Ag-Grid.To see the new folder structure, you can take a look at the feat/esbuild branch directly
EDIT
I managed to migrate
slick.grid
and evenslick.dataview
to TypeScript (that took a week to accomplish) and that was the biggest challenge, so the rest of the files should be easy (all Controls and Plugins). There's no more obstacle for the move to TypeScript :)