Skip to content
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

Refactor source to be in different modules #195

Closed
wants to merge 7 commits into from

Conversation

Raiondesu
Copy link

@Raiondesu Raiondesu commented Apr 18, 2021

Fixes #194 (WIP).

This PR is mostly here to spark conversation about the necessity of such changes and how much they impact the project itself.

EDIT: and I also needed a reason to get familiar with the source code. 😅

Changes

There seem to be no breaking changes, as all tests pass, and the "export" structure is preserved.

Modules

Split crank.ts into several modules:

  • renderer
  • context
  • events
  • elements

and extracted miscellaneous items into util.ts.

context and renderer are still far too large, in my opinion, so I guess I'll try to polish and split them up a bit more. Hence the "draft" status.

Adapted build process to be independent from the module structure.

Build artifacts

All distributed artifacts now rest in the dist folder, structured by their respective format.

For "cjs" and "esm" formats, the original module structure is now preserved for better tree-shaking.

Reordered some fields in package.json to achieve, I hope, better readability for contributors.

Website and examples

are still in their original place, as I can do nothing about it. 😅

@brainkim
Copy link
Member

Closing as too far skewed. Again, I am a big fan of putting things in as few files and folders as possible, so if you would like to revisit refactoring let me know.

Thank you so much for the attempted contribution!

@brainkim brainkim closed this Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor library modules
2 participants