feat: inject preload script directly#2455
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
| injectedAt: 0, | ||
| }; | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Typographical suggestion: The file currently does not end with a newline. It would be best to add a trailing newline at the end of the file.
d3fcc71 to
5839a62
Compare
|
It seems like there's a version of layout.tsx where there's no body. In this case, we need a better strategy |
| let layoutPath: string; | ||
|
|
||
| if (routerConfig.type === RouterType.APP) { | ||
| layoutPath = path.join(routerConfig.basePath, 'layout.tsx'); |
There was a problem hiding this comment.
layout path can be jsx/tsx/js/ts
|
Generated with ❤️ by ellipsis.dev |
|
Generated with ❤️ by ellipsis.dev |
|
Generated with ❤️ by ellipsis.dev |
|
Generated with ❤️ by ellipsis.dev |
Kitenite
left a comment
There was a problem hiding this comment.
Made some updates, thanks Vu!
Description
Using a CDN to store the preload script makes development harder, especially with caching issues that can interfere with hotfixes.
→ Instead, inject the preload script every time we start editing a project to ensure it’s always up-to-date with the current version.
Related Issues
Type of Change
Testing
Screenshots (if applicable)
Additional Notes
Important
Refactor preload script handling by injecting it directly into the project, ensuring it's always up-to-date and resolving caching issues.
PreloadScriptManageradded to manage script injection inengine.ts.injectPreloadScript()updated to handle script injection inlayout.tsx.engine.ts: AddPreloadScriptManager.sandbox/index.ts: Ensure preload script file exists on file changes.layout.tsx: Remove CDN script, rely on direct injection.layout.test.tsto verify script injection behavior.package.jsonto build preload script topublicdirectory..gitignore.This description was created by
for 345c036. You can customize this summary. It will automatically update as commits are pushed.