Comments (8)
I think this is a good Idea when the lib.js keeps on growing, lets say if it exceed 500 lines of I will split it up? Currently it's much more comfortable having all in one file.
from ghosttext-for-chrome.
It's not an issue of size, rather of separation of concerns. What is called in the DOM doesn't need anything that's needed in the background, and viceversa.
I did a quick test on the branch libs-split-test, let me know what you think, it's going to need a bit more work, probably.
from ghosttext-for-chrome.
Whats about using sub namespaces like GhostText.Background, GhostText.Content… ?
from ghosttext-for-chrome.
That would make sense if there was a shared GhostText object, which there isn't in that test. All the content code is in content.js; lib.js is not loaded at all.
I'm doing this to avoid any possible confusion if we load methods that we can't use: e.g using .openConnection()
in background.js
(impossible)
from ghosttext-for-chrome.
Okey let's split it up but lates we should fix all bugs and implement all features for V1 first before we start refactoring.
from ghosttext-for-chrome.
I reorganized the code in content.js (c319bbb) and I've pulled a function from libs.js (ebd916e) to ready this. Content.js is now ready, the split can be done progressively as needed.
I tried to keep a similar style to lib.js, but I'm not sure how you define a static and a public/private function, so you might have to go in there and add a couple @comments.
from ghosttext-for-chrome.
Since you reorganized the content.js this might be right time moving the lib.js code to the background.js file?
from ghosttext-for-chrome.
I did that last time, but then I realized that options.html uses lib.js too, so we might just l leave it there.
If anything we could load lib.js as the background file, detect it and run GhostText.connectionHandler();
, but it's not worth it I think.
from ghosttext-for-chrome.
Related Issues (20)
- Time to celebrate HOT 2
- Support fields within frames (Disqus) HOT 13
- Keyboard hotkey for Linux collides with "Show bookmarks bar" HOT 3
- ⌘ + K key binding in Chrome Extension is already used HOT 3
- Make input-area.js Firefox compatible
- Support of g_editable elements HOT 1
- Highlight keeps on connection error HOT 5
- Fails after switching to Sublime Text (OSX 10.9.4, Sublime Text 3) HOT 5
- Events, mono-repo discussion HOT 12
- On pressing ctrl+shift+h, 4-5 sublime windows pop up and the text-to-chrome doesn't work HOT 4
- GhostText can't handle multiple file tabs in Codecademy HOT 2
- No longer working in Chrome HOT 2
- Ghost is opening 2 to 7 tabs when clicking in HOT 5
- Ghosttext fills the Chrome developer console with "Array[2]" #52
- Ghost Text Says that it is running and to switch to console, but no code opens
- blank render HOT 3
- Doesn't seem to work with the latest Chrome HOT 4
- ISSUES MOVED, open them in the main repo:
- How do I activate Ghosttext?
- Multi-caret editing. Sublime text 3 + Chrome HOT 1
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 ghosttext-for-chrome.