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

Make JavaScript components more modular #257

Closed
3 tasks done
sebnitu opened this issue Jul 19, 2020 · 0 comments
Closed
3 tasks done

Make JavaScript components more modular #257

sebnitu opened this issue Jul 19, 2020 · 0 comments

Comments

@sebnitu
Copy link
Owner

sebnitu commented Jul 19, 2020

Problem

Current Vrembem JavaScript components are written in a single file. This can make it hard to understand their features, test and keep organized.

Possible Solution

Similar to the recent modular update on scroll-stash, should break up the index file to feature modules with a consistent structure for core and settings modules.

General Structure

Here's a concept for a general component structure:

  • core.js - Consists of the core definition of the component and the API that gets exposed for distribution. Every component would attach to it's API settings, init and destroy and check autoInit here.
  • settings.js - Contains the default options object.
  • <feature>.js - The rest of the module exports would be grouped by feature. For example, if the component has state management, that would be included via a state module defined in src/state.js.

JavaScropt Components

A list of JS components that would need this update:

  • Drawer
  • Modal
  • Checkbox
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

No branches or pull requests

1 participant