Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
For the current version of the hot loader that I'm running, "react-hot-loader": "^3.0.0-beta.7",, you don't actually have to manually build bundle.js first. It's probably the same with the older version that you're using, but I don't know that for sure. Also, the react-hot-loader refers to bundle.js, but doesn't seem to actually create it in the filesystem. It seems to have it's own separate technique for packaging up the code and getting it into the browser.
I haven't run the project as downloaded because I don't want to use Webpack 1 and versions of other packages that are 12-18 months old. I also don't want to use an 18-month old version of "babel-preset-stage-0": "^6.5.0"
I'm using current versions of everything rather than the older versions configured in the downloaded projects package.json. To do this I deleted the package entries from package.json and then did the various npm install commands to get the current versions of everything. I had to research a little, like changes in webpack and react-hot-loader and then make corresponding changes.
It's hilarious to see the buggy code displayed in the training videos, interleaved with the instructor seemingly running the app without problems and without any discussion that there ARE bugs in the code
It can be an excellent learning exercise to deal with these kinds of bugs and problems, but it's probably difficult for some learners to overcome these barriers. Also, it can be frustrating when you just want to see things working instead of having to troubleshoot, sometimes for hours, trying to figure our what is wrong, doing research into related topics and trying various ideas to work around it.
Also, there is a little preview button that looks like an eye inside the bottom right of the "Add Comment" form thathas a "Preview" popup that appears when you hover over it. It is very faint in FIrefox so I didn't know it was there at first.
Did bundle.js get generated and placed into a subdirectory (maybe public/ or build/)? If it says it created the file but you aren't seeing it, maybe it placed it in another folder in your project directory somewhere. Just a guess...
Hi! If you want to, you should be able to edit the page title in the index.html in your Prodigy installation. You can find the location by running prodigy stats and looking at static/index.html. When you restart the Prodigy server, your changes should be reflected.
The more elegant solution would probably be to use custom "javascript" in your prodigy.json and modify the page attributes this way. I wouldn't recommend editing the bundle.js, though, since that's all compiled JavaScript.
In that case, you can just use JavaScript via "javascript" in your config to modify the element, e.g. select it via document.querySelector('.prodigy-sidebar-title') and then change it depending on what you need to do.
DO i need to write html code separately for the javascript i wrote or just i need to connect with the index.html.Can you explain clearly with an example for changing the "prodigy" with the custom title.
prodigy233734 11.7 KB
If you actually want to edit the HTML elements, you can do this in JavaScript via the "javascript" in your prodigy.json or recipe config. How exactly you set this up depends on what you want to do, but you can do things like this for example:
The Javascript that you're able to run can be overriden by our React code when it interferes with what it is trying to render. I can imagine that this is what's happening here. document.title feels like it's something that's protected.
I'll ask to double-check, but the react code is presented through a static bundje.js that isn't editable. We are revisiting custom JS recipes in Prodigy v2, but it's not a focus for the current Prodigy v1.12 release.
Now, you can use my-uppy-bundle.js in a script tag or use gulp-concat to add it to the start of your scripts. It will define a global Uppy variable just like the build that comes with the uppy package, but with only the things you need.
swagger-ui is meant for consumption by JavaScript web projects that include module bundlers,such as Webpack, Browserify, and Rollup. Its main file exports Swagger UI's main function,and the module also includes a namespaced stylesheet at swagger-ui/dist/swagger-ui.css. Here's an example:
In contrast, swagger-ui-dist is meant for server-side projects that need assets to serve to clients. The module, when imported, includes an absolutePath helper function that returns the absolute filesystem path to where the swagger-ui-dist module is installed.
The module's contents mirror the dist folder you see in the Git repository. The most useful file is swagger-ui-bundle.js, which is a build of Swagger UI that includes all the code it needs to run in one file. The folder also has an index.html asset, to make it easy to serve Swagger UI like so:
Frappe ships with a Rich Admin UI accessible at /app which is an SPA writtenin modern JavaScript syntax and styling which is written in SASS (.scss)files. These files are not directly understandable by the browser and hence needto be compiled before they are sent to the browser to parse and execute.
When you are working with bundled files you need the build command to run everytime you make a change to your source files. The asset bundler comes with awatch mode where it will listen to changes in the file system and rebuildwhenever a file changes.
Running the following command will start a long-running process that watchesyour files and rebuilds them as they change. It will log a line with the text"Compiled changes..." every time it does a rebuild.
Starting with Version 14, Desk will be automatically reloaded if assets get rebuilt in watch mode. This behavior can be toggled by setting the LIVE_RELOAD environment variable, or changing the value for live_reload in common_site_config.json.
A bundle file is an entry point of an asset that is picked up by the bundler forcompilation. For e.g., if there is a file named main.bundle.js in the publicfolder of your app it will be automatically picked up by the bundler andcompiled at /assets/[app]/dist/js/main.bundle.[hash].js. A unique hashcomputed from the contents of the output is also appended to the file name whichis useful for cache-busting in browsers.
Similarly, if there is a file named style.bundle.scss in the public folder, itwill be compiled to /assets/[app]/dist/css/style.bundle.css. Notice, theextension changed from .scss to .css because browsers can understand CSSfiles but not SASS files. Bundle files can exist at any nesting level in thepublic folder, but they will always be compiled in either dist/js ordist/css depending upon their type. This means if there is a file atpublic/main.bundle.js and another file at public/src/main.bundle.js thecompiled output of the latter will override. The bundler will also print awarning for such collisions.
When a bundle file is compiled, the output file contains a unique hash. So, youcannot hardcode the path of the file because the next time you make a change tothat file the hash will change. Frappe provides a couple of helpers to do this.
JavaScript module bundlers can do many things, but one of their most usefulfeatures is the ability to add and use external libraries in your code base.Module bundlers read import paths in your code and combine (bundle) yourapplication-specific code with your imported library code.
This process of eliminating unused code from a library is known as tree shaking.It would be extremely time consuming and error prone to manually remove thiscode by hand, but module bundlers can automate this removal.
This guide requires you to have npm installed in your development environment.npm is used to install and manage dependencies (libraries). To install npm,install Node.js, which includesnpm automatically.
Most developers are properly set up once they have installed Node.js. However,there are common problems many developers run into when setting up theirenvironment. If you run into any errors,make sure your environment has the npm CLI and that you have the proper permissions set up so youdon't have to install packages as an administrator with the sudo command.
This file is responsible for many different things. This is an important file tofamiliarize yourself with if you want to learn more about module bundling andbuilding JavaScript code in general. The important piece for this guide is the"dependencies" object. This object will hold a key value pair of the libraryyou have installed and the version it is using.
The key is the name of the library and the value is the version to use. Theversion value is flexible and can accept a range of values. This is known assemantic versioning or semver. To learn more about semver,see npm's guide about semantic versioning.
The code you write is read and processed by a module bundler and then output asa new file or set of files. It's important to separate these two types of files.The code the module bundlers read and process is known as "source" code. Thefiles they output are known as the built or "dist" (distribution) code.
In the example file structure above, consider that index.js imports bothanimations.js and datalist.js. When a module bundler processes the sourcecode it will produce the bundle.js file in the dist folder. The bundle.jsis a combination of the files in the src folder and any libraries the importas well.
Module bundlers all have a concept of an entry point. You can think of yourapplication as a tree of files. One file imports code from another and so on andso forth. This means that one file will be the root of the tree. This file isknown as the entry point.
c80f0f1006