Comments (4)
Hi @Zearin, nice to see someone trying to get familiar with the codebase and maybe even I can learn something from this issue.
I will try to respond to the best of my abilities:
- Errors that are meant to be thrown in different places are often in the
Errors
folder, while Errors thrown only at one location are in that location. At the same time errors that are more of an info to the user and also don't need to be aEleventyBaseError
are often just anew Error()
- especially when they are a one-off (at least that's how I understand it). - It'd be possible to move
Template*
andEleventy*
files into separate folders, but I think this has just grown over time and isn't yet a real problem. - Getters and setters are often grown historically or from a need for async support, which is nicer to write with
getThing
than withget thing
. - Good question - for me it's kind of a magic box that I started to look into step by step, so I know what I've touched, but my knowledge still has gaps. In general I think the naming is fairly okay, so if I know the concept I work on, I find the relevant files.
from eleventy.
I've also been trying to learn the code base and I have to say, the last part that you mentioned is the most confusing. I often find myself starting at the beginning of the CLI execution and I just trace my way through each of the classes and methods lol.
from eleventy.
Okay, I think I’d like to start another round of Q&A to get to know the codebase.
I want to try to identify all parts of the codebase that fulfill certain roles. I’ll start with Config in this post.
Config objects
- Config classes.
UserConfig
andTemplateConfig
(withdefaultConfig
providing, um, defaults) appear to be the only classes dedicated to configuration (according to their names).
eleventyConfig
.- Many class constructors and methods accept an
eleventyConfig
argument. - In
Eleventy.initializeConfig()
, this is aTemplateConfig
instance. - A
TemplateConfig
instance holds a reference to aUserConfig
instance. If I understand correctly, this is so that a user’s configuration can be tweaked on a template-by-template basis. Is this correct?
- Many class constructors and methods accept an
- “Config” vs. “options”.
- When a class handles both “config” and “options”, what distinguishes whether a setting falls into one category or another?
- Total configuration awareness®.
- Are there any other types of config?
- What makes their roles different?
- Which ones override others (and in which circumstances)?
from eleventy.
Files & Paths
According to filenames, below is a list of all the files/classes that deal with files or paths (including “globs”). I’ll list path-related dependencies outside of the node:
standard library under each one.
I’m trying to get a list of all path-related functionality here. I’m not trying to include I/O (read/write) operations. If a class does some of both, and its name implies more path-related purpose, then I’ll include it.
- 📂 Util/
DirContains
PathNormalizer
- uses
TemplatePath
from@11ty/eleventy-utils
- uses
PathPrefixer
- uses
PathNormalizer
- uses
EleventyFiles
- uses
TemplateGlob
- uses
TemplatePath
from@11ty/eleventy-utils
- uses
FileSystemSearch
- uses
TemplatePath
from@11ty/eleventy-utils
- uses
fastglob
andmicromatch
(3rd party deps)
- uses
TemplateFileSlug
- uses
TemplatePath
from@11ty/eleventy-utils
- uses
TemplateGlob
- uses
TemplatePath
from@11ty/eleventy-utils
- uses
Here’s where you come in!
Did I miss anything?
Any observations about the above?
from eleventy.
Related Issues (20)
- getBundle in serverless only running on first invocation HOT 3
- Eleventy doesn't correctly resolve ESM (custom server) HOT 1
- Strange shortcode problem HOT 2
- Don't know where shortcode fails in Nunjucks template HOT 1
- Error message provides incorrect/misleading information
- Mismatches between explicit and extensionless layout declarations causes quirks when running eleventy with `--serve` HOT 2
- Eleventy unable to find and render layouts within _includes HOT 13
- Test viability of `linkedom` over `posthtml`
- addTransform with minifyCSS option enabled removes inline styles generated by eleventy-bundle-pluging HOT 3
- docs: document `setChokidarConfig` method
- Allow plugins to add posthtml plugin additions (e.g. eleventy-img Transform method) HOT 1
- [3.0.0-alpha.5] Watch mode crash when build works
- RenderPlugin: support relative paths
- Layouts not working in 3.0? HOT 4
- Customize markdown headings rendering HOT 3
- Strict variables and custom filters in includes HOT 5
- getNextCollectionItem not working where there are multiple languages and fileslug is the same in each language
- [WARNING] for errors in CI allows build to succeed HOT 5
- access eleventyConfig plugin property HOT 2
- loop.index / loop.first / loop.last not working ? HOT 4
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 eleventy.