-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Webpack: Rewrite lesson with in-house tutorial (alongside ES6 Modules rewrite) #27961
base: main
Are you sure you want to change the base?
Webpack: Rewrite lesson with in-house tutorial (alongside ES6 Modules rewrite) #27961
Conversation
Lesson structure and key concepts mostly raised by Advait. Co-authored-by: advait0603 <[email protected]>
Uses AE instead of BE spelling.
Co-authored-by: advait0603 <[email protected]>
Things I would like thoughts on in particular:
Any other aspects as well. The above is just what stuck around my mind most during writing. |
Npm scripts now covered in the new Revisiting Webpack lesson that will come immediately after this project.
|
||
### Handling HTML | ||
|
||
Let's actually include some HTML. After all, we're interested in making websites! Since HTML isn't JavaScript, Webpack can't just bundle it straight away, but there's a nifty tool we can use called `HtmlWebpackPlugin` that's just perfect for us. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding why templates are used in place of directly editing an html file in dist/ would be a good idea cause it would start a context for the advice- "not messing around with dist code".
https://discord.com/channels/505093832157691914/505093832157691916/1175351859343544380.....
...is a pretty good reference conversation and cleared my doubts about why dist/ is not modified by a developer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This certainly can be reinforced. Given the perspective of someone going through this for the first time, do you think a reinforcement for HTML specifically is significantly valuable given that earlier in the lesson there's a section about src
and dist
? Which includes the following:
src
is where we keep all of our website's source code, essentially where all of our work will be done (with an exception being altering any configuration files in the root of the project). When we run Webpack to bundle our code, it will output the bundled files into thedist
directory. The idea is that if someone were to fork or clone the project, they would not need thedist
directory, as they'd just be able to run Webpack to build fromsrc
into their owndist
. Similarly, to deploy our website, we would only need thedist
code and nothing else. Keep that in mind! Work insidesrc
, build intodist
, then deploy from there!
My idea was that this would be enough to justify not mentioning the HTML and dist thing, since it's already been introduced that all work goes in src
, not dist
. So I was thinking new learners might not even consider putting HTML in dist
and working from there. But if you think this is still valuable to mention, then I can do so.
Because
The current Webpack lesson is a known pain point in the curriculum journey, primarily due to the sudden increase in complexity and steps of tooling, coupled with how much of the learning is left to external resources. These external resources limit the cohesiveness of teaching material, and can prove troublesome in the learning process when each resource includes a few unnecessary tidbits that can easily throw learners off (such as multiple entry points in the webpack official guides when learning about html-webpack-plugin). They also are frequently aimed at people who may know a little more about bundlers already, or are following a different course/tutorial. Thus, things often feel disjointed with the TOP curriculum.
While improving the Webpack lesson itself is the primary focus, it was also identified that the preceding ES6 modules lesson is fairly coupled with it, as Webpack and bundlers are introduced there instead of the Webpack lesson.
The order of the ES6 modules lesson was also identified as a little odd, and the order and flow could be improved by focusing on ES6 modules as a primary topic straight away, then introducing bundlers and Webpack in their own separate lesson.
General plan:
This PR
Issue
Related to #26976
Related to #26977
(closed by #27953)
Additional Information
This will be something to merge alongside 3 other PRs:
Pull Request Requirements
location of change: brief description of change
format, e.g.Intro to HTML and CSS lesson: Fix link text
Because
section summarizes the reason for this PRThis PR
section has a bullet point list describing the changes in this PRIssue
section