Skip to content
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

Hot reload for components and importmap #2

Merged
merged 6 commits into from
Jan 18, 2024
Merged

Hot reload for components and importmap #2

merged 6 commits into from
Jan 18, 2024

Conversation

squrious
Copy link
Collaborator

@squrious squrious commented Jan 8, 2024

Add hot reload for Twig Components by loading templates as JS dependencies of stories modules.

Add hot reload for AssetMapper assets by generating a virtual importmap module.

Add tests for PHP and JS source codes.

@squrious squrious force-pushed the better_hmr branch 2 times, most recently from e90f3f2 to 912b569 Compare January 9, 2024 09:40
config/routes.php Outdated Show resolved Hide resolved
src/Command/DumpImportMapCommand.php Outdated Show resolved Hide resolved
/**
* @author Nicolas Rigaud <[email protected]>
*/
class DumpImportMapCommand extends Command
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elle apporte quoi cette commande par rapport à un php bin/console debug:asset-map ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est pas une commande de debug, ça permet de générer le module JS pour l'importmap. Je vais documenter en commentaires pour être plus explicite. Peut-être aussi changer le nom ?

src/EventListener/ExceptionListener.php Outdated Show resolved Hide resolved
@WebMamba
Copy link
Contributor

WebMamba commented Jan 9, 2024

En suivant t'as doc j'ai eu une erreur:

SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: @storybook/symfony-webpack5/preset.

Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.

If you believe this is a bug, please open an issue on Github.

Error: Cannot find module 'fast-xml-parser'
Require stack:
- /Users/matheodaninos/Project/contributing/StorybookBundle/storybook/dist/preset.js
- ./node_modules/@storybook/core-common/dist/index.js
- ./node_modules/@storybook/telemetry/dist/index.js
- ./node_modules/@storybook/cli/dist/generate.js
- ./node_modules/@storybook/cli/bin/index.js
- ./node_modules/storybook/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/Users/matheodaninos/Project/contributing/StorybookBundle/storybook/dist/preset.js:10:21)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._compile (./node_modules/esbuild-register/dist/node.js:2258:26)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Object.newLoader (./node_modules/esbuild-register/dist/node.js:2262:9)
    at extensions..js (./node_modules/esbuild-register/dist/node.js:4838:24)
    at loadPreset (./node_modules/@storybook/core-common/dist/index.js:15:82)

@squrious squrious force-pushed the better_hmr branch 2 times, most recently from 31bc17d to 0541acd Compare January 12, 2024 12:30
@squrious squrious force-pushed the better_hmr branch 3 times, most recently from 2666d12 to 411a263 Compare January 18, 2024 09:40
@WebMamba WebMamba merged commit 4f73955 into main Jan 18, 2024
6 checks passed
@squrious squrious deleted the better_hmr branch April 4, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants