-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fixes #251 closing the parent tag if the component rendering led to a… #283
Fixes #251 closing the parent tag if the component rendering led to a… #283
Conversation
|
* Add benchmarking for the dev server This adds benchmarking for the dev server. * Use fs.rm instead * Only rimraf if the folder exists * Make uncached match CI * Change the cached time too * Don't run benchmark in CI * Switch back test command * Make tests be within 10 percent * Use yarn to run multiple things * Turn benchmark into uvu tests * Debugging benchmark * Print chunk for testing * Ignore benchmark folder in uvu * Add build benchmarking * Update benchmark numbers
* documentation: post #231 merge renderers are a config option * Update docs/config.md to reorder
* refactor: pluggable renderers * refactor: cache renderer per component * docs: update comments on snowpack plugin `transform` method * docs: add comments to renderer plugins * refactor: convert components to Map * fix: pass children through to astro __render * refactor: move Components/ComponentInfo to shared types * refactor: remove `gatherRuntimes` step, just scan output for imports * refactor: update isComponentTag logic * chore: move dependencies to renderers * fix: cross-platform transform injection * feat: defer renderer to react, fallback to preact * fix: use double quotes in generated script * test: fix failing children tests * test: add workspaceRoot to all tests * fix: pass props to renderer check * chore: add test:core script back for convenience * chore: remove unused external * chore: rename renderers * chore: add astring, estree-util-value-to-estree * chore: render-component => __astro_component * refactor: split hydrate logic to own file * refactor: use `astro-fragment` rather than `div` * chore: remove unused hooks * chore: delete unused file * chore: add changesets * fix: Astro renderer should be async * fix: remove <astro-fragment> for static content * test: fix failing test * chore: normalize config interface * feat: allow renderers to inject a snowpackPlugin * fix: resolve import URL before using dynamic import * refactor: update renderers to use separate /server entrypoint * refactor: update server renderer interface * fix: get renderers working again * test: debug failing test * test: better debug * test: better debug * test: remove debug * fix: support esm and cjs packages via "resolve" * refactor: split hydrate functions into individual files * fix: dependency resolution relative to projectRoot * fix: @snowpack/plugin-postcss needs to be hoisted * fix: do not test prettier-plugin-astro as it's not ready for primetime
* fix: remove remote urls from import scanner * debug test
* fix: markdown issues * wip: add docs example * example: update doc template * chore: credit Steph for AvatarList * chore: align footer to bottom viewport * chore: feeback R1 * fix: font fallback in firefox * fix merge conflicts * fix: add default value to headers * chore: fix doc example
* feat: enable HMR in `createSnowpack` * feat: enable Snowpack's HMR * chore: add changeset * chore: remove unused file * chore: add changeset
* Fix codeblocks in markdown components * Debugging * More debugging * remove extra debugging stuff
* chore: release vscode * chore: move astro-languageserver deps to devDeps * chore: enter pre
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* chore: add package.json to externals * fix: add missing packages to allowList * fix: temporarily disable @astrojs/renderer-vue * chore: add changeset
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…https://github.com/snowpackjs/astro into fix/closing-parent-tag-if-component-was-not-rendered
@@ -572,6 +573,7 @@ async function compileHtml(enterNode: TemplateNode, state: CodegenState, compile | |||
paren++; | |||
buffers[curr] += `h(${wrapper}, ${attributes ? generateAttributes(attributes) : 'null'}`; | |||
} catch (err) { | |||
state.markers.componentWasNotRendered = true; |
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.
Instead of adding a new marker, could you just use paren--
? That should effectively do the same thing. paren
is there to mark how many open parentheses need to be closed.
Rebasing with |
@ewatch no rush or anything, just a reminder that this should be good after a rebase. |
Sure will take care of it. Thank you for the reminder @matthewp. |
@ewatch friendly bump! |
Yeah I messed up my local branch. :-( |
see PR #490 |
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
If a component is not rendered because it doesn't exist the codegen still adds a closing parenthesis to the render function and therefore closes the last parent Element.
Changes
Adds additional marker for the code generator to know if a component was rendered and therefore isn't accidently closing the parent tag if not.
Testing