* explicit duplicate key check in debug_assertions
also a bit more defensive in production code, this should not lead to any slowdown
or changes in code with proper keys
CI changes:
* force install cli tools over cached versions on version mismatch
* Upload PR information for CI
see also: actions/upload-artifact#618
misc:
* fix panic in panic
don't set the panic hook if we are already panicking
* modernize github workflows
this mainly fixes some inconsistencies in style, outdated or wrong comments and action version
- replace Legit-Labs/action-download-artifact with actions/download-artifact
- fix Swatinem/rust-cache arguments
- fix benchmark transformations
- expand feature soundness lints
- wording and capitalization in comments
* fix no_run on crate level doc
* fix some more small issues
* Split repository into multiple workspaces, update CI
* pull_request_target for build-website workflow
This should allow the workflow to read secrets instead of requiring a different, publish-website workflow to be needed to publish the side
* pull_request_target for build-api-docs workflow
This should allow the workflow to read secrets instead of requiring a different, publish-api-docs workflow to be needed to publish the side
* use `paths` instead of `path_ignore` for examples
* cleanup main-checks.yml
* it's rustfmt, not fmt
* correct paths for workflow files
* it's rustfmt, not fmt: part 2 electric bolgoo
* me idiot: part infinity
* ???
* main checks should be the same then?
* ??? part 2
* it should work now
* more fixes
* checkout before using file, actually use stable for wasm-bindgen-cli
* Revert "pull_request_target for build-api-docs workflow"
This reverts commit 38977292c8.
* Revert "pull_request_target for build-website workflow"
This reverts commit 1638a0cd24.
* Benchmark workflow uses pull_request event
* pull_request for size-cmp
* Update Scripts.
* Try to limit this to the main application.
* Use actual file.
* Sum size of all bundles.
* Update ci/make_example_size_cmt.py
Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com>
Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com>
- Remove agents example
- Agents example is replaced by web_worker_fib as they both serve the same purpose now that trunk 0.15 has been released
- Clean up CI setup and ensure that examples are deployed in publish-examples.yml as they're built in size-cmp.yml
* code size: doc and use additional nightly features
* add ci paths to run condition
* undo unrelated edit to benchmark workflow
* Add links to nightly feature docs
* Add attribute macro for functional components
* make rustfmt happy
* add docstring for macro
* Add example for functional components
* make rustfmt and clippy happy
* oops
* https://tenor.com/view/come-on-brad-gregory-upset-freaking-out-overwhelmed-gif-17476366
* remove functional example
* remove useless feature, fix order of deps, fix docs
* various fixes
* make rustfmt happy
* oopsie
* bruh i forgot
* handle generics, box Block
* handle >1 parameters
* don't do `TokenStream1`, make rustfmt happy
* ensure const, async and extern functions can't be used, better error messages
* thanks rustfmt
* transparently consume FnArg
* add tests, fix error message
* seriously?
* fix these 2
* More test cases, better errors, formatting
* docs
* properly use #![no_implicit_prelude] for passing tests
* pass all attributes as is
* add Makefile.toml
* docs
* update test
* docs
* hooks docs
* Add docs for FunctionalProvider trait
* oopsie
* is this it?
* lets try this
* bruh moment
* better error message for bad return type, use function name for function struct, fix order in dictionary.txt
* better error messages
* replace `function` with `functional`
* completely replace `function` with `functional`
* completely replace `functional` with `function`: part 2
Missed this in previous commit
* revert package/crate names back
* formatting + fix workflow
* proc macros are fragile
* fix what i broke
* fixes
* Update docs
Co-authored-by: Simon <simon@siku2.io>
* Improve examples in docs
Co-authored-by: Simon <simon@siku2.io>
* update how #[function_component(_)] is explained
* finish "macro" -> "attribute", docs updates
* move contribute note to the top
* update #[function_component(_)] docstring
* Update docs
Co-authored-by: Simon <simon@siku2.io>
* oops, missed this
Co-authored-by: Simon <simon@siku2.io>
* Move hello world to a more appropriate place
* forgot to update the stderr file
* apparently this example didn't compile
* improve example
Co-authored-by: Simon <simon@siku2.io>
* remove renamed imports from yew-macro
They add a lot of cognitive overhead and don't provide much benefit in this case.
* just a prototype
* cleanup
* add prop type resolver
* use new props for tags
* silence clippy
* simplify tag parsing
* clean up
* improve names
* fix list span
* new component props parsing
* fix rogue lint
* update tag attribute parsing
* unify prop handling
* add new tests
* integrate prop validation
* improve error span regression
* add docstring
* update tests
* add test for specifying `children` twice
* move properties derive macro
* component transformer documentation
* update properties documentation
* document special properties
* let's try to fix the spellcheck
* let's just use a newer image then
* document `with props` children
* clean up a tad
* is boolean the missing word?
Starting to question the use of this spell checker...
* add the note for the recursion limit back in
* code review
* improve error for duplicate children
* clippyfying
* revert Task: Drop
* HtmlTag -> HtmlElement
* link the issue for prop_or_else
* PropList -> SortedPropList
* use struct syntax
* use html! in transformer demonstration
* format and cleanup
* remove bash scripts
* update pr template
* ignore router examples
* add pr-flow task
* I really don't know what I'm doing
* add wasm_bench feature
* well that explains one of my issues
also, that Geckodriver issue seems to be resolved
* run macro tests on 1.45.2
* update the documentation
* test flags no longer necessary
* remove benchmark instructions
* finishing touch
* Add support for optional attributes on HTML elements/tags
* Fix a couple of minor details
* Follow quote_spanned! documentation
* Remove undesirable example
* Add documentation for optional attributes
* Move optional token handling from HtmlDashedName to HtmlProp
* Do various requested changes to implementation
* Use fully qualified types in macro output
* Use fully qualified method calls for better error messages
* Remove support for optional attributes on boolean attributes
* Add error message for using optional attribute on HtmlList
Also, move tests where they belong
* Apply suggestions from code review
Co-authored-by: Simon <simon@siku2.io>
* Apply remaining suggestions from code review
* update
* clean up a bit
* Update docs
Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
* remove code duplication for callbacks
* clean up attribute handling
`push_attribute` doesn't need to be accessible to users since the `attributes` field is public anyway.
* fix formatting
* remove macro exports
this also solves the issue of silently replacing all attributes that were set up to that point.
* switch to optional attribute values
* clean up stringify
make it a trait instead of a struct and implement it so it can preserve spans properly.
You can thank me later, future me
* even more cleanup
This also fixes an issue with attribute diffing which has been present for some time.
If `new` is `IndexMap` but `old` isn't, `new` is mutated into an `IndexMap`.
This conversion happens every single time from then on out.
Once `IndexMap`, always `IndexMap`.
This is fixed now.
* improve attribute benchmarks
* use different name to make clippy happy
* add dedicated feature for benchmarks
* bump indexmap to latest version
* improve vec-vec performance for unordered attributes
* increase benchmark time limit
* there's no need to store Patches in the hashmap
* Update yew-macro/src/html_tree/html_prop.rs
Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
* adjust code style
* how about we actually use placeholders
* add a comment explaining the new_iter param
* fix typo
Co-authored-by: Alexander Krivács Schrøder <alexschrod@gmail.com>
Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
* Add more files to the .gitignore.
* Add notes on testing.
* More tidy up.
* Satisfy spellcheck.
* Make spelling even happier.
Not sure if it's acceptable to modify the old versions of this?
* More fixes to the dictionary.
* Update docs/more/testing.md
Co-authored-by: Simon <simon@siku2.io>
* Update docs/more/debugging.md
Co-authored-by: Simon <simon@siku2.io>
* Adopt @siku2's suggestions :)
* Update docs/more/testing.md
Co-authored-by: Simon <simon@siku2.io>
* Update docs/more/external-libs.md
Co-authored-by: Simon <simon@siku2.io>
* Tidy up panic hook.
* Update docs/more/debugging.md
Co-authored-by: Simon <simon@siku2.io>
Co-authored-by: Simon <simon@siku2.io>
* clippy in tests
* add pull request workflow
* fix formatting
* add names to steps
* fix clippy
* update
* avoid mutable
* use wasm target
* install it too
* except there
* let's give chrome a spin
* clippy has some more to say
* only run specific tests
* fix tests on chrome
* add cache
* rename benchmark for consistency
* re-enable geckodriver
* clean up old files
* remove all mentions of Travis
* check all examples
* let's try with a bigger timeout
* test both browsers at the same time
* chrome really doesn't like me
* finish up
* run for pushes to master
* improve caching
* fix order in workspace members
* clippy use --all-targets
* rename workflow file
* Apply suggestions from code review
Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
* use stable toolchain for lints
* run lints on nightly too
* add doctest for yew-stdweb
* allow failure for nightly clippy steps
* let's try it on the job level again
* always run all lint steps
* only run lints on stable toolchain
* use 'no_run' instead of 'ignore'
Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
* remove static directory, move script to run_example.sh
* gitignore
* server infra
* Support --build-only
* fix npm_and_rest example
* Fix various static index.html's
* Fix spacing
* newlines at the end
* Cleanup
* tabs -> spaces
* line ending
* remove build_examples.sh
* Apply suggestions from code review
Co-authored-by: Simon <simon@siku2.io>
* format file and improve EXIT trap
Co-authored-by: Simon <simon@siku2.io>
* Update optimizations.md:
* Make some sentences more clear
* Add additional links and references ("further reading")
* Capitalise some proper nouns
* Add missing terms to the dictionary.
* Split out a paragraph.
* Fix spelling.
* Update links.
* Apply suggestions from code review
Co-authored-by: Simon <simon@siku2.io>
* Update docs/advanced-topics/optimizations.md
Co-authored-by: Simon <simon@siku2.io>
* run tests using wasm-pack
* update contributing guide
* fix typo
* should probably install wasm-pack
* clarify manual webdriver installation
* Apply suggestions from code review
Had to do this again because I messed up my rebase, sorry!
Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
* make capitalisation of WebDriver consistent
Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
* add styled frameworks for yew
* revert some changes that was updated previously
* fix code review
* capitalize fist letter yewtify explanation
* fix code review
* switch definitions
* add Vuetify and Javascript in the dictionary
* fixed missing feature flag for yew dependency
* added functional components + hooks + tests
* added wasm pack to travis yaml
* fixed warnings
* ran rustfmt on files
* fix nit
* fix nit
* fix nit use_reducer_with_init
* fixed nit Rc can be Box
* fixed nit: unnecessary boxing
* UseRefState now tuple struct
* fixed unecessary option for phantomdata
* userefstate is now a type alias for Rc<RefCell<T>>;
* integrated suggested change to hook state storing and extracting
* functional-yew -> functional
* tests now work with stdweb *and* web_sys 😊
* correctly implemented use_effect
* hook test now running as stdweb. also removed redundant deps
* removed next tick, message is now an FnOnce -> bool, renamed render_call
* tests now run on web_sys only, making functional yew backend agnostic
* removed use_effect hook for seperate PR
* chore
* we didn't need that Rc anymore
* chore; comment cleanup
* reintroducing use_effect hook
* adjusted use_effect hook behaviour and added tests:
use_effect() always runs
callbacks are executed in the message callback, meaning they can use NodeRef
neither trigger a rerender
* improved test coverage to check for previous render passes
* yew-functional needs yew dependency to have a feature specified, as the package resolver does not infer it from the version used top-level
* use_reducer now returns an Rc instead of a Box
* destructor now called when component is destroyed
* use_effect now accepts one tuple instead of a number of dependencies
* added functional components + hooks + tests
* added wasm pack to travis yaml
* fixed warnings
* ran rustfmt on files
* fix nit
* fix nit
* fix nit use_reducer_with_init
* fixed nit Rc can be Box
* fixed nit: unnecessary boxing
* UseRefState now tuple struct
* fixed unecessary option for phantomdata
* userefstate is now a type alias for Rc<RefCell<T>>;
* integrated suggested change to hook state storing and extracting
* functional-yew -> functional
* tests now work with stdweb *and* web_sys 😊
* correctly implemented use_effect
* removed next tick, message is now an FnOnce -> bool, renamed render_call
* tests now run on web_sys only, making functional yew backend agnostic
* removed use_effect hook for seperate PR
* chore; comment cleanup
* reintroducing use_effect hook
* adjusted use_effect hook behaviour and added tests:
use_effect() always runs
callbacks are executed in the message callback, meaning they can use NodeRef
neither trigger a rerender
* improved test coverage to check for previous render passes
* yew-functional needs yew dependency to have a feature specified, as the package resolver does not infer it from the version used top-level
* use_reducer now returns an Rc instead of a Box
* destructor now called when component is destroyed
* use_effect now accepts one tuple instead of a number of dependencies
* minor chore (warnings)
Co-authored-by: Mathis <mk@thepeaklab.com>
* fixed missing feature flag for yew dependency
* added functional components + hooks + tests
* added wasm pack to travis yaml
* fixed warnings
* ran rustfmt on files
* fix nit
* fix nit
* fix nit use_reducer_with_init
* fixed nit Rc can be Box
* fixed nit: unnecessary boxing
* UseRefState now tuple struct
* fixed unecessary option for phantomdata
* userefstate is now a type alias for Rc<RefCell<T>>;
* integrated suggested change to hook state storing and extracting
* functional-yew -> functional
* tests now work with stdweb *and* web_sys 😊
* correctly implemented use_effect
* hook test now running as stdweb. also removed redundant deps
* removed next tick, message is now an FnOnce -> bool, renamed render_call
* tests now run on web_sys only, making functional yew backend agnostic
* removed use_effect hook for seperate PR
* chore
* we didn't need that Rc anymore
* chore; comment cleanup
Co-authored-by: Mathis <mk@thepeaklab.com>