Auto include files in index.html. #2660
Replies: 13 comments
-
Don't think it's that important imho |
Beta Was this translation helpful? Give feedback.
-
Yeah but it's not a bug, it's a feature which can be implemented anytime 😄 |
Beta Was this translation helpful? Give feedback.
-
I don't think that should happen. Not all files always need to be included in index.html, for example, css files that are imported by other css files. |
Beta Was this translation helpful? Give feedback.
-
i like this idea and i've definitely talked about this before! i want to think it through though. some thoughts/questions:
other pros/cons? |
Beta Was this translation helpful? Give feedback.
-
I feel we can add them the first time the user makes a file and give the user a notification that the newly created file has been added. If the user wishes to remove it, he can remove it later. |
Beta Was this translation helpful? Give feedback.
-
i like the idea of it being an explicit thing that's happening. not quite sure what the UI/UX for this would look like. |
Beta Was this translation helpful? Give feedback.
-
I feel like it's a very processing like behavior to have it auto-add to the index.html, and I like that. But as this is the web (and linking tons of files is so common) I feel that the user should at least be aware that something magic happened. If tabs are going to be a thing at some point, maybe there is something there that could happen there? maybe the new file opens and also the index.html opens in a tab and there is a comment in the HTML above the added file which says I think a further discussion is what files should be auto added, I'd suggest that only making additional .js files (as they are common for breaking classes out) might be the way to go. IMO, All others (CSS files, etc.) should just be ignored and let the user add/link them since that's a particularly out of the 'typical' scope of common usage of p5 and a more advanced topic where the user should probably know or learn about linking at that point anyway. |
Beta Was this translation helpful? Give feedback.
-
that's a good point about it being processing-like behavior. it's hard to know with this project what is okay magic and what is too magical, which i think is related to the difference between JS and Java. i think only JS and CSS files could even be auto-added anyway (because... can you add other types of files to HTML?), which is a nice constraint. |
Beta Was this translation helpful? Give feedback.
-
I think you're right, css files are the only other thing to link. But, I'd be hesitant to even link those since it's not that uncommon to link dozens of css files for fonts, modules, and other styles & this is not really intended to be a 'web' development ide, but a p5.js editor, where typically the CSS is very light, if not non-existent all together! |
Beta Was this translation helpful? Give feedback.
-
@bmoren Even I feel only js files should be added. CSS files are generally not needed and if they are required, the user can add it himself. But for the js files, I feel we should automatically add it. Giving user a notif will do it. |
Beta Was this translation helpful? Give feedback.
-
i'm definitely warming up to this issue! maybe simply adding new JS files to the |
Beta Was this translation helpful? Give feedback.
-
Hey @catarak whats your take on this issue now should we add this feature? |
Beta Was this translation helpful? Give feedback.
-
Here's a possible workaround to load dependencies without editing index.html function preload() {
Dependencies.resolve(["load_me"], /*bypassCache*/ true);
} |
Beta Was this translation helpful? Give feedback.
-
Nature of issue?
New feature details:
I feel on adding a new file, it should automatically be included in index.html.
Views?
Beta Was this translation helpful? Give feedback.
All reactions